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
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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.
A=fft2(img3)
X=fftshift(img3)
image3=abs(A)
plot(image3)
imshow(image3,[])
image32=abs(X)
plot(image32)
imshow(image32,[])
0 Kommentare
Antworten (1)
Varun
am 24 Mär. 2023
Hello!
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",
X=fftshift(A)
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.
imshow(X,[])
You may refer to the following documentation for more details:
0 Kommentare
Siehe auch
Kategorien
Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!