convert image from uint8 to double

577 Ansichten (letzte 30 Tage)
S
S am 26 Mai 2011
Kommentiert: DGM am 18 Jun. 2024
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:)

Akzeptierte Antwort

Steve Eddins
Steve Eddins am 26 Mai 2011
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 Kommentare
Sean de Wolski
Sean de Wolski am 26 Mai 2011
Personally, I avoid im2double for this very reason. ;)
DGM
DGM am 18 Jun. 2024
Since R2014b, im2double() is in the base toolbox.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

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

Melden Sie sich an, um zu kommentieren.

Kategorien

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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by