0
$\begingroup$

To my understanding, there are two methods to do linear filtering. One is cross-correlation, and another is convolution. Convolution requires 'flipping' the kernel when you do the calculation.

I think that you can simply do cross-correlation without doing convolution. So I wonder why to choose convolution instead of correlation in image processing.

$\endgroup$
1
  • $\begingroup$ Filtering per se requires convolution. Cross correlation is mathematical the same as cross correlation with a flipped (time or space) kernel. If the kernel is symmetric convolution and correlation are identical operations. $\endgroup$
    – Hilmar
    Sep 26, 2022 at 13:29

2 Answers 2

0
$\begingroup$

There is no particular reason in terms of the algorithm, anything you do with a convolution you can do with a correlation. What makes the convolution nicer is than correlation is that it is commutative and associative.

i.e. if you have multiple filters you could apply conv(x, conv(h1, h2)) could be computed as conv(conv(x, h1), h2), conv(conv(x, h2), h1), conv(x, conv(h2, h1)) (and others commuting x with the filters), so for analysis it is nice to use convolution, you can manipulate it like multiplications. In fact in the frequency domain the convolution reduces to a multiplication.

$\endgroup$
2
$\begingroup$

Be careful what you mean when you say cross-correlation: In statistical signal processing, that means: $$ R_{xy} (\tau) = E\left [ x(t) y(t+\tau) \right ] $$ where $E$ is the expectation operation. This has little to do with convolution.

Convolution, generally, doesn't have a statistical signal processing interpretation and so is less prone to misinterpretation.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.