MATLAB进行灰度图像读取时: I=imread('lena.bmp'); IW=rgb2gray(I); 总报错? Error using ==> timesIntegers can only be combined with integers of the same class, or scalar doubles.Error in ==> rgb2gray at 65 I = X*coef;

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 22:22:44
MATLAB进行灰度图像读取时:I=imread(''lena.bmp'');IW=rgb2gray(I);总报错?Errorusing==>timesIntegerscanonlybecombinedw

MATLAB进行灰度图像读取时: I=imread('lena.bmp'); IW=rgb2gray(I); 总报错? Error using ==> timesIntegers can only be combined with integers of the same class, or scalar doubles.Error in ==> rgb2gray at 65 I = X*coef;
MATLAB进行灰度图像读取时: I=imread('lena.bmp'); IW=rgb2gray(I); 总报错
? Error using ==> times
Integers can only be combined with integers of the same class, or scalar doubles.
Error in ==> rgb2gray at 65
I = X*coef;

MATLAB进行灰度图像读取时: I=imread('lena.bmp'); IW=rgb2gray(I); 总报错? Error using ==> timesIntegers can only be combined with integers of the same class, or scalar doubles.Error in ==> rgb2gray at 65 I = X*coef;
rgb2gray的第65行的代码是在不是3维矩阵的情况下才会进入的.
open rgb2gray你看一下那句话,
if threeD
...
else
I = X*coef;
end
你需要看一下你的I的矩阵格式.