Page 125 -
P. 125
104 3 Image processing
Surprisingly, smoothing kernels can also be used to sharpen images using a process called
unsharp masking. Since blurring the image reduces high frequencies, adding some of the
difference between the original and the blurred image makes it sharper,
g sharp = f + γ(f − h blur ∗ f). (3.22)
In fact, before the advent of digital photography, this was the standard way to sharpen images
in the darkroom: create a blurred (“positive”) negative from the original negative by mis-
focusing, then overlay the two negatives before printing the final image, which corresponds
to
g unsharp = f(1 − γh blur ∗ f). (3.23)
This is no longer a linear filter but it still works well.
Linear filtering can also be used as a pre-processing stage to edge extraction (Section 4.2)
and interest point detection (Section 4.1) algorithms. Figure 3.14d shows a simple 3 × 3 edge
extractor called the Sobel operator, which is a separable combination of a horizontal central
difference (so called because the horizontal derivative is centered on the pixel) and a vertical
tent filter (to smooth the results). As you can see in the image below the kernel, this filter
effectively emphasizes horizontal edges.
The simple corner detector (Figure 3.14e) looks for simultaneous horizontal and vertical
second derivatives. As you can see however, it responds not only to the corners of the square,
but also along diagonal edges. Better corner detectors, or at least interest point detectors that
are more rotationally invariant, are described in Section 4.1.
3.2.3 Band-pass and steerable filters
The Sobel and corner operators are simple examples of band-pass and oriented filters. More
sophisticated kernels can be created by first smoothing the image with a (unit area) Gaussian
filter,
2
1 x +y 2
G(x, y; σ)= e − 2σ 2 , (3.24)
2πσ 2
and then taking the first or second derivatives (Marr 1982; Witkin 1983; Freeman and Adelson
1991). Such filters are known collectively as band-pass filters, since they filter out both low
and high frequencies.
The (undirected) second derivative of a two-dimensional image,
2
2
∂ f ∂ y
2
∇ f = + , (3.25)
∂x 2 ∂y 2
is known as the Laplacian operator. Blurring an image with a Gaussian and then taking its
Laplacian is equivalent to convolving directly with the Laplacian of Gaussian (LoG) filter,
x + y 2
2 2
2
∇ G(x, y; σ)= − G(x, y; σ), (3.26)
σ 4 σ 2
which has certain nice scale-space properties (Witkin 1983; Witkin, Terzopoulos, and Kass
1986). The five-point Laplacian is just a compact approximation to this more sophisticated
filter.
Likewise, the Sobel operator is a simple approximation to a directional or oriented filter,
which can obtained by smoothing with a Gaussian (or some other filter) and then taking a