Getting values of the histogram without actually plotting it

Hello, I am working on automatically adjusting the threshold for an image. How do I select a particular percentage of the peak of the histogram for thresholding without actually plotting the values. The image below was plotted using histogram(Image).

回答 (1 件)

the cyclist
the cyclist 2018 年 8 月 30 日

2 投票

Sounds like you need the histcounts command.

3 件のコメント

D_coder
D_coder 2018 年 8 月 31 日
how to select particular percentage of peak for thresholding using this command
the cyclist
the cyclist 2018 年 8 月 31 日
The histcounts command
N = histcounts(X);
outputs the bin counts, without plotting them.
You could find the maximum value of this
maxN = max(N);
and then set your threshold as some percentage of this maximum value.
D_coder
D_coder 2018 年 9 月 4 日
thats a great idea indeed

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

カテゴリ

質問済み:

2018 年 8 月 30 日

コメント済み:

2018 年 9 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by