[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] SDC Morphology Toolbox V1.1 15Jan02

mmregmax - Regional Maximum.


Synopsis
y = mmregmax( f, Bc )
Input
f: Gray-scale (uint8 or uint16) image.
Bc: Structuring element. (connectivity). Default: Elementary cross (mmsecross).
Output
y: Binary image (logical uint8).
Description
mmregmax creates a binary image y by computing the regional maxima of f, according to the connectivity defined by the structuring element Bc.
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);
image
(f)
image
(y1)
image
(f2)
image
(y2)
Equation

equation

Algorithm
function y=mmregmax_equ( f, bc)
 if (isa(f,'uint8'))
   k = 255;
 else
   k = 65535;
 fplus = mmaddm(f,1);
 g = mmsubm(fplus,mminfrec(f,fplus,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 - Cross structuring element.

[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] Valid XHTML 1.0!
Copyright (c) 1998-2002 by SDC Information Systems