The convolution of two continuous signals and
is defined as
(1) |
(2) |
(3) |
Convolution in discrete form is
(4) |
(5) |
(6) |
If the system in question were a causal system in time domain
(7) |
(8) |
If
is symmetric (almost always true in image
processing), then replacing
by
we get
(9) |
If the input is finite (always true in reality), i.e.,
(10) |
(11) |
(12) |
(13) |
Digital convolution can be best understood graphically (where
the index of is rearranged) as shown below:
We assume the input has
and the kernel
has
(usually an odd number), then the output of the
convolution
has
, as the first component
of
corresponds to the
component of
(with the
components of
aligned with the first
components of
). In order for the output
to have
the same size as the input
, we can pad the two ends
of the input
by
additional components with zeros,
zero padding, or repeating values of the end
components.
In particular, if the elements of the kernel are all the same (an average operator or a low-pass filter), the we can speed up the convolution process while sliding the kernel over the input signal by taking care of only the two ends of the kernel.
In image processing, all of the discussions above for
one-dimensional convolution are generalized into two dimensions,
and is called a convolution kernel, or mask.
(14) |