# 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?

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?