I got it... After converting RGB to HSI image H = HSI(:,:,1); S = HSI(:,:,2); I = HSI(:,:,3); meanH = mean(H(:)); meanS = mean(S(:)); meanI = mean(I(:)); It works...:)
How to find mean Hue and mean Saturation of an HSI image not HSV image?
13 views (last 30 days)
Show older comments
After converting RGB to HSI, I want to get the mean values for Hue,Saturation and Intensity. I got codes for HSV image i.e.,
hsv = rgb2hsv(segmented_images{2});
h = hsv(:,:,1);
s = hsv(:,:,2);
v = hsv(:,:,3);
binaryImage = v > 0.82 & v < 0.90;
meanHue = mean(h(HSI));
s = hsv(:,:,2);
avgS = mean(s(:));
meanIntensity = mean(i2(:));
%
Can anyone help me with HSI image
2 Comments
Image Analyst
on 28 Feb 2018
But your code never showed where you converted to HSI. You have only the HSV color space, not the HSI color space. My answer below shows how to get HSI rather than HSV like your subject line asked.
Answers (2)
DGM
on 20 May 2022
Edited: DGM
on 20 May 2022
MATLAB has no tools for HSI or HSL. There are tools on the File Exchange. The ones I use are here:
There are also others on the File Exchange, though be aware that Pascal Getreuer's popular Colorspace Transformations has a bug in the HSI path and will give the incorrect results unless you use the .mex version.
How do you find average component values in HSI, HSV, HSL, or any other polar model? You don't use mean() on hue. See this answer for a demonstration:
0 Comments
See Also
Categories
Find more on Modify Image Colors in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!