How can i get mean and standard deviation of V component of HSV histogram?

1 回表示 (過去 30 日間)
I have given a task to extract the value of the mean and standard deviation of V or I component from HSV or HSI histogram.
Can anyone help me out?
this is what I am going to do.
convert RGB image into HSV take histogram of that hsv image. then take out value of mean and standard deviation from that hsv histogram.
PLEASE GUIDE IF THESE STEPS ARE GOING TO WORK. THANKS
  2 件のコメント
Fahad Mairaj
Fahad Mairaj 2018 年 4 月 3 日
編集済み: Walter Roberson 2018 年 4 月 3 日
Thanks alot sir. Tht was helpful.
I need a another help that
I have to get the mean and standard deviation values of H S V of 30 images at least. I was getting those values individually which gets me keep writing n storing values in variable.
What i am doing is:
  1. Convert image to hsv
  2. Get H S V values.
  3. Then get mean values of H S V components.
Like
meanV=mean2(V)
meanH=mean2(H)
And go on...
I have 30 images to get these value. Should I go for it just as i am doing?
Or Is there any easier way?

サインインしてコメントする。

採用された回答

Abhishek Ballaney
Abhishek Ballaney 2018 年 3 月 28 日
https://in.mathworks.com/help/matlab/ref/mean.html
https://in.mathworks.com/help/matlab/ref/std.html

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 3 月 28 日
means and standard deviations of hsv histograms are not typically all that meaningful. What question would such a measurement be trying to answer??
Suppose you take
data = rand(1000,1000,3);
rgb = hsv2rgb(data);
subplot(1,3,1)
histogram(reshape(rgb(:,:,1),[],1),25)
subplot(1,3,2)
histogram(reshape(rgb(:,:,1),[],2),25)
subplot(1,3,3)
histogram(reshape(rgb(:,:,1),[],3),25)
That is, we generate uniform data in hsv space, such as would be needed for it to be reasonable that a histogram of the v component would be more or less equally distributed randomly. We convert the uniform data into hsv space, and then look at the red, green, and blue histograms of the rgb data. We can see that most of the data is towards the left edge for all three components.
Thus, in order to expect uniform v component you need to be starting with rgb that tends towards the darker.
If you take that same data and do
hsv = rgb2hsv(data);
and plot the third component, you can see that it is biased towards high value, so rgb that is uniformly random is mostly towards the high value. (Uniform random rgb data is bell curve in brightness, by the way.)
I ran through all of the color demonstration images provided with the image processing toolbox. The one with the smallest standard deviation was onion.png -- which has a small deviation mostly because it is one of the smallest of the images. eSFRTestImage.jpg has the largest standard deviation -- mostly because it is one of the largest images.

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by