Image Processing Toolbox User's Guide |
Convert image to double precision
Syntax
Description
im2double
takes an image as input, and returns an image of class double
. If the input image is of class double
, the output image is identical to it. If the input image is not double
, im2double
returns the equivalent image of class double
, rescaling or offsetting the data as necessary.
I2 = im2double(I)
converts the intensity image I
to double precision, rescaling the data if necessary.
RGB2 = im2double(RGB)
converts the truecolor image RGB
to double precision, rescaling the data if necessary.
I = im2double(BW)
converts the binary image BW
to a double-precision intensity image.
X2 = im2double(X,'indexed')
converts the indexed image X
to double precision, offsetting the data if necessary.
Class Support
Intensity and truecolor images can be uint8
, uint16
, double
, logical
, single
, or int16
. Indexed images can be uint8
, uint16
, double
or logical
. Binary input images must be logical
. The output image is double
.
Example
See Also
double
, im2single
, im2int16
, im2uint8
, im2uint16
.
im2col | im2int16 |
© 1994-2005 The MathWorks, Inc.