# Convolution v.s. Cross Correlation in Digital Image Processing

I understand that from mathematical point of view, only difference between Convolution and Cross Correlation is that Convolution is commutative, while Cross Correlation is not.

In many articles Cross Correlation is explained as measuring similarity between two signals, and Convolution is explained as calculating relationship between two signals.

My question is this, what is the point of commutative property? How does it make Convolution different from Cross Correlation in practice? Or is it just there for "better" mathematics and easier proofs?

• Convolution is much easier to handle in frequency domain since it is direct multiplication of the two frequency response while correlation is multiplying with the complex conjugate of one of the responses. – DSP Novice Mar 15 at 1:53
• I am not sure what answer would you expect. Usually Cross Correlation is implemented using the same machinery as Convolution. Yet while convolution is like Multiplication of Functions Cross Correlation is operation done for specific use cases. – Royi Mar 15 at 8:03

Apart from the formulae, let us go back to their actual meaning, and how they are derived. Talking about convolution: this operation is inherent to Linear-Time-Invariant (LTI) systems. In other words: if

• you want to analyse a system that is linear, and time-invariant,
• or you want to apply a processing or a filter that does not vary in time or space

then the convolution is the ONLY suitable operation.

While cross-correlation is a measure of similarity between two series, computed as a function of the displacement of one relative to the other. Many choices are plausible, the most common is "bilinear" and compatible with energy preservation.

• Thank you for your help! So in other words Cross Correlation measures similarity between two, lets say images, but as a function of the displacement of one relative to another, meaning that if I apply filter F to image I it will measure how much does the filter match the image, while if I cross-correlate image I to filter F it will measure how much does the image match the filter? – Stefan Radonjic Mar 15 at 21:33

One of the most important classes of systems are Linear Time Invariant (or LTI) systems. These can fully described by either their transfer function or their impulse response (which are Fourier transforms of each other).

If you apply an input signal to an LTI system and you want calculate the output signal, you can simply convolve the input with the impulse response.

My question is this, what is the point of commutative property?

The commutative property means that if you want to sent a signal through multiple systems, the order doesn't matter. You can apply the systems in any order you like and the result will still be the same. That's NOT true for non-LTI systems.

How does it make Convolution different from Cross Correlation in practice?

They are used for completely different purposes. Cross Correlation is often used for power spectral analysis, similarity, time/space alignment etc. Convolution is one of the fundamental algorithms for applying LTI systems.