Create a 2D fourier image to get specific frequency in image

Hi,
I don't know if it was already asked but I tried for several hours to modify a Fourier image.
I created a noisy image with a thresold and I use the FFT. Now, I would like to draw a circle inside the Fourier domain so I use something like:
a = randn(sz1,sz2);
[ux, uy] = meshgrid(([1:sz1]-(fix(sz1/2)+1))/(sz1-mod(sz1,2)),([1:sz2]-(fix(sz2/2)+1))/(sz2-mod(sz2,2)));
ux = ifftshift(ux);
uy = ifftshift(uy);
%polar
th = atan2(uy,ux);
r = sqrt(ux.^2 + uy.^2);
%center
rc = fftshift(r);
thc = fftshift(th);
I get that from several discussions checked. Now what I'd like to do is to realize a ring at a known r from the corner. (To avoid compute the center and everything). Using a mask or something like:
Im_circle = (X.^2+Y.^2<=(frequency.^2));
Im_circle2 = (X.^2+Y.^2 >((frequency-10).^2));
f(Im_circle+Im_circle2) = some maxima...;
And then do a ifft to get my image with the desired frequency. Is this possible ?
Of course, you can ask me why doing this, because I can use a grid directly on my image and it would be similar. But, using this, I want to make sure my space frequencies are well defined.
Don't hesitate to comment because I might be totally wrong in my expectations...
Thanks

Risposte (0)

Richiesto:

il 5 Giu 2018

Modificato:

il 5 Giu 2018

Community Treasure Hunt

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

Start Hunting!

Translated by