How to get the hue/saturation of a grayscale image?

19 visualizaciones (últimos 30 días)
Jayzel Castro
Jayzel Castro el 24 de En. de 2014
Comentada: Raka Mukherjee el 23 de En. de 2020
Will I still able to get the hue/saturation of an image if the picture is already a grayscale? Can I use the HSV for getting the hue?

Respuesta aceptada

Image Analyst
Image Analyst el 24 de En. de 2014
Here is how to get the hue and saturation image for a grayscale image:
hueImage = zeros(size(grayscaleImage));
saturationImage = zeros(size(grayscaleImage));
Of course, they are both all zero for a monochrome, grayscale image. Why would they not be? Were you expecting something different?
  11 comentarios
Walter Roberson
Walter Roberson el 22 de En. de 2020
When you copy the same values to the r, g, and b color planes, then the result is a grayscale image. Every pixel will be gray, unless you want to define pure black or pure white as not being "gray" for your purposes.
Raka Mukherjee
Raka Mukherjee el 23 de En. de 2020
Thank you so much. I have got it now. :)

Iniciar sesión para comentar.

Más respuestas (1)

Jayzel Castro
Jayzel Castro el 27 de En. de 2014
Thank you for the answers I understand it now :)

Community Treasure Hunt

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

Start Hunting!

Translated by