[mmconcat] [Up] [mmmaxleveltype] | Image Information and Manipulation |
The possible minimum and the possible maximum of an image depend on its data type. 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 possible minimum and the second, the possible maximum.
>>> 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. |
mmdatatype | Return the image datatype string |
[mmconcat] [Up] [mmmaxleveltype] | ![]() |
Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center. |