[转载]matlab中的图像数据类型

引用:http://stuay.blog.163.com/blog/static/11574922620104910229858/

 

MATLAB中读入图像的数据类型是uint8,而在矩阵中使用的数据类型是double。
因此 Image2 = im2double(Image1) :把图像数组Image1转换成double精度类型;
如果不转换,在对uint8进行加减时会产生溢出,可能提示的错误提示为:Function '*' is not defined for values of class 'uint8'。

 

uint型的优势在于节省空间,涉及运算时要转换成double型
im2double():将图像数组转换成double精度类型
im2uint8():将图像数组转换成unit8类型
im2uint16():将图像数组转换成unit16类型
原文地址:https://www.cnblogs.com/xfzhang/p/1877105.html