convert image from uint8 to double

조회 수: 584 (최근 30일)
S
S 2011년 5월 26일
댓글: DGM 2024년 6월 18일
Hi,
Could someone tells me the difference between 'I=im2double(I);' and 'I=double(I);'. I have a simple image called 'I' with the following properties
Name Size Bytes Class Attributes
I 512x512 262144 uint8
when I apply the first command it gives me the following error message:
??? Undefined function or method 'im2double' for input arguments of type 'uint8'.
But the second command is ok. Why?
I appreciate your help
S:)

채택된 답변

Steve Eddins
Steve Eddins 2011년 5월 26일
You are getting the message "Undefined function or method 'im2double' ..." because that function is part of the Image Processing Toolbox, not MATLAB. Either you don't have the Image Processing Toolbox, or it is not installed correctly.
The function im2double scales the output double-precision values to the range [0.0, 1.0]. The function uint8 does not do this scaling.
  댓글 수: 2
Sean de Wolski
Sean de Wolski 2011년 5월 26일
Personally, I avoid im2double for this very reason. ;)
DGM
DGM 2024년 6월 18일
Since R2014b, im2double() is in the base toolbox.

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

추가 답변 (1개)

chelfremi
chelfremi 2017년 2월 12일
I used
pic = imread('wk2.gif');
im2double(pic);
My original pic was Unit8
Then it gives me:
  댓글 수: 3
Harizi Amira
Harizi Amira 2019년 5월 25일
Where can I put this instruction to get the result in all cells ?ff.PNG
Walter Roberson
Walter Roberson 2019년 5월 25일
ffdouble = cellfun(@im2double, ff, 'uniform', 0);

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

카테고리

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