convert image from uint8 to double
595 次查看(过去 30 天)
显示 更早的评论
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:)
0 个评论
采纳的回答
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 个评论
更多回答(1 个)
chelfremi
2017-2-12
I used
pic = imread('wk2.gif');
im2double(pic);
My original pic was Unit8
Then it gives me:
3 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!