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 个)

Sounds like you need the histcounts command.

3 个评论

how to select particular percentage of peak for thresholding using this command
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.

请先登录,再进行评论。

类别

在 帮助中心 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息

提问:

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