| [mmsesum] [Up] [mmsereflect] | Structuring Elements |
Implemented in Python.
mmsetrans translates a structuring element by a specific value.
>>> b1 = mmseline(5)
>>> mmseshow(b1)
array([0, 0, 0, 0, 1, 1, 1, 1, 1],'1')
>>> b2 = mmsetrans(b1,[2,-2])
>>> mmseshow(b2)
array([[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[1, 1, 1, 1, 1]],'1')
def mmsetrans(Bi, t):
x,v=mmmat2set(Bi)
Bo = mmset2mat((x+t,v))
Bo = Bo.astype(Bi.typecode())
return Bo
| [mmsesum] [Up] [mmsereflect] | |
| Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center. |