What's the difference between skimage morphology's h_maxima and peak_local_max?

39 Views Asked by At

I am trying to understand the difference between the h_maxima and peak_local_max methods. They both search for the same thing but use different approaches, right? If so, what criterion should be used to determine which one to choose?

1

There are 1 best solutions below

0
Cris Luengo On

The two methods find local maxima, but use different strategies to filter them:

  • h_maxima selects local maxima that have a minimal height above the baseline, which is defined by the lowest point you pass when going from one local maxima to a neighboring one.
  • peak_local_max selects local maxima by a minimal distance to neighboring local maxima. A local maximum is discarded if there’s a taller one close by.

More often than not, the h_maxima method is the most meaningful one. But peak_local_max can be quite useful for finding peaks in a Hough parameter space, for example, where nearby maxima represent similar lines, you’d only want to select the stronger one of those similar lines.