FUNCTION REFERENCE
im2double
Convert an image to double precision.
Convert an image to double precision.
Syntax
I2 = im2double(I)Syntax
I2 = im2double(X, 'indexed')Rescales to the [0, 1] range of double images: uint8 divided by 255, uint16 by 65535, int16 offset by 32768 then divided by 65535; logical gives 0 and 1; double is returned unchanged and single is converted (values outside [0, 1] stay). With 'indexed', integer indices (0-based) get 1 added and floating indices are kept. Works on 2-D and M-by-N-by-C arrays.
Example
im2double(uint8([0 51 255])) % [0 0.2 1]Example
im2double(uint8([0 4]), 'indexed') % [1 5]Differences from MATLAB: int8, int32 and the other integer classes are rejected, as in MATLAB; gpuArray input is not supported.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.