Image Processing Toolbox User's Guide |
Convert image to single precision
Syntax
Description
im2
single 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, im2
single returns the equivalent image of class single, rescaling or offsetting the data as necessary.
I2 = im2
single(I)
converts the intensity image I
to single, rescaling the data if necessary.
RGB2 = im2
single(RGB)
converts the truecolor image RGB
to single, rescaling the data if necessary.
I = im2
single(BW)
converts the binary image BW
to a single-precision intensity image.
X2 = im2
single(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
im2java2d | im2uint16 |
© 1994-2005 The MathWorks, Inc.