%Filtering RGB images using Gaussian highpass filter
football = imread('football.jpg');
football = football(:,:,1);%only the red component
PQ = paddedsize(size(football));
D0 = 0.05*PQ(1);
H = hpfilter('gaussian', PQ(1), PQ(2), D0);
F =fft2(double(football),size(H,1),size(H,2));
HPF_football = real(ifft2(H.*F));
HPF_football =HPF_football(1:size(football,1),1:size(football,2));
FC = fftshift(F);
S2 = log(1+abs(FC));
subplot(3,1,1);imshow(football,[]);
subplot(3,1,2);imshow(HPF_football,[]);
subplot(3,1,3); imshow(S2, [ ])
