Skip to Main Content Skip to Search
Product Documentation

im2double - Convert image to double precision

Syntax

I2 = im2double(I)
RGB2 = im2double(RGB)
I = im2double(BW)
X2 = im2double(X,'indexed')

Description

I2 = im2double(I) converts the intensity image I to double precision, rescaling the data if necessary.

If the input image is of class double, the output image is identical.

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.

Examples

I1 = reshape(uint8(linspace(1,255,25)),[5 5])
I2 = im2double(I1)

See Also

double | im2int16 | im2single | im2uint16 | im2uint8

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

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