谁能帮我看看这段程序!
网上找的一段同态滤波的程序,中间有一段看不懂clear all;
I = imread('rice.png');
= size(I);
subplot(1,2,1),imshow(I);
title('原图');
T = double(I);
L = log(T);
F = fft2(L);
for i = 1:M
for j = 1:N
D(i,j) = ((i-M/2)^2+(j-N/2)^2);
end
end
c = 1.05; %锐化参数,可调
Do = max(M,N);%本应该是方差,我简化了一下
H = (2.0-0.5)*(1 - exp(c*(-D/(Do^2)))) +0.5;
F = F .* H;
F = ifft2(F);
Y = exp(F);
subplot(1,2,2),imshow(uint8(Y));
title('处理后的图');
运行成功,效果还不错,但就是这段程序不是很懂,不知道他的思路。
for i = 1:M
for j = 1:N
D(i,j) = ((i-M/2)^2+(j-N/2)^2);
end
end
c = 1.05; %锐化参数,可调
Do = max(M,N);%本应该是方差,我简化了一下
H = (2.0-0.5)*(1 - exp(c*(-D/(Do^2)))) +0.5;
F = F .* H;
哪位高手看懂的话给我讲讲啊,谢谢! 高斯锐化滤波
请参考http://forum.vibunion.com/forum/thread-48079-1-1.html
先弄懂原理再看程序
页:
[1]