Image Processing Toolbox    
im2uint16

Convert image array 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 of class double or uint8, im2uint16 returns the equivalent image of class uint16, rescaling or offsetting the data as necessary.

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

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

I = im2uint16(BW) converts the binary image BW to an intensity image of class uint16.

X2 = im2uint16(X1,'indexed') converts the indexed image X1 to uint16, offsetting the data if necessary. Note that it is not always possible to convert an indexed image to uint16. If X1 is of class double, max(X1(:)) must be 65536 or less.

See Also

im2uint8, double, im2double, uint8, uint16, imapprox


  im2uint8 imabsdiff