I am trying to apply high pass filter to this image.
A = 'url';
B = imread(A, 'jpg');
figure(1), imshow(B);
C = rgb2gray(B);
figure(2), imshow(C);
e = fspecial('gaussian', [3,3], 0.5);
n = imfilter(C,e);
figure(3), imshow(n)
p = [1 1 1;
1 1 1;
1 1 1]/9;
figure(4), freqz2(p)
D = imfilter(C,p);
figure(5), imshow(D)
K = medfilt2(D,[3 3]);
figure(6), imshow(K)
I am applying a low pass filter here. How can I apply a high pass filter?