Finding a local minimum in a histogram

조회 수: 4 (최근 30일)
Jonathan Cheng
Jonathan Cheng 2016년 8월 19일
답변: Image Analyst 2016년 8월 20일
I would like to search for the first local minimum in a histogram and determine a threshold value from that. The histogram represents the distribution of intensities of a image-based DNA sequencing experiment, from a total of n=742. Basically, I expect a bimodal distribution of "background" of low intensities and "signal" of high intensities. From the attached image, one can see an obvious left peak of background intensities. I hope to find the intensity at the bottom of the first trough. I have seen a few ways of doing this, including using histcounts but that was not robust to noise in the histogram and bin sizing. I am wondering if someone can recommend an algorithm that will be robust to noise and to bin sizing (i.e. not just using an arbitrary bin size). Thanks.

답변 (2개)

Star Strider
Star Strider 2016년 8월 19일
I can’t tell if the first minimum is the absolute minimum, or something else. If you have the Signal Processing Toolbox, I would take the negative of the counts in your histogram, and use the findpeaks function on it. See the documentation on findpeaks for details.

Image Analyst
Image Analyst 2016년 8월 20일
If you want a robust way of finding the "corner" on the right side of the histogram that is robust to noise, you can try findpeaks() but you might have to fiddle around with a dizzying array of options to determine what is a 'true" peak and what's just a noise blip on the side of a larger peak.
OR you could try the triangle thresholding method. I've attached it. Basically you give it the counts array and tell it what side you want it to find the "corner" of. Essentially it draws a hypoteneusa line from the far tail to the peak. Then it sends lines in perpendicularly in from that line to the actual counts array and finds the gray level which has the longest line. This is the line which will go from the hypoteneuse into the farthest "corner" of the counts array. Essentially it finds the bottom of the hump.

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by