[mminterot] [Up] [mmse2interval] | Intervals (hit-or-miss templates) |
mmintershow creates a representation for an interval using 0, 1 and . ( don't care).
>>> print mmintershow(mmhomothin())
0 0 0 . 1 . 1 1 1
def mmintershow(Iab): from Numeric import array, product, reshape, choose from string import join assert (type(Iab) is tuple) and (len(Iab) == 2),'not proper fortmat of hit-or-miss template' A,Bc = Iab S = mmseunion(A,Bc) Z = mmintersec(S,0) n = product(S.shape) one = reshape(array(n*'1','c'),S.shape) zero = reshape(array(n*'0','c'),S.shape) x = reshape(array(n*'.','c'),S.shape) saux = choose( S + mmseunion(Z,A), ( x, zero, one)) s = '' for i in range(saux.shape[0]): s=s+(join(list(saux[i]))+' \n') return s
mmfreedom | Control automatic data type conversion. |
mmendpoints | Interval to detect end-points. |
mmhomothick | Interval for homotopic thickening. |
mmhomothin | Interval for homotopic thinning. |
mmse2hmt | Create a Hit-or-Miss Template (or interval) from a pair of structuring elements. |
[mminterot] [Up] [mmse2interval] | ![]() |
Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center. |