Questions about the rgb2gray function
Mostrar comentarios más antiguos
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!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre White en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!