is my code correct for this question? Get the Fourier transform of image3 using the fft2() command. If the result does not seem to be interesting, center the spectrum of the r
1 回表示 (過去 30 日間)
Get the Fourier transform of image3 using the fft2() command.
If the result does not seem to be interesting, center the spectrum of the result using the fftshift() command.
回答 (1 件)
Varun 2023 年 3 月 24 日
As per my understanding, you want to apply the 2D fast Fourier transform using “fft2” on your image and then call the “fftshift” function to centre the spectrum. I think there’s an error in your code. The input argument to the “fftshift” function must be the result of the “fft2” that has been called in the previous line. So, insteading of passing "img3" to "fftshift",
should do the job. As for plotting the image, plot only works for 2D data, while the image you may be using this on can be 3D, so that can lead to an error. But “imshow()” should be sufficient to display the image. You can pass the resulting image ‘X’ as the input argument after each step to see the outcome.
You may refer to the following documentation for more details: