[mmvmax] [Up] [mminfrec] Connected Operators

mmhmax
Remove peaks with contrast less than h.

Synopsis

y = mmhmax( f, h = 1, Bc = None )

Implemented in Python.

Input

f Image Gray-scale (uint8 or uint16) image.
h Double

Contrast parameter.

Default: 1

Bc Structuring Element

Structuring element ( connectivity).

Default: None (3x3 elementary cross)

Output

y Image Gray-scale (uint8 or uint16) or binary image.

Description

mmhmax inf-reconstructs the gray-scale image f from the marker created by the subtraction of the positive integer value h from f, using connectivity Bc. This operator removes connected peaks with contrast less than h.

Examples

Numerical example:
>>> a = uint8([
    [4,   3,   6,  1,  3,  5,  2],
    [2,   9,   6,  1,  6,  7,  3],
    [8,   9,   3,  2,  4,  9,  4],
    [3,   1,   2,  1,  2,  4,  2]])

              
>>> print mmhmax(a,2,mmsebox())
[[4 3 6 1 3 5 2]
 [2 7 6 1 6 7 3]
 [7 7 3 2 4 7 4]
 [3 1 2 1 2 4 2]]
Signal example:
Image example:
>>> f = mmreadgray('r4x2_256.tif')

              
>>> mmshow(f)

              
>>> fb = mmhmax(f,50)

              
>>> mmshow(fb)

              
>>> mmshow(mmregmax(fb))

            
f fb
mmregmax(fb)

Equation

Source Code

def mmhmax(f, h=1, Bc=None):
    if Bc is None: Bc = mmsecross()
    g = mmsubm(f,h)
    y = mminfrec(g,f,Bc);
    return y
    

See also

mmsecross Diamond structuring element and elementary 3x3 cross.
mmsebox Create a box structuring element.
mmfreedom Control automatic data type conversion.
mmhmin Remove basins with contrast less than h.
mmareaopen Area opening
[mmvmax] [Up] [mminfrec] Python