Recovery of RGB from a Converted RGB2Gray converted image
Ältere Kommentare anzeigen
Hello, I have browsed the previous attempt for recovering RGB truecolor from grayscale image but have not found a solution that is satisfying so I will post this.
I have an application where I need to process a number of images at different exposures to obtain a sensor response function. To do this, I must make sure that the images are orthorectified. To do this I had to convert them to Grayscale to obtain the affine transformations. I have successfully done this. Now I want to apply the color back into the grayscales from the original images. I thought I would start simple, first with a simple grayscale to RGB recovery. It seems that the best way to do this is to convert the rgb images to indexed images. This is my attempt. Its kinda weird while I have only specified a red channel, I am getting blue and green coming in the resulting recovered RGB image. Any thoughts?
A=imread('DSC08069.JPG');
AmapR=A(:,:,1);
AmapG=A(:,:,2);
AmapB=A(:,:,3);
B=rgb2gray(A);
imshow(B);
Bind=gray2ind(B);
RGB_Aback=ind2rgb(Bind,AmapR);
imshow(RGB_Aback);
4 Kommentare
Image Analyst
am 5 Jan. 2015
I believe you can't. At best you'll get a posterized image (with only 64 colors since you didn't specify a number in gray2ind). You didn't even use ind2rgb correctly. The second argument is supposed to be a colormap, not an image.
Image Analyst
am 5 Jan. 2015
You can colorize it, but not with the original colors. But you shouldn't say "that's too bad" because you don't need to colorize your registered image. Like I said, you still have your original color image. You can register that if you want - you are not stuck with just registering only your gray scale image.
thiirane
am 5 Jan. 2015
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Convert Image Type finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!