如何在matlab图像中从unit8转换成Double或single

如题所述

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

再给你几条语句,希望对你有帮助:
im2double():将图像数组转换成double精度类型
im2uint8():将图像数组转换成unit8类型
im2uint16():将图像数组转换成unit16类型
温馨提示:答案为网友推荐,仅供参考