[mmislesseq] [Up] [mmtoggle] | Operations |
mmneg returns an image
y
that is the negation (i.e., inverse or involution) of the image
f
. In the binary case,
y
is the complement of
f
.
>>> f=uint8([255, 255, 0, 10, 20, 10, 0, 255, 255])
>>> print mmneg(f)
[ 0 0 255 245 235 245 255 0 0]
>>> print mmneg(uint8([0, 1]))
[255 254]
>>> print mmneg(int32([0, 1]))
[ 0 -1]
def mmneg(f): y = mmlimits(f)[0] + mmlimits(f)[1] - f y = y.astype(f.typecode()) return y
[mmislesseq] [Up] [mmtoggle] | ![]() |
Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center. |