2
$\begingroup$

I have computed magnitude and phase spectrum of cameraman Gray scale image using fft function. Here, we get magnitude and phase spectrum of the whole image. .Please see the reconstruction of image from phase only part from the accepted answer of Image Reconstruction:Phase vs Magnitude which says that in an image neighboring pixels of the edge,lines and corner are in phase . So I want to find phase values on precise pixels

Given an image of dimensions 256*256, how can I find phase values of pixels at locations(100,121),(100,122) and (100,123) ?

Whether it is possible using Fourier Transform or not? If not ,what is the other way to do it? Can anybody explain it with (or without ) code?

enter image description hereenter image description here

clc;
clear all;
close all;

i=imread('C:\Users\RK\Desktop\cameraman.gif');
%i=rgb2gray(i);
i=uint8(i);

figure,
subplot(1,3,1);imshow(i);
title('Cameraman Gray scale Image');

f1=fft2(i);
f2=log(1+fftshift(f1));


m=abs(f2);
subplot(1,3,2);
imshow(m,[]);
title('Magnitude Spectrum');  

phase=angle(f2);
subplot(1,3,3);a
imshow(phase,[]);
title('Phase Spectrum');
$\endgroup$
  • $\begingroup$ You can't find the precise phase value of a given pixel because of the uncertainty principle. You can only find the phase value for the pixel's neighborhood using short-time Fourier tranform. If you want to know the phase for pixel (100,100), ou have to take a neighborhood, for instance (50:150,50:150) and calculate the 2D Fourier transform on this window. @devraj you have also asked questions on DSP stack exhange, most of them have received good answers, please mark them as answered if they were helpfull to you. $\endgroup$ – Antoine Bassoul Apr 30 '15 at 13:10
  • $\begingroup$ @Antoine Bassoul thanks for your feedback.Do you have any code or output results to compute phase value on any precise pixel locations. $\endgroup$ – devraj May 1 '15 at 9:40
  • $\begingroup$ @Yves Daoust sir, How can you find phase values at certain pixel locations with the help of wavelet transform ? $\endgroup$ – devraj May 1 '15 at 9:42
  • $\begingroup$ The only consistent definition of phase for a single pixel would be the phase of the complex value at that pixel. Since your image data is real and even non-negative, the phase value at all pixels is precisely 0. $\endgroup$ – Jazzmaniac May 1 '15 at 9:43
  • $\begingroup$ @devraj It's a bit cumbersome to write a full tutorial answer about short time fourier transform considering you are a beginer in signal processing, I don't have too much time at the moment. I advice you to check short time fourier transform by yourself, on a practical point of view it is realy just about calculating the fourier transform on a window around your point of interest. More complex issues arises from the window selection and the window's effect on the spectrum. $\endgroup$ – Antoine Bassoul May 1 '15 at 9:45
-1
$\begingroup$

You can't find the precise phase value of a given pixel because of the uncertainty principle. You can only find the phase value for the pixel's neighborhood using short-time Fourier tranform.

If you want to know the phase for pixel (100,100), ou have to take a neighborhood, for instance (50:150,50:150) and calculate the 2D Fourier transform on this window.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.