Matlab不知发哪合适
I=imread('123junhenghua.jpg');figure;
imshow(I);
J=imnoise(I,'salt & pepper');
figure;imshow(J);
J5=medfilt2(J,[3*3]);
??? Error using ==> medfilt2>parse_inputs
MEDFILT2(A,[M N]): Second argument must consist of two integers.
Error in ==> medfilt2 at 48
[a, mn, padopt] = parse_inputs(varargin{:});
读入的图像是均衡化之后的,想中值滤波一下,红字为matlab弹出的,不知怎么解决。均衡化程序在下面:
I=imread('123.jpg'); figure;
imshow(I);title('a图 原图');
f=double(I);[r,c]=size(f);
F=fft2(f);G=fftshift(F);
d0=15; %半径范围
n=2;%巴特沃斯阶次
a=0.5;b=2.0; %高频强调滤波传递函数系数
mu=floor(r/2);mv=floor(c/2);
for u=1:r
for v=1:c
d=sqrt((u-mu)^2+(v-mv)^2);
Hlpbtw=1/(1+0.414*(d/d0)^(2*n));
Hhpbtw=1-Hlpbtw; Ghpbtw(u,v)=Hhpbtw*G(u,v);
Hhfebtw=a+b*Hhpbtw; Ghfebtw(u,v)=Hhfebtw*G(u,v);
end
end
ghpbtw=ifftshift(Ghpbtw);
fhpbtw=uint8(real(ifft2(ghpbtw)));
ghfebtw=ifftshift(Ghfebtw);
fhfebtw=uint8(real(ifft2(ghfebtw)));
histeq_fhfebtw=histeq(fhfebtw,256);
figure;imshow(histeq_fhfebtw);title('c图均衡化结果');