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{:});
总是有的函数出错: