Convolution Principles


Concepts of Linear Systems and Convolution

Discrete Convolution is a tool to build any linear and shift invariant filter. The equation for the convolution, g(x), of the sequence f(x) with the convolution kernel h(x) is

h(x) is also called the impulse response, Point Spread Function PSF, window kernel, window mask, window, filter, or template. This formula can be easily extended to the 2D case.

Region of Support

We normally show the region of support of the convolution kernel. That is, the region where the kernel values are valid. The kernel values are zero outside the region of support.

There are two main types of convolution, depending on how we define the data: Linear Convolution and Circular Convolution.

  1. For the 1D case, let f(x) and h(x) be infinite sequences, with region of support of length N for f(x) and M for h(x), meaning that outside the region of support all the data pointns are zero. Then the convolution g(x) is said to Linear Convolution. The resultant sequence g(x) will also be infinite with region of support of length M+N-1.
  2. Again for the 1D case, if we define f(x) and h(x) as periodic sequences, with the same period N, then the convolution is said to be Circular Convolution. The resultant sequence g(x) will also be periodic with the same period N. In this case, outside the display of f(x), the data is periodically repeated, and outside the region of support of h(x), the data is zero extended up to the completion of one period with dimension N. Remember that h(x) is also periodic with same period as f(x).
Below are the illustrations on how the sequences are represented in both cases

------
Left:original image f; Right: kernel h

-
Left: zero outside (for linear convolution),
Right: periodic (for circular convolution

-
Left: 3x3 kernelfor linear convolution,
Right: 3x3 kernel for circular convolution (periodic with same period as the image)

Origin of a Convolution Kernel

When we define a convolution kernel, we do not always we have the origin of its coordinates positioned at the top left corner of its region of support. Normally, there is a shift in the resultant image if the origin of the convolution kernel is not at the center of its region of support. A simple name for the origin is "sweet spot".

Simple Examples of Convolution

Shifted kernel: h(2,2)=1

linear * =
Linear Convolution. Note the output dimensions: 2 wider, 2 higher

circular * =
Circular Convolution. Note the output with same dimensions.

Averaging with 3x3 Kernel

linear * =
Linear convolution. Note that the top left coordinates should be (-1,-1) since the kernel has negative coordinates

circular * =
Circular Convolution.

Sobel X direction

linear * =
Linear convolution. Note that the top left coordinates should be (-1,-1) since the kernel has negative coordinates

circular * =
Circular convolution.

Observe that if there is an isolated point (impulse) in the input image then the kernel appears reproduced in the filtered or output image.



DIP Feedback Form

Copyright © 1995 KRI, ISTEC, Ramiro Jordán, Roberto Lotufo. All Rights Reserved.