필터 지우기
필터 지우기

How to select a particular portion of an image and take Fourier transform

조회 수: 3 (최근 30일)
Hi,
I have a problem in the following code:
% Binary Hologram & Its Corresponding FT
mx=20; my=0;
[x,y]=meshgrid(-1:2/127:1, -1:2/127:1); circ=sqrt(x.^2+y.^2)<1; H=circ.*(cos((x*pi*mx)+(y*pi*my)))>0;
figure(1) imagesc(H); colormap gray; axis image; axis off
%Fourier Transform z=fft2(H, 512,512); m=fftshift(z); q=abs(m);
figure(2) imagesc(q); colormap gray; axis image; axis off title('Focal Spots Of Grating Array'); ******* If we run the above code, the figure 2 gives an array of focal spots( i.e. the white spots). I need to select only one white spot ( which is to the right of central one) and then take the inverse Fourier transform of the selected focal (i.e. white) spot using matlab code. Can any one help me in this regard.
Thanking You!
  댓글 수: 1
Image Analyst
Image Analyst 2013년 1월 9일
Edit your post. Highlight your code. Click {}Code icon above. This will format it so it looks nice.

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

답변 (1개)

Thorsten
Thorsten 2013년 1월 10일
Select the white spot
znew = zeros(size(z));
znew(244:270, 325:350) = z(244:270, 325:350);
Take the inverse FFT
Hnew = real(ifft2(znew));
imagesc(H)
This does what you asked for... Does you really want this result?

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by