MATLAB: Operation on RGB Images

rgbrgb componentrgb imagergb to grayscale

I have applied the security algo on Grayscale images which were converted to Grayscale from RGB.Now if want to operation directly on RGB image How can I separate the R,G & B components & merge at the end.
Thanks

Best Answer

The following steps will help you split RGB and merge them again.
I = imread('RGB.jpg');
%RGB split
R=I(:,:,1);
G=I(:,:,2);
B=I(:,:,3);
%merge RGB channels
RGB1=cat(3,R,G,B);
Related Question