How to get the hue/saturation of a grayscale image?
19 views (last 30 days)
Show older comments
Jayzel Castro
on 24 Jan 2014
Commented: Raka Mukherjee
on 23 Jan 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?
0 Comments
Accepted Answer
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
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.
More Answers (1)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!