Questions about the rgb2gray function
Afficher commentaires plus anciens
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!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur White dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!