フィルターのクリア

How can i fix the threshold automatically from the histogram?

2 ビュー (過去 30 日間)
MoonPie1
MoonPie1 2015 年 12 月 16 日
コメント済み: Image Analyst 2015 年 12 月 16 日
How can i fix the threshold automatically from the histogram?

採用された回答

Walter Roberson
Walter Roberson 2015 年 12 月 16 日
First you need to define how you want to make the selection.
In the general case, a histogram of values could have complexity equivalent to a list of random non-negative integers, with up to half of the values potentially being peaks. There could be multiple peaks of the same height; there could be multiple major modes.
  3 件のコメント
Walter Roberson
Walter Roberson 2015 年 12 月 16 日
No, there is no function that combines all of those things.
You still have no defined how you want to make the selection; all you have done is restricted the number of bins without indicating how the threshold is to be chosen from the counts.
But more likely what you are trying to work on is histogram equalization
Image Analyst
Image Analyst 2015 年 12 月 16 日
I don't think histogram equalization would be what she wants. I think that would just make the three gray levels 0, 128, and 255 instead of whatever they are. I think she needs to define what needs to be done after the threshold, for example call regionprops(), like
bw1 = grayImage == grayLevel1;
measurements1 = regionprops(logical(bw1), 'All');
bw2 = grayImage == grayLevel2;
measurements2 = regionprops(logical(bw2), 'All');
bw3 = grayImage == grayLevel3;
measurements3 = regionprops(logical(bw3), 'All');
If it's really NOT 3 gray levels but three humps in the histogram, then she'll have to come up with a automatic thresholding scheme to pick them out. Perhaps multithresh() would do a good job there.
Such speculation can often be reduced if the poster would have just included the image in the first posting.

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

その他の回答 (0 件)

カテゴリ

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