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

mmasf - Alternating Sequential Filtering.


Synopsis
y = mmasf( f, SEQ, b, n )
Input
f: Gray-scale (uint8 or uint16) or binary image (logical uint8).
SEQ: String. 'OC', 'CO', 'OCO', 'COC'. Default: "OC".
b: Structuring element. Default: Elementary cross (mmsecross).
n: Non-negative integer. (number of iterations). Default: 1.
Output
y: Gray-scale (uint8 or uint16) or binary image (logical uint8).
Description
mmasf creates the image y by filtering the image f by n iterations of the close and open alternating sequential filter characterized by the structuring element b. The sequence of opening and closing is controlled by the parameter SEQ. 'OC' performs opening after closing, 'CO' performs closing after opening, 'OCO' performs opening after closing after opening, and 'COC' performs closing after opening after closing.
Examples

Binary image:

f=mmreadgray('gear.tif');
g=mmasf(f,'oc',mmsecross,2);
mmshow(f);
mmshow(g);
image
(f)
image
(g)

Gray-scale image:

f=mmreadgray('fabric.tif');
g=mmasf(f,'oc',mmsecross,3);
mmshow(f);
mmshow(g);
image
(f)
image
(g)
Equation

Case oc:

equation

Case co:

equation

Case oco:

equation

Case coc:

equation

Algorithm
function y=mmasf_equ( f, SEQ, b, n )
switch SEQ
case 'OC',
   y = f;
   for i=1:n
      nb = mmsesum(b,i);
      y = mmclose(y,nb);
      y = mmopen(y,nb);
   end;
case 'CO',
   y = f;
   for i=1:n
      nb = mmsesum(b,i);
      y = mmopen(y,nb);
      y = mmclose(y,nb);
   end;
case 'OCO',
   y = f;
   for i=1:n
      nb = mmsesum(b,i);
      y = mmopen(y,nb);
      y = mmclose(y,nb);
      y = mmopen(y,nb);
   end;
case 'COC',
   y = f;
   for i=1:n
      nb = mmsesum(b,i);
      y = mmclose(y,nb);
      y = mmopen(y,nb);
      y = mmclose(y,nb);
   end;
end; 
See Also
mmasfrec - Alternating Sequential Filtering by reconstruction
mmclose - Morphological closing.
mmfreedom - Control automatic data type conversion.
mmopen - Morphological opening.
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