Questions about the rgb2gray function
Ältere Kommentare anzeigen
I am trying to convert the RGB pixel (120, 119, 112) to gray pixel, When using the conversion equation '0.299 * R + 0.587 * G + 0.114 * B' provided by the function document, as following codes shows,
uint8(120 * 0.2989 +119 * 0.587 + 112 * 0.114)
the results is 118. But when using rgb2gray function as follows,
im2gray(aa) % aa is a 1x1x3 matrix [120, 119, 112]
the results is 119.
Does anyone knows why? Thanks!
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu White finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!