[uint8] [Up] [mmframe] Data Type Conversion

uint16
Convert an image to a uint16 image.

Synopsis

img = uint16( f )

Implemented in Python.

Input

f Image

Any image

Output

img Image

The converted image

Description

uint16 clips the input image between the values 0 and 65535 and converts it to the unsigned 16-bit datatype.

Examples

>>> a = int32([-3,0,8,100000])

              
>>> print uint16(a)
[    0     0     8 65535]

Source Code

def uint16(f):
    from Numeric import array, clip
    img = array(clip(f,0,65535)).astype('w')
    return img
    

See also

int32 Convert an image to an int32 image.
uint8 Convert an image to an uint8 image.
mmdatatype Return the image datatype string
[uint8] [Up] [mmframe] Python