How to select a particular portion of an image and take Fourier transform
2 次查看(过去 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
2013-1-9
Edit your post. Highlight your code. Click {}Code icon above. This will format it so it looks nice.
回答(1 个)
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?
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!