fftshift of an image
이전 댓글 표시
Hi all,
I'm trying out to find the wavelength of the wave seen in this image: http://www.flickr.com/photos/66468892@N07/6052890522/
I did the fftshift of the red channel [ im(:,:,1) ] and got this image: http://www.flickr.com/photos/66468892@N07/6052339583/
I did the fftshift of the grayscale [ rgb2gray ] and got this image: http://www.flickr.com/photos/66468892@N07/6052365079/
I think the first pair of lateral peaks on either side of the DC peak, in second and third images, corresponds to the grid lines (a grid pattern can be seen in the first image). How could I correlate the co-ordinates of the next pair of lower peaks to the image? Does those peaks correspond to some characteristic of the wave seen in the first image?
Thanks.
채택된 답변
추가 답변 (5개)
Paul T John
2011년 8월 18일
댓글 수: 2
Mehri Mehrnia
2023년 10월 14일
why fftshift is necessary?
Walter Roberson
2023년 10월 14일
fft() returns back the 2-sided fft. By convention, the order of frequency bins returns back from fft() of real input signals is like
0, 1, 2, 3, 4, ... n-1, n, conj(-n), conj(-(n-1)), ... conj(-(4)), conj(-(3)), conj(-(2)), conj(-1)
but people often prefer to visualize it in the order
conj(-(n-1)), ... conj(-(4)), conj(-(3)), conj(-(2)), conj(-1), 0, 1, 2, 3, 4, ... n-1, n
The change is not mathematically significant: it is just easier for people to look at the plots.
Joshua Canfield
2019년 5월 8일
편집: Joshua Canfield
2019년 5월 8일
1 개 추천
How do I plot the 2D DFT against Fx or Fy to obtain the usefull spacial frequency information
Could I sum columns and rows and then plot against Fx or Fy respetively?
Rick Rosson
2011년 8월 18일
0 개 추천
The result of the DFT of an image should also be an image, but the graphs are showing a 1D spectrum. How did you compute the DFT of the image? Prior to calling fftshift, did you use the fft or fft2 function (or some other method)? Can you show a more complete set of MATLAB code that is reproducible by others?
Rick Rosson
2011년 10월 18일
Hi Joseph,
Walter is correct. A single line or line segment, as in the linked image, contains an infinite number of frequencies (or wavelengths).
To expand a bit on this concept:
The DFT of an image is a transform from the space domain (in mm or cm) to the spatial frequency domain (in radians per cm or radians per mm), also known as the wave number. If we use x and y to denote the space domain, then the spatial frequency would be kx and ky respectively. A line segment or rectangle in space does transform into a sinc function in the spatial frequency domain.
It is a bit misleading or confusing to characterize it as sinc( x ) versus x. Rather, it should be sinc( kx ) versus kx. This distinction is crucial in this discussion, because there is a one-to-one relationship between kx and the x-component of the wavelength (and likewise for y). That is,
Lx = 2*pi/kx;
Ly = 2*pi/ky;
So it is actually a function of wavelength, and it includes an infinite number of wavelengths, as Walter points out.
HTH.
Rick
댓글 수: 1
Gova ReDDy
2011년 10월 20일
Thankyou walter and Rick...
dustin Gallegos
2011년 11월 1일
0 개 추천
Hi there - Can you help me do something similar: I am trying to determine the wavelengths of the different colors in a given image. Ultimately, I would like to plot lambda(nm) vs Intensity from the picture.
Thanks !
댓글 수: 1
Walter Roberson
2011년 11월 1일
I suggest you start a new Question with that, and that you post a sample image; See http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
Also maybe you would get the information you need from http://www.mathworks.com/matlabcentral/answers/17011-color-wave-length-and-hue
카테고리
도움말 센터 및 File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!