I'm new to |||| and || ||

I have a relative smooth $\mathtt{2D}$ (circle) gaussian surface (height $10$) with several "holes" in it, and the surrounding area [has] some noise (height below $0.5$).

Here's what I did, I transfer[ed] the matrix $\mathcal{A}$ with $\mathcal{A}_f= \text{fftshift}( \text{fft}(\mathcal{A}))$, then I used the for loop to delete all the high frequency component, delete the component with magnitude compar[able] to DC component ($\approx 2.5\mathtt{e}5$), i.e. if $\mathcal{A}_f(i,j) > 1\mathtt{e}3$ , then [set] $A_f(i,j)=0$.

Then, I did a backwards transformation $\mathcal{A}_\text{result}=\text{ifft}(\text{ifftshift}(\mathcal{A}_f))$.

What's so interesting is that, $\mathcal{A}_\text{result}$ clearly identified all the holes (the region with the most changes) as [spikes], and the rest of the graph is almost $0$ with some noises.

My question is that:

  1. What happened here? Why the image returns the value of holes as [spikes]?

  2. Is there any other way to identify the holes with Fourier or convolution filter?


This line of yours

delete the component with magnatude compare to DC component(=2.5e5), i.e. if Af(i,j)>1e3 , then Af(i,j)=0

indicates an effective highpass filter on the typical smooth image data.

Indeed for typical smooth images high, frequency coefficients are generally (but not always) smaller in magnitude compared to the low frequeny coefficients. So deleting large magnitude coefficients will effectively delete low frequency coefficients. But this is not exactly same thing with deleting low frequency coefficients directly. neverthless, such an operation would return mostly a darkened image with certain edges and contours outlined, essentially a very a primitive edge detection exemplified with the following code:

I = im2double(imread('Lena.bmp'));

Ik = fft2(I);
th = 100;
Ik( abs(Ik) > th) = 0;
figure,imshow( 3*real(ifft2(Ik)));

with the result:

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.