I found this scipy function scipy.signal.peak_prominences that finds the topographic prominence of specified local maxima in a 1d sequence.
But my application requires locating important peaks in a 2D array. I'm aware of some peak finding methods, such as doing a maximum filtering, which both scipy and skimage have their implementations. Also skimage's h_maxima()
allows filtering local peaks that have a minimal relative height. But these only give the coordinates of the peaks, not their prominence .
So how do I compute peak prominence on a 2d array? Any help would be appreciated.
I've cooked a python module using enclosing contour method, following wiki's definition:
optionally one can filter out local peaks that have small cross section area or low prominence values.
I've put the code here: https://github.com/Xunius/python_peak_promience2d, if anyone finds any issue or possible improvement please fire an issue or PR.
A demo graph: