reason for converting image into double

조회 수: 34 (최근 30일)
sandeep kumar
sandeep kumar 2015년 8월 28일
댓글: nabeel raza 2017년 10월 10일
while reading the, why have to convert an image into double format.
  댓글 수: 1
nabeel raza
nabeel raza 2017년 10월 10일
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.

댓글을 달려면 로그인하십시오.

답변 (2개)

Matz Johansson Bergström
Matz Johansson Bergström 2015년 8월 28일
편집: Matz Johansson Bergström 2015년 8월 28일
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 2015년 8월 28일

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by