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

mmcdil - Dilate an image conditionally.


Synopsis
y = mmcdil( f, g, b, n )
Input
f: Gray-scale (uint8 or uint16) or binary image (logical uint8).
g: Gray-scale (uint8 or uint16) or binary image (logical uint8). Conditioning image.
b: Structuring element. Default: Elementary cross (mmsecross).
n: Non-negative integer. (number of iterations). Default: 1.
 
Obs: f, g must have the same data type.
Output
y: Gray-scale (uint8 or uint16) or binary image (logical uint8).
Description
mmcdil creates the image y by dilating the image f by the structuring element b conditionally to the image g. This operator may be applied recursively n times.
Examples

Numerical examples:

f=mmbinary(uint8([...
 1 0 0 0 0 0 0;...
 0 0 0 0 0 0 0;...
 0 0 0 0 1 0 0]));
g=mmbinary(uint8([...
 1 1 1 0 0 1 1;...
 1 0 1 1 1 0 0;...
 0 0 0 0 1 0 0]));
y1=mmcdil(f,g,mmsecross)

y1 =
     1     1     0     0     0     0     0
     1     0     0     0     1     0     0
     0     0     0     0     1     0     0
y2=mmcdil(f,g,mmsecross,3)

y2 =
     1     1     1     0     0     0     0
     1     0     1     1     1     0     0
     0     0     0     0     1     0     0
f=uint8([...
    0     0    0    80    0    0;...
    0     0    0     0    0    0;...
   10    10    0   255    0    0]);
g=uint8([...
    0     1    2    50    4    5;...
    2     3    4     0    0    0;...
   12   255   14    15   16   17]);
y1=mmcdil(f,g,mmsecross)

y1 =
     0     0     2    50     4     0
     2     3     0     0     0     0
    10    10    14    15    15     0
y2=mmcdil(f,g,mmsecross,3)

y2 =
     0     1     2    50     4     4
     2     3     4     0     0     0
    12    14    14    15    15    15

Binary image:

g=mmreadgray('pcb1bin.tif');
f=mmframe(g,5,5);
y5=mmcdil(f,g,mmsecross,5);
y25=mmcdil(f,g,mmsecross,25);
mmshow(g);
mmshow(g,f);
mmshow(g,y5);
mmshow(g,y25);
image
(g)
image
(g,f)
image
(g,y5)
image
(g,y25)

Gray-scale image:

g=mmneg(mmreadgray('n2538.tif'));
f=mmintersec(g,0);
Warning: Converting image from scalar to uint8.
f=mmdraw(f,'LINE:40,30,60,30:END');
y1=mmcdil(f,g,mmsebox);
y30=mmcdil(f,g,mmsebox,30);
mmshow(g);
mmshow(f);
mmshow(y1);
mmshow(y30);
image
(g)
image
(f)
image
(y1)
image
(y30)
Equation

equation

equation

Algorithm
function y=mmcdil_equ(f,g,b,n)
  y = mmintersec(f,g);
  for i=1:n
    dil = mmdil(y,b);
    y = mmintersec(dil,g);
  end
See Also
mmdil - Dilate an image by a structuring element.
mmfreedom - Control automatic data type conversion.
mmimg2se - Create a structuring element from a pair of images.
mminfrec - Inf-reconstruction.
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