[mmopenrec] [Up] [mmregmin] Connected Operators

mmregmax
Regional Maximum.

Synopsis

function y = mmregmax ( f , Bc )

Input

f Image Gray-scale (uint8 or uint16) image
Bc Structuring Element

Default: 3x3 elementary cross

(connectivity).

Output

y Image Binary image

Description

mmregmax creates a binary image y by computing the regional maxima of f, according to the connectivity defined by the structuring element Bc. A regional maximum is a flat zone not surrounded by flat zones of higher gray values.

Examples

Numerical example:
a = uint8([...
    5   10   10   10   10   10   10;...
    5    9    6   18    6    5   10;...
    5    9    6   18    6    8    7;...
    5    9    9   15    9    7   10;...
    5    9    9   15   12   10   10;...
    5    5    5    5   10   10   10]);
b = mmregmax(a)
b =
     0     0     0     0     0     0     0
     0     0     0     1     0     0     0
     0     0     0     1     0     1     0
     0     0     0     0     0     0     0
     0     0     0     0     0     0     0
     0     0     0     0     0     0     0
c = mmregmax(a,mmsebox)
c =
     0     0     0     0     0     0     0
     0     0     0     1     0     0     0
     0     0     0     1     0     0     0
     0     0     0     0     0     0     0
     0     0     0     0     0     0     0
     0     0     0     0     0     0     0
Gray-scale image:
f=mmreadgray('astablet.tif');
y1=mmregmax(f);
f2=mmopen(f,mmsedisk(20));
y2=mmregmax(f2);
mmshow(f);
mmshow(y1);
mmshow(f2);
mmshow(y2);
f y1
f2 y2

Equation

Algorithm

function y=mmregmax_equ( f, bc)
 if (isa(f,'uint8'))
   k = 255;
 else
   k = 65535;
 fminus = mmsubm(f,1);
 g = mmsubm(fplus,mminfrec(fminus,f,bc));
 y = mmunion(mmthreshad(g,1),mmthreshad(f,k)); 

See also

mmfreedom Control automatic data type conversion.
mmregmin Regional Minimum (with generalized dynamics).
mmsebox Create a box structuring element.
mmsecross Diamond structuring element and elementary 3x3 cross.
[mmopenrec] [Up] [mmregmin]