| [mmconcat] [Up] [mmmaxleveltype] | Image Information and Manipulation |
The minimum (infimum) and maximum (supremum) depend on the data type used to store the image. These values are important to compute many morphological operators (for instance, negate of an image). The output is a vector, where the first element is the infimum and the second, the supremum.
>>> print mmlimits(mmbinary([0, 1, 0]))
[0 1]
>>> print mmlimits(uint8([0, 1, 2]))
[ 0 255]
def mmlimits(f):
from Numeric import array
code = f.typecode()
if code == '1': y=array([0,1])
elif code == 'b': y=array([0,255])
elif code == 'w': y=array([0,65535])
elif code == 'i': y=array([-2147483647,2147483647])
else:
assert 0,'Does not accept this typecode:'+code
return y
| mmneg | Negate an image. |
| [mmconcat] [Up] [mmmaxleveltype] | |
| Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center. |