Function File:  imhmax (im, h)
Function File:  imhmax (im, h, conn)

Caculate the morphological h-maximum transform of an image im.

This function removes all regional maxima in the grayscale image im whose height is lower or equal to the given threshold level h, and it decreases the height of the remaining regional maxima by the value of h. (A "regional maximum" is defined as a connected component of pixels with an equal pixel value that is higher than the value of all its neighboring pixels. And the "height" of a regional maximum can be thought of as minimum pixel value difference between the regional maximum and its neighboring minima.)

The input image im needs to be a real and nonsparse numeric array (of any dimension), and the height parameter h a non-negative scalar number.

The definition of "neighborhood" for this morphological operation can be set with the connectivity parameter conn, which defaults to 8 for 2D images, to 26 for 3D images and to conn(ndims(n), "maximal") in general. conn can be given as scalar value or as a boolean matrix (see conndef for details).

The output is a transformed grayscale image of same type and shape as the input image im.

See also: imhmin, imregionalmax, imextendedmax, imreconstruct.

Package: image