Convolution
Convolution
Fourier spectrum
Gaussian filtering
A Gaussian kernel gives less weight to pixels further from the center of the window
0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 0 0 90 90 0 0 90 90 0 0 90 90 0 0 90 90 0 0 0 0 0 0 0 0 1 2 1 2 4 2 1 2 1
0
0 0 0 0 0
0
0 0 0 0 0
0
0 0 0 90 0
90
90 90 0 0 0
90
0 90 0 0 0
90
90 90 0 0 0
90
90 90 0 0 0
90
90 90 0 0 0
0
0 0 0 0 0
0
0 0 0 0 0
Convolution
Remember cross-correlation:
A convolution operation is a cross-correlation where the filter is flipped both horizontally and vertically before being applied to the image:
It is written:
Suppose H is a Gaussian or mean kernel. How does convolution differ from cross-correlation?
F [ gh] F [ g ] F [h]
Convolution in spatial domain is equivalent to multiplication in frequency domain!
f(x,y)
*
h(x,y) |H(sx,sy)|
g(x,y)
|G(sx,sy)|
Edges in images
Image gradient
The gradient of an image:
Effects of noise
Consider a single row or column of the image
Plotting intensity as a function of position gives a signal
Laplacian of Gaussian
Consider
Laplacian of Gaussian
Gaussian
derivative of Gaussian
MATLAB demo
g = fspecial('gaussian',15,2); imagesc(g) surfl(g) gclown = conv2(clown,g,'same'); imagesc(conv2(clown,[-1 1],'same')); imagesc(conv2(gclown,[-1 1],'same')); dx = conv2(g,[-1 1],'same'); imagesc(conv2(clown,dx,'same'); lg = fspecial('log',15,2); lclown = conv2(clown,lg,'same'); imagesc(lclown) imagesc(clown + .2*lclown)
original
smoothed original
FFT
Gaussian
delta function
Laplacian of Gaussian
What is happening?
Unsharp Masking
100 200 300 400 500 200 400 600 800
+a