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);