im2int16 - Convert image to 16-bit signed integers

Syntax

I2 = im2int16(I)
RGB2 = im2int16(RGB)
I = im2int16(BW)

Description

I2 = im2int16(I) converts the intensity image I to int16, rescaling the data if necessary. If the input image is of class int16, the output image is identical to it.

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

I = im2int16(BW) converts the binary image BW to an int16 intensity image, changing false-valued elements to -32768 and true-valued elements to 32767.

Class Support

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

Examples

I = reshape(linspace(0,1,20),[5 4])
I2 = im2int16(I)

See Also

im2double, im2single, im2uint8, im2uint16, int16

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS