: im2double (img)
: im2double (img, "indexed")

Convert image to double precision.

The conversion of img to double precision, is dependent on the type of input image. The following input classes are supported:

uint8, uint16, and int16

The range of values from the class is scaled to the interval [0 1].

logical

True and false values are assigned a value of 0 and 1 respectively.

single

Values are cast to double.

double

Returns the same image.

If img is an indexed image, then the second argument should be the string "indexed". If so, then img must either be of floating point class, or unsigned integer class and it will simply be cast to double. If it is an integer class, a +1 offset is applied.

See also: double.

Package: image