Function File: im2int16 (img)

Convert image to int16.

The conversion of img to a 16-bit signed integer, is dependent on the type of input image. The following input classes are supported:

uint8 or uint16

Values are rescaled to the range of the int16 class [-32768 32767].

logical

True and false values are assigned a value of 32767 and -32768 respectively.

double or single

Values are truncated to the interval [0 1] and then rescaled to the range of values of the int16 class [-32768 32767].

int16

Returns the same image.

See also: im2bw, imcast, im2uint8, im2double, im2single, im2uint16.

Package: image