| [mmsupgen] [Up] [mmcthin] | Thinning And Thickening |
Implemented in Python.
| y | Image Binary image. |
mmcthick creates the binary image
y by performing a thickening of the binary image
f conditioned to the binary image
g. The number of iterations of the conditional thickening is
n and in each iteration the thickening is characterized by rotations of
theta of the interval
Iab.
def mmcthick(f, g, Iab=None, n=-1, theta=45, DIRECTION="CLOCKWISE"):
from Numeric import product
from string import upper
if Iab is None: Iab = mmhomothick()
DIRECTION = upper(DIRECTION)
assert mmisbinary(f),'f must be binary image'
if n == -1: n = product(f.shape)
y = f
old = y
for i in range(n):
for t in range(0,360,theta):
sup = mmsupgen( y, mminterot(Iab, t, DIRECTION))
y = mmintersec(mmunion( y, sup),g)
if mmisequal(old,y): break
old = y
return y
| mmfreedom | Control automatic data type conversion. |
| mmthick | Image transformation by thickening. |
| mmhomothick | Interval for homotopic thickening. |
| mmse2hmt | Create a Hit-or-Miss Template (or interval) from a pair of structuring elements. |
| [mmsupgen] [Up] [mmcthin] | |
| Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center. |