MATLAB: Luminance component of an image

luminance component of an imageMATLAB Compiler

Hi, I have a frame of a vedio sequence I which is a 288*532 double. How can I extract only the luminance component? Thanks.

Best Answer

Run the following:
I = imread('test.png');
J = rgb2gray(I);
rgb2gray uses the same formual which is used to calculate luminance (to 3 decimal places the formula is):
0.299 * R + 0.587 * G + 0.114 * B
Related Question