- #1
ramdas
- 79
- 0
I have computed magnitude and phase spectrum of very famous image of cameraman using fft function in MATLAB.Here,we get magnitude and phase spectrum of the whole image. But I want to find phase values of the neighboring pixels .
So if given gray scale image 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?
So if given gray scale image 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:
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');
Last edited: