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

mmero - Erode an image by a structuring element.


Synopsis
y = mmero( f, b )
Input
f: Gray-scale (uint8 or uint16) or binary image (logical uint8).
b: Structuring element. Default: Elementary cross (mmsecross).
Output
y: Gray-scale (uint8 or uint16) or binary image (logical uint8).
Description
mmero performs the erosion of the image f by the structuring element b. Erosion is a neighbourhood operator that compairs locally b with f, according to an inclusion rule. Since erosion is a fundamental operator to the construction of all other morphological operators, it is also called an elementary operator of Mathematical Morphology. When f is a gray-scale image , b may be a flat or non-flat structuring element.
Examples

Numerical examples

f=mmbinary(uint8([ 1 1 1 0 0 1 1; 1 0 1 1 1 0 0; 0 0 0 0 1 0 0]))

f =
     1     1     1     0     0     1     1
     1     0     1     1     1     0     0
     0     0     0     0     1     0     0
b=mmimg2se(uint8([1 1 0]));
Warning: Converting image from uint8 to binary uint8.
mmseshow(b)

ans =
     1     1     0
mmero(f,b)

ans =
     1     1     1     0     0     0     1
     1     0     0     1     1     0     0
     0     0     0     0     0     0     0
f=uint8([0 1 2 50 4 5; 2 3 4 0 0 0; 12 255 14 15 16 17])

f =
     0     1     2    50     4     5
     2     3     4     0     0     0
    12   255    14    15    16    17
mmero(f,b)

ans =
     0     0     1     2     4     4
     2     2     3     0     0     0
    12    12    14    14    15    16
f=mmbinary(mmreadgray('blob.tif'));
Warning: Converting image from binary uint8 to uint8.
bimg=mmbinary(mmreadgray('blob1.tif'));
Warning: Converting image from binary uint8 to uint8.
b=mmimg2se(bimg);
g=mmero(f,b);
mmshow(f);
mmshow(g);
mmshow(g,mmgradm(f));
image
(f)
image
(g)
image
(g,mmgradm(f))

Gray-scale image:

f=mmreadgray('pcb_gray.tif');
b=mmsedisk(3);
mmshow(f);
mmshow(mmero(f,b));
image
(f)
image
(mmero(f,b))
Equation

Flat structuring element:

equation

Non-flat structuring element:

equation

Where

equation

See Also
mmcero - Erode an image conditionally.
mmdil - Dilate an image by a structuring element.
mmdist - Distance transform.
mmfreedom - Control automatic data type conversion.
mmimg2se - Create a structuring element from a pair of images.
mmsebox - Create a box structuring element.
mmsecross - Cross structuring element.
mmsesum - N-1 iterative Minkowski additions

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