H-maxima transform

In mathematical morphology, the h-maxima transform is a morphological operation used to filter local maxima of an image based on local contrast information. First all local maxima are defined as connected pixels in a given neighborhood with intensity level greater than pixels outside the neighborhood. Second, all local maxima that have height formula_1 lower or equal to a given threshold are suppressed. The height "f" of the remaining maxima is decreased by formula_2.
The h-maxima transform is defined as the reconstruction by dilation of formula_1 from formula_4: