Getting values of the histogram without actually plotting it
조회 수: 59 (최근 30일)
이전 댓글 표시
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/194857/image.png)
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).
댓글 수: 0
답변 (1개)
the cyclist
2018년 8월 30일
댓글 수: 3
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!