im2double
Convert image to double precision
Description
Examples
Input Arguments
Output Arguments
Tips
If the data type of the input image
I
isdouble
,single
, orlogical
, then the output pixel values are identical to the input pixel values.Note
Many MATLAB® functions expect pixel values to be in the range [0, 1] for truecolor images of data type
single
ordouble
. Theim2double
function does not rescale the output when the input image hassingle
ordouble
data type. If your input image is a truecolor image of data typesingle
ordouble
with pixel values outside this range, then you can use therescale
function to scale pixel values to the expected range [0, 1].If
I
is a grayscale or truecolor image with data typeuint8
,uint16
orint16
, thenim2double
rescales output pixel values to the range [0, 1].If
I
is an indexed image with data typeuint8
oruint16
, thenim2double
adds an offset of1
to the output pixel values.