|Image Processing Toolbox User's Guide|
Linear filtering of an image is accomplished through an operation called convolution. Convolution is a neighborhood operation in which each output pixel is the weighted sum of neighboring input pixels. The matrix of weights is called the convolution kernel, also known as the filter. A convolution kernel is a correlation kernel that has been rotated 180 degrees.
For example, suppose the image is
and the convolution kernel is
The following figure shows how to compute the (2,4) output pixel using these steps:
Hence the (2,4) output pixel is
Computing the (2,4) Output of Convolution
© 1994-2005 The MathWorks, Inc.