From: Kevin on
Hi,

I am working with a spatial frequency plot and I am trying to isolate the high frequency portion of the picture. My code so far draws a square around the brightest point on the right half of the picture which is how I get the center of the high frequency component:

U=fftshift(fft2(objh)); %Fourier transform of the input
intensity=U.*conj(U); %Intensity
FT2=mat2gray(intensity.*ap); %ap is a high pass filter matrix
Ftemp=FT2(:,X/2+1:X);
[v,d] = max(Ftemp);
[v1,d1] = max(v);
maxm=d(d1);
maxn=d1+X/2;
Dd=32; %arbitrary number for length of each side of the selection square
Fd=FT2(maxm-Dd/2:maxm+Dd/2-1,maxn-Dd/2:maxn+Dd/2-1);

My question is how do you suggest I make a circle selector instead of a square selector? It seems simple but I'm stuck right now. Some hints please?

Thanks in advance,
Kevin