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

mmasfrec - Alternating Sequential Filtering by reconstruction


Synopsis
y = mmasfrec( f, SEQ, b, bc, n )
Input
f: Gray-scale (uint8 or uint16) or binary image (logical uint8).
SEQ: String. 'OC', 'CO'. Default: "OC".
b: Structuring element. Default: Elementary cross (mmsecross).
bc: 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 by reconstruction and open by reconstruction alternating sequential filter characterized by the structuring element b. The structure element bc is used in the reconstruction. The sequence of opening and closing is controlled by the parameter SEQ. 'OC' performs opening after closing, and 'CO' performs closing after opening.
Examples
f=mmreadgray('fabric.tif');
g=mmasfrec(f,'oc',mmsecross,mmsecross,3);
mmshow(f);
mmshow(g);
image
(f)
image
(g)
Equation

Case oc:

equation

Case co:

equation

Algorithm
function y=mmasfrec_equ( f, SEQ, b, bc, n )
 switch SEQ
 case 'OC',
   y = f;
   for i=1:n
      nb = mmsesum(b,i);
      y = mmcloserec(y,nb,bc);
      y = mmopenrec(y,nb,bc);
   end;
 case 'CO',
   y = f;
   for i=1:n
      nb = mmsesum(b,i);
      y = mmopenrec(y,nb,bc);
      y = mmcloserec(y,nb,bc);
   end;
 end; 
See Also
mmasf - Alternating Sequential Filtering.
mmcloserec - Closing by reconstruction.
mmfreedom - Control automatic data type conversion.
mmopenrec - Opening by 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