How to obtain value from histogram?

3 次查看(过去 30 天)
I am using imhist to create histogram from an image. Now I want to know the value of each bar from Y-axis in the histogram. Can I know how to do that??

采纳的回答

Star Strider
Star Strider 2015-5-4
You only need to ask imhist to output those data:
[counts,binLocations] = imhist(I)
  4 个评论
nurul hafizah
nurul hafizah 2015-5-5
do you know how to calculate mean using counts value?
Star Strider
Star Strider 2015-5-5
You need both ‘counts’ and ‘binLocations’:
image_mean = sum(counts.*binLocations)/sum(counts);

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Histograms 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by