I have computed magnitude and phase spectrum of very famous image of(adsbygoogle = window.adsbygoogle || []).push({}); using fft function in MATLAB.Here,we get magnitude and phase spectrum of thecameramanwholeimage. But I want to find phase values of the neighboring pixels .

So if givengray scaleimage is of dimensions 256*256 and if I want to know phase values say at pixel locations(100,121),(100,122),(100,123) ,How can I find it? Whether it is possible using Fourier Transform or not? If not

,what is the efficient way to do it? Can anybody explain it with (or without) code?

Code (Text):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);

imshow(phase,[]);

title('Phase Spectrum');

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# How to find phase values at neighboring pixel in an image?

**Physics Forums | Science Articles, Homework Help, Discussion**