I need to find the phase of the images.
43 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Febin Johny
le 22 Juil 2021
Réponse apportée : Constantino Carlos Reyes-Aldasoro
le 22 Juil 2021
Hi,i need to find the phase of the images. I am really new to the MatLab software. when browsed about the same it is told to take fft2 of the images. Then want to take complex conjugate of the second image and so on. but when i done so i didn't get the expected result. Any guidence regarding the same will be helpful.
0 commentaires
Réponses (1)
Constantino Carlos Reyes-Aldasoro
le 22 Juil 2021
Hello
The image that you show could be that of a phase, but it is hard to judge from what you are showing. In any case, here is how this works. Take an image for instance the moon that Matlab has pre-installed.
image1=imread('moon.tif');
imagesc(image1);colormap(gray)
Now, calculate the Fourier transform, notice that we will need to shift it to have the low frequencies in the centre:
image1_fft = fftshift(fft2(image1));
The Fourier transform returns a series of complex numbers (a + b*i):
image1_fft(1,1)
With the complex numbers you can have the real part (0.5811) the imaginary part (1.7218), absolute value, or the phase, i.e. the angle. So, let's display them. First real and imaginary:
imagesc(real(image1_fft))
imagesc(imag(image1_fft))
Now the absolute value (i.e. the magnitude)
imagesc((abs(image1_fft)))
It would seem that the image is empty, but the issue is that the centre is very very large as compared with the rest, to compensate let's use the log
imagesc(log(1+abs(image1_fft)))
Finally, let's look at the phase, or the angle
imagesc((angle(image1_fft)))
And there you go, that is the phase of the moon image.
Hope this helps. If this answers your question, please accept the answer. If not, do let me know.
0 commentaires
Voir également
Catégories
En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!