im2double
Convert image to double precision
Description
Examples
Input Arguments
Output Arguments
Tips
If the data type of the input image
Iisdouble,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
singleordouble. Theim2doublefunction does not rescale the output when the input image hassingleordoubledata type. If your input image is a truecolor image of data typesingleordoublewith pixel values outside this range, then you can use therescalefunction to scale pixel values to the expected range [0, 1].If
Iis a grayscale or truecolor image with data typeuint8,uint16orint16, thenim2doublerescales output pixel values to the range [0, 1].If
Iis an indexed image with data typeuint8oruint16, thenim2doubleadds an offset of1to the output pixel values.