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

Convert image to single precision

Syntax

Description

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

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

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

I = im2single(BW) converts the binary image BW to a single-precision intensity image.

X2 = im2single(X,'indexed') converts the indexed image X to single precision, offsetting the data if necessary.

Class Support

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

Example

See Also

im2double, im2int16, im2uint8, im2uint16, single


Previous page  im2java2d im2uint16 Next page

© 1994-2005 The MathWorks, Inc.