MATLAB Answers


how to extract R G B

Asked by FIR
on 24 Sep 2011
Latest activity Commented on by Kwen
on 12 Nov 2013

I am working on palm print recognisation,I have an PALM image ,I need to extract R G B components and NRI,CAN ANYONE TELL HOW TO PROCESS,i HAVE UPLOADED THE IMAGE

  1 Comment

on 30 May 2013


No products are associated with this question.

1 Answer

Answer by Image Analyst
on 24 Sep 2011
 Accepted answer

If you have an RGB image, to get the red, green, and blue:

% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);

If you have some special format image, such as a multi-page TIFF image, with the "N" image also stored in it (as your web page hints at), then you might look into the Tiff class. Look it up in the help, especially the page on "Reading Image Data and Metadata from TIFF Files"


on 26 Sep 2011

thank u siR,could u please tell how to extraxt NIR PORTION for taht image which i have uploaded

That image is a PNG file. PNG files are not able to store additional bands, with the exception that a band could be encoded as the alpha (transparency) channel.

It is, however, not clear that what you uploaded was the _original_ image, so we could suspect that the original image was stored in some other file format.

Or is the question merely one of cropping that (already small) image to extract the portion labled NIR ? Working with images that small seems unlikely to be productive.

on 12 Nov 2013

This was exactly what I needed, thank you!!!

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!