MATLAB: I need the code for extracting the digital numbers from the color planes!

codedigital image processingdigital signal processingextractImage Processing Toolbox

I need a code to extract the digital numbers from the three color planes–red, green, blue

Best Answer

Look at impixelinfo() for telling you what the RGB values are as you mouse around.
Here are some snippets that might help you:
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Recombine separate color channels into a single, true color RGB image.
rgbImage = cat(3, redChannel, greenChannel, blueChannel);
% Mask image must be converted to the same integer type
% as the integer image we want to mask.
mask = cast(binaryImage, 'like', rgbImage);
% Multiply the mask by each color channel individually.
maskedRed = redChannel .* mask;
maskedGreen = greenChannel .* mask;
maskedBlue = blueChannel .* mask;
% Recombine separate masked color channels into a single, true color RGB image.
maskedRgbImage = cat(3, maskedRed, maskedGreen, maskedBlue);
Also see my File Exchange for some color image demos:
Related Question