Image Processing Toolbox    

Convolution

Linear filtering of an image is accomplished through an operation called convolution. In convolution, the value of an output pixel is computed as a weighted sum of neighboring pixels. The matrix of weights is called the convolution kernel, also known as the filter.

For example, suppose the image is

and the convolution kernel is

Then Figure 7-1 shows how to compute the (2,4) output pixel using these steps:

  1. Rotate the convolution kernel 180 degrees about its center element.
  2. Slide the center element of the convolution kernel so that lies on top of the (2,4) element of A.
  3. Multiply each weight in the rotated convolution kernel by the pixel of A underneath.
  4. Sum up the individual products from step 3.

Hence the (2,4) output pixel is

     

Figure 7-1: Computing the (2,4) Output of Convolution


  Linear Filtering Correlation