[mmareaopen] [Up] [mmcloserec] | Connected Operators |
Implemented in Python.
f | Image Gray-scale (uint8 or uint16) or binary image. |
SEQ | String Values: "OC" or "CO". Default:
|
b | Structuring Element Default:
|
bc | Structuring Element Default:
|
n | Double Non-negative integer.
(number of iterations). Default:
|
y | Image Same type of
|
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.
def mmasfrec(f, SEQ="OC", b=None, bc=None, n=1): from string import upper if b is None: b = mmsecross() if bc is None: bc = mmsecross() SEQ = upper(SEQ) y = f if SEQ == 'OC': for i in range(1,n+1): nb = mmsesum(b,i) y = mmcloserec(y,nb,bc) y = mmopenrec(y,nb,bc) elif SEQ == 'CO': for i in range(1,n+1): nb = mmsesum(b,i) y = mmopenrec(y,nb,bc) y = mmcloserec(y,nb,bc) else: assert 0,'Only accepts OC or CO for SEQ parameter' return y
[mmareaopen] [Up] [mmcloserec] | ![]() |
Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center. |