注册 登录
编程论坛 Matlab

图像处理的问题

a322 发布于 2006-12-08 08:46, 944 次点击
我安装了MATLAB7.0,在用到图像处理的时候,读取图像,加噪声操作可以,但是在用到中从上到下滤波时,调出直方图时,以及作提限边界时均报错,工具包估计是没问题,请高手答疑.多谢.
1 回复
#2
a3222006-12-08 08:50
出错的原代码

I=imread('c:\image\angel.bmp');
J=imnoise(I,'salt & pepper');
L=medfilt2(J);

medfilt2(J)出错

??? Function ORDFILT2 expected its first input, A, to be two-dimensional.Error in ==> ordfilt2>ParseInputs at 135
iptcheckinput(A, {'numeric','logical'}, {'2d','real'}, mfilename, 'A', 1);

Error in ==> ordfilt2 at 51
[A,order,domain,s,padopt,msg] = ParseInputs(varargin{:});

Error in ==> medfilt2 at 53
b = ordfilt2(a, order, domain, padopt);

------------------------------------------------------------------------------------------------
[junk threshold] = edge(I, 'sobel');
fudgeFactor = .5;
BWs = edge(I,'sobel', threshold * fudgeFactor);
figure, imshow(BWs), title('binary gradient mask');

[junk threshold] = edge(I, 'sobel');
fudgeFactor = .5;
BWs = edge(I,'sobel', threshold * fudgeFactor);
figure, imshow(BWs), title('binary gradient mask');
edge出错:
??? Function EDGE expected its first input, I, to be two-dimensional.

Error in ==> edge>parse_inputs at 564
iptcheckinput(I,{'numeric'},{'nonsparse','2d'},mfilename,'I',1);

Error in ==> edge at 197
[a,method,thresh,sigma,thinning,H,kx,ky] = parse_inputs(varargin{:});
总是有的函数出错:

1