Understanding Image Smoothing through Convolution and the Fourier Transform - Prof. David , Study notes of Computer Science

The concept of image smoothing through the use of convolution and the fourier transform. Smoothing is used to reduce noise in images by averaging nearby pixel intensities. Convolution involves sliding a function across another function and integrating the product at each position. The fourier transform is important in understanding convolution as it shows that convolution in the spatial domain is equivalent to multiplication in the transform domain. The document also discusses the properties of convolution and the convolution theorem.

Typology: Study notes

Pre 2010

Uploaded on 07/30/2009

koofers-user-vz6
koofers-user-vz6 🇺🇸

5

(1)

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Smoothing and Convolution
Why smooth? Images have noise. The intensity measured at a pixel is the “true”
intensity plus noise. If nearby pixels have similar “true”intensities, then we can use
smoothing to reduce the noise.
Example: True intensities = 100 100 100 100 100 …100. Measured intensities = 100 +
n_i. If we average M pixels we get:
100 + \sum n_i /M. If n_i are zero mean i.i.d. then \sum n_i / M has same mean as n_i
and much lower variance, which drops how?
If we average pixels in a neighborhood, for the continuous case we get:
h(t) = \int_{t-\delta}^{t+\delta} f(t’) dt’.
Equivalently, we can define a function g such that g(t) = 1/2\delta for -\delta <= t <=
\delta, and 0 otherwise. Then:
h(t) = \int_{-\inf}^\inf f(t-u)g(u) du
This is convolution, and can be done with an arbitrary function g. We write h = g*f.
Try to visualize this as taking g and sliding it across the function f. For each position of g,
the value of h(t) is computed at the center of g’s position, by multiplying g and f together,
and integrating.
As another example, we might want to take a weighted average of t’s neighborhood. For
example, if we weight according to a Gaussian, we just have:
g = (1/sqrt(2pi)) exp(-t^2/2sigma^2). Then we convolve with g.
h(t) = \int_{-\inf}^\inf f(t-u)g(u) du
Convolution is linear and shift invariant. Linear, because each element of h is a linear
combination of elements of f (we multiply and integrate). So we have:
g*kf = k(g*f) and g*(f1+f2) = g*f1 + g*f2. Shift invariant because g is applied to every
point in f in exactly the same way.
Because of this linearity, convolution has some important properties, such as
commutivity and associativity.
Convolution Theorem
Now we get to the reason why the fourier transform is important in understanding
convolution. This is because of the convolution theorem. Let F, G, H be the fourier
pf3

Partial preview of the text

Download Understanding Image Smoothing through Convolution and the Fourier Transform - Prof. David and more Study notes Computer Science in PDF only on Docsity!

Smoothing and Convolution

Why smooth? Images have noise. The intensity measured at a pixel is the “true” intensity plus noise. If nearby pixels have similar “true”intensities, then we can use smoothing to reduce the noise.

Example: True intensities = 100 100 100 100 100 …100. Measured intensities = 100 + n_i. If we average M pixels we get: 100 + \sum n_i /M. If n_i are zero mean i.i.d. then \sum n_i / M has same mean as n_i and much lower variance, which drops how?

If we average pixels in a neighborhood, for the continuous case we get:

h(t) = \int_{t-\delta}^{t+\delta} f(t’) dt’.

Equivalently, we can define a function g such that g(t) = 1/2\delta for -\delta <= t <= \delta, and 0 otherwise. Then:

h(t) = \int_{-\inf}^\inf f(t-u)g(u) du

This is convolution, and can be done with an arbitrary function g. We write h = g*f.

Try to visualize this as taking g and sliding it across the function f. For each position of g, the value of h(t) is computed at the center of g’s position, by multiplying g and f together, and integrating.

As another example, we might want to take a weighted average of t’s neighborhood. For example, if we weight according to a Gaussian, we just have:

g = (1/sqrt(2pi)) exp(-t^2/2sigma^2). Then we convolve with g.

h(t) = \int_{-\inf}^\inf f(t-u)g(u) du

Convolution is linear and shift invariant. Linear, because each element of h is a linear combination of elements of f (we multiply and integrate). So we have: gkf = k(gf) and g(f1+f2) = gf1 + g*f2. Shift invariant because g is applied to every point in f in exactly the same way.

Because of this linearity, convolution has some important properties, such as commutivity and associativity.

Convolution Theorem

Now we get to the reason why the fourier transform is important in understanding convolution. This is because of the convolution theorem. Let F, G, H be the fourier

transform of f, g, and h. The convolution theorem states that convolution in the spatial domain is equivalent to multiplication in the transform domain, ie, f*g = h FG = H.

Proof: Suppose h(t) = g*f(t). H(w) = \int exp(-itw) (\int f(t-u)g(u)du) dt We change variables, so that v = t-u.

H(w) = \int \int exp(-i(u+v)w f(v)g(u) dud v = (\int exp(-ivw)f(v)dv) (\int exp(-iuw)g(u)du) = G(w) F(w)

This is a remarkable theorem. It means that if we convolve a sine wave with any kernel, we produce a sine wave of the same frequency. One way to say this is that sines and cosines of varying frequencies are the eigenvectors of convolution. It means that convolution attenuates every frequency by different amounts, and we can understand the effects of convolution by taking the fourier transform of the convolution kernel.

Simplest example: The fourier transform of a delta function is a constant function. We can prove this by just noting that cos(kt) = 1 for any k, and sin(kt) = 0 for any k. This means that convolving with a delta function affects all frequencies the same (since it doesn’t change them). (Why doesn’t this violate Parsevaal’s theorem?)

As another example, we point out that the fourier transform of a Gaussian is a Gaussian. If g(t) is gaussian, the broader g(t) is the narrower G(w) is (and vice versa). This means that smoothing kills high frequency components of a signal. The more we smooth, the more high frequency components we kill. In fact, attenuating high frequency components of a signal can be taken to be the definition of smoothing. To some extent, this is why we learned the fourier transform. So we can understand what smoothing really does.

We can also see why simple averaging isn’t as good a way of smoothing. Let f(t) be constant in the range –T to T. Then it’s fourier transform is:

F(w) = \int_-T^T exp(iwt) dt = 2sin(Tw)/w

the sinc function. This does not decay as fast as a Gaussian. Also it has oscillations that produce odd effects.

The perfect band-pass filter looks like this function in frequency space. Because the inverse fourier transform is taken in the same way as the fourier transform, in the inverse transform of a perfect band-pass is a sinc. It does not decay quickly in space.

Another interesting example is found by taking the derivative of a function. Suppose we have:

f(t) = a0 + \sum a_k cos(kt) + \sum b_k sin(kt).

f’(t) = \sum - ka_k sin(kt) + \sum kb_k cos(kt)