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

19 views (last 30 days)
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?

Accepted Answer

Image Analyst
Image Analyst on 24 Jan 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 Comments
Walter Roberson
Walter Roberson on 22 Jan 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.

Sign in to comment.

More Answers (1)

Jayzel Castro
Jayzel Castro on 27 Jan 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!