what is the support of the rgb2gray function?

i was see the matlab explication about rg2bgray function but I don't understand what is the origin of the numbers that appear in the matlab help:
0.2989 * R + 0.5870 * G + 0.1140 * B
(numbers : 0.2989, 0.5870, 0.1140)
please send me some bibliography.
thanks.

Answers (2)

hi,
There is not big difference between the different formulas, try your own way using the weight 0.3333 :
I=imread('autumn.tif');
I=im2double(I);
X1=rgb2gray(I);
alpha=1/3;
X2=alpha*(I(:,:,1)+I(:,:,2)+I(:,:,3));
sqrt(mean((X1(:)-X2(:)).^2))
subplot(1,2,1), imshow(X1), subplot(1,2,2), imshow(X2), title(' manual')

Asked:

on 21 Jul 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!