From: jane ? on
I use sobel to filter the image both in the spatial domain and frequency domain.
But the results are not the same.
What is the problem?
Thanks~~

I = imread('Lena.bmp');
h = fspecial('sobel')';
H1 = imfilter(I,h);
figure,imshow(H1)

PQ = size(I);
FI = fft2(I,PQ(1),PQ(2));
Hh = ifftshift(freqz2(h,PQ(1),PQ(2)));
H2 = ifft2(Hh.*FI);
figure,imshow(real(H2))