[mmcero] [Up] [mmero] Dilations And Erosions

mmdil
Dilate an image by a structuring element.

Synopsis

function y = mmdil ( f , b )

Input

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

Default: 3x3 elementary cross

Output

y Image

Description

mmdil performs the dilation of image f by the structuring element b. Dilation is a neighbourhood operator that compares locally b with f, according to an intersection rule. Since Dilation 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([ 0 0 0 0 0 0 1; 0 1 0 0 0 0 0; 0 0 0 0 1 0 0]))
f =
     0     0     0     0     0     0     1
     0     1     0     0     0     0     0
     0     0     0     0     1     0     0
b=mmbinary([1, 1, 0]);
Warning: converting image from double to int32
mmseshow(b)
ans =
     1     1     0
mmdil(f,b)
ans =
     0     0     0     0     0     1     1
     1     1     0     0     0     0     0
     0     0     0     1     1     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
mmdil(f,b)
ans =
    1    2   50   50    5    5
    3    4    4    0    0    0
  255  255   15   16   17   17
Binary image:
f=mmbinary(mmreadgray('blob.tif'));
bimg=mmbinary(mmreadgray('blob1.tif'));
b=mmimg2se(bimg);
mmshow(f);
mmshow(mmdil(f,b));
mmshow(mmdil(f,b),mmgradm(f));
f mmdil(f,b)
mmdil(f,b),mmgradm(f)
Gray-scale image:
f=mmreadgray('pcb_gray.tif');
b=mmsedisk(5);
mmshow(f);
mmshow(mmdil(f,b));
f mmdil(f,b)

Equation

Flat structuring element:
Non-flat structuring element:
Where

See also

mmfreedom Control automatic data type conversion.
mmcdil Dilate an image conditionally.
mmero Erode an image by a structuring element.
mmsebox Create a box structuring element.
mmsecross Diamond structuring element and elementary 3x3 cross.
mmimg2se Create a structuring element from a pair of images.
mmsesum N-1 iterative Minkowski additions
[mmcero] [Up] [mmero]