Image Processing Toolbox User's Guide |

**Correlation**

The operation called *correlation* is closely related to convolution. In correlation, the value of an output pixel is also computed as a weighted sum of neighboring pixels. The difference is that the matrix of weights, in this case called the *correlation kernel*, is not rotated during the computation. The filter design functions in the Image Processing Toolbox return correlation kernels.

The following figure shows how to compute the (2,4) output pixel of the correlation of `A`

, assuming `h`

is a correlation kernel instead of a convolution kernel, using these steps:

- Slide the center element of the correlation kernel so that lies on top of the (2,4) element of A.
- Multiply each weight in the correlation kernel by the pixel of
`A`

underneath. - Sum the individual products from step 3.

The (2,4) output pixel from the correlation is

**Computing the (2,4) Output of Correlation
**

Convolution | Filtering Using imfilter |

© 1994-2005 The MathWorks, Inc.