Gaussian mask for low-pass filter in frequency domain.
이전 댓글 표시
Hey i want to do simple low-pass filter in frequency domain with cutoff frequency 0,2. I need to create mask in frequency plane. Here is my code but it is not elegant at all. Since i am using normalized frequency i have to use normalize distance is that right? is there a elegant way to do it without so many loops? i have to do it manually without using fspecial function. Thank you!
[m n]=size(im);
p=m/2;
q=n/2;
d0=0.2;
for i=1:m
for j=1:n
distance(i,j)=sqrt(((i-p)^2+(j-q)^2));
end
end
distance=mat2gray(distance);
for i=1:m
for j=1:n
Hglp(i,j)=(exp(-(distance(i,j))^2/(2*(d0^2))));
end
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Image Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!