# How to find phase values on precise pixel locations of a given Image? [closed]

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?  clc;
clear all;
close all;

%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');

• 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. – Antoine Bassoul Apr 30 '15 at 13:10
• @Antoine Bassoul thanks for your feedback.Do you have any code or output results to compute phase value on any precise pixel locations. – devraj May 1 '15 at 9:40
• @Yves Daoust sir, How can you find phase values at certain pixel locations with the help of wavelet transform ? – devraj May 1 '15 at 9:42
• 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. – Jazzmaniac May 1 '15 at 9:43
• @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. – Antoine Bassoul May 1 '15 at 9:45