Image Processing Toolbox User's Guide Previous page   Next Page
im2uint16

Convert image to 16-bit unsigned integers

Syntax

Description

im2uint16 takes an image as input and returns an image of class uint16. If the input image is of class uint16, the output image is identical to it. If the input image is not of class uint15, im2uint16 returns the equivalent image of class uint16, rescaling or offsetting the data as necessary.

I2 = im2uint16(I) converts the intensity image I to uint16, rescaling the data if necessary.

RGB2 = im2uint16(RGB) converts the truecolor image RGB to uint16, rescaling the data if necessary.

I = im2uint16(BW) converts the binary image BW to a uint16 intensity image, changing 1-valued elements to 65535.

X2 = im2uint16(X,'indexed') converts the indexed image X to uint16, offsetting the data if necessary. If X is of class double, max(X(:)) must be 65536 or less.

Class Support

Intensity and truecolor images can be uint8, uint16, double, logical, single, or int16. Indexed images can be uint8, uint16, double, or logical. Binary input images must be logical. The output image is uint16.

Example

See Also

im2uint8, double, im2double, uint8, uint16, imapprox


Previous page  im2single im2uint8 Next page

© 1994-2005 The MathWorks, Inc.