Lecture 04 Introduction To Image Filtering
Lecture 04 Introduction To Image Filtering
150 hr = (r-1)/2;
200
hc = (c-1)/2;
[x, y] = meshgrid(-hc:hc, -hr:hr);
250
D = sqrt((x/hc).^2 + (y/hr).^2);
D = sqrt(x.^2 + y.^2);
50
lp = double(D <= Dc);
100
IM = fftshift(fft2(double(im0)));
150
IP = zeros(size(IM));
200
IP = IM .* lp;
im = abs(ifft2(ifftshift(IP)));
250
• The
simplest isotropic derivative operator is
the Laplacian, which, for a function (image)
of two variables, is defined as
• The
discrete Laplacian of two variables in
direction is
1 -4 1 1 -8 1
0 1 0 1 1 1
0 -1 0 -1 -1 -1
-1 4 -1 -1 8 -1
0 -1 0 -1 -1 -1
• h(m,n) = 0;
250
• hf = fft2(h);
50
• b_ft = a_ft.*hf;
• b_filt = ifft2((b_ft));
100
150
200 • imagesc(abs(b_filt))
250
-1 0 1 1 1 1
-1 0 1 0 0 0
-1 0 1 -1 -1 -1
-1 0 1 1 2 1
-2 0 2 0 0 0
-1 0 1 -1 -2 -1