|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
clc;
[I,map]=imread('f35.jpg');
noisy=imnoise(I,'gaussian',0.01);
imshow(noisy,map);
[M N]=size(I);
F=fft2(noisy);
fftshift(F);
Dcut=100;
D0=150;
D1=250;
for u=1:M
for v=1:N
D(u,v)=sqrt(u^2+v^2);
BUTTERH(u,v)=1/(1+(sqrt(2)-1)*(D(u,v)/Dcut)^2);
EXPOTH(u,v)=exp(log(1/sqrt(2))*(D(u,v)/Dcut)^2);
if D(u,v)<D0
TRAPEH(u,v)=1;
elseif D(u,v)<=D1
TRAPEH(u,v)=(D(u,v)-D1)/(D0-D1);
else
TRAPEH(u,v)=0;
end
end
end
BUTTERG=BUTTERH.*F;
BUTTERfiltered=ifft2(BUTTERG);
EXPOTG=EXPOTH.*F;
EXPOTGfiltered=ifftw(EXPOTG);
TRAPEG=TRAPEH.*F;
TRAPEfiltered=ifft2(TRAPEG);
subplot(2,2,1),imshow(noisy)
subplot(2,2,2),imshow(BUTTERfiltered,map)
subplot(2,2,3),imsow(EXPOTGfiltered,map)
subplot(2,2,4),imshow(TRAPEfiltered,map)
错误信息:
Warning: FFT on values of class UINT8 is obsolete.
Use FFT(DOUBLE(X)) or FFT(SINGLE(X)) instead.
> In uint8.fft at 10
In fft2 at 25
In d3_4_5 at 6
??? Error using ==> times
Matrix dimensions must agree.
Error in ==> d3_4_5 at 25
BUTTERG=BUTTERH.*F;
请哪位高手指点
[ 本帖最后由 ChaChing 于 2009-4-22 07:45 编辑 ] |
|