필터 지우기
필터 지우기

Which function can I use to implement the following image filter?

조회 수: 4 (최근 30일)
I have two questions,
(1) What kind of image filter is this? Is it a band-pass filter?
(2) Which MATLAB function can I use to implement this filter?
Reference:

채택된 답변

Image Analyst
Image Analyst 2017년 1월 3일
편집: Image Analyst 2017년 1월 3일
It looks like a radial low pass filter. If Cx and Cy are not zero then it's like it's filtering (masking) out a spot in the spectrum, so that's kind of like a bandpass filter, but not really since it's a spot not a band.
First they rotate the 2D spectrum by theta for some reason. Then they create H which looks like it's supposed to be multiplied by the image spectrum in Fourier space. You can fft the image, then create the H image, then call
fftImage = fft(grayImage);
outputSpectrum = fftImage .* H;
spatialDomainImage = ifft2(outputSpectrum);
See if you can create H yourself. It's not hard.
  댓글 수: 3
Image Analyst
Image Analyst 2017년 1월 3일
Well it might be. I'm not that familiar with Butterworth. It could be that they're just shifting prior to rotating to do basically what the MATLAB function fftshift() does. In that case it's just moving the DC location to the center of the image, or to the corners, depending on how it started out, as long as Cx and Cy are halfway along the image.
Ba Ba Black Sheep!
Ba Ba Black Sheep! 2017년 1월 3일
function out = u_inverse(u, v, Cx, Cy, theta)
left = (u-Cx) * cos(theta);
right = (v-Cy) * sin(theta);
out = left + right;
end
function out = v_inverse(u, v, Cx, Cy, theta)
left = (-1) * (u-Cx) * sin(theta);
right = (v-Cy) * cos(theta);
out = left + right;
end
function out = H(u, v, Cx, Cy, theta, Du, Dv, N)
u_inv = u_inverse(u, v, Cx, Cy, theta);
v_inv = v_inverse(u, v, Cx, Cy, theta);
u_part = u_inv/Du;
v_part = v_inv/Dv;
out = 1/((1 + (u_part + v_part)^(2*N))^(0.5));
end
function out = KassWitkin(w, h)
u = 0;
v = 0;
Cx = 0;
Cy = 0;
theta = 0;
Du = 0;
Dv = 0;
N = 4;
kernel(1:w, 1:h) = H(u, v, Cx, Cy, theta, Du, Dv, N);
out = kernel;
end

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Digital Filtering에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by