reason for converting image into double

34 Ansichten (letzte 30 Tage)
sandeep kumar
sandeep kumar am 28 Aug. 2015
Kommentiert: nabeel raza am 10 Okt. 2017
while reading the, why have to convert an image into double format.
  1 Kommentar
nabeel raza
nabeel raza am 10 Okt. 2017
For Example:
I2 = im2double(I);
I2 = im2double(I,'indexed');
I2 = im2double(I) converts the intensity image I to double precision, rescaling the data if necessary. I can be a grayscale intensity image, a truecolor image, or a binary image. If the input image is of class double, then the output image is identical.

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Matz Johansson Bergström
Matz Johansson Bergström am 28 Aug. 2015
Bearbeitet: Matz Johansson Bergström am 28 Aug. 2015
The reason is precision. Say you read an image using (write this in the Matlab prompt)
>>Im = imread('filename');
>>class(Im)
uint8
The format is integers from 0 to 255. Now if we want to manipulate the image, we can write
>>class(Im*0.5)
uint8
Notice that the format is still integer and not double. This means that we have lost precision. All subsequent manipulatins to the matrix Im will be in integer precision, unless we write something like
Im = im2double(Im)

Walter Roberson
Walter Roberson am 28 Aug. 2015

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by