That is taking an RGB image, img1, and extracting the red, green, and blue parts and creating 3 2-D matrices: r,g, and b.
An RGB image, sometimes referred to as a truecolor image, is stored in MATLAB as an M-by-N-by-3 data array that defines red, green, and blue color components for each individual pixel. RGB images do not use a palette. The color of each pixel is determined by the combination of the red, green, and blue intensities stored in each color plane at the pixel's location.
Best Answer