how can i find more than one minimum points of the histogram??

1 回表示 (過去 30 日間)
user06
user06 2015 年 2 月 5 日
コメント済み: Image Analyst 2015 年 2 月 21 日
Suppose I have a histogram and I want to find the minimum point of the histogram other than 0, then what procedure I should follow? In the histogram image below, the minimum point is approximately 10,15,17. Then how can I find this?

回答 (2 件)

Image Analyst
Image Analyst 2015 年 2 月 5 日
Try this
% Get histogram
[pixelCounts, grayLevels] = imhist(grayImage);
% Find darkest bin with more than 15 pixels in it
darkestGL = find(pixelCounts > 15, 1, 'first');
  36 件のコメント
user06
user06 2015 年 2 月 20 日
do one thing, attach the image and the histogram and the result...
user06
user06 2015 年 2 月 20 日
and the code u have given is just giving the first 3 minimum points. i want overall 3 minimum points

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


Jos (10584)
Jos (10584) 2015 年 2 月 17 日
You can sort the outcome of the histogram
data = ceil(10*rand(100,1))
values = 1:10
count = histc(data,values)
[SortedCount, idx] = sort(count)
SortedValues = values(idx)
disp([SortedValues(:) SortedCount(:)])
  6 件のコメント
user06
user06 2015 年 2 月 21 日
it is not sorting values as per the requirement. i want sorted values on x axis with respect to y. means the value on the x axis having the lowest value on the y axis, that should come first and so on.
Image Analyst
Image Analyst 2015 年 2 月 21 日
I did that in my code above. Like I said, "the lowest bin has one count in it and it occurs at bin 236. The second lowest bin also has only one pixel in it, and it occurs at gray level 237, and the third lowest bin also has only one count in it and it occurs at 247." Explain why 1 is not the lowest y value (count in the bin), and explain why 236,237,247 is not sorted.

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

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by