Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Find Peaks in Histogram

Is there an existing OpenCV function that can tell me the peaks of a histogram? For example; in the following 1d histogram/image (gray-scale) I'd like to get the bin numbers (or ranges) for the 2 or 3 general peaks. PS: what is the technical term for a 'peak' in a histogram?

image description

Maybe there is a function that can sort the bins from highest to lowest (number of pixels for that bin)? I know I can get use cv::minMaxLoc() to find out the highest and lowest bin numbers. Is there anything that can sort the bins?

Find Peaks in Histogram

Is there an existing OpenCV function that can tell me the peaks of a histogram? For example; in the following 1d histogram/image (gray-scale) I'd like to get the bin numbers (or ranges) for the 2 or 3 general peaks. PS: what is the technical term for a 'peak' in a histogram?

image description

Maybe there is a function that can sort the bins from highest to lowest (number of pixels for that bin)? I know I can get use cv::minMaxLoc() to find out the highest and lowest bin numbers. Is there anything that can sort the bins?