2
$\begingroup$

I can see most of the places it says "convolution is associative, while correlation, in general, is not".

Denote $*$ convolution operator, let's say you have an image $f$, which you need to convolve with $g$ and then with $h$ : $$f∗g∗h=f∗(g∗h)$$

But when I see the difference between convolution and correlation, correlation is equal to convolution but after flipping the kernel or window.

Can somebody explain with an example why correlation is not associative?

$\endgroup$
3
  • 1
    $\begingroup$ @OlliNiemitalo, done. It's below my usual standard for an answer, but I'm working on becoming less pedantic anyway ... ;) $\endgroup$
    – Jazzmaniac
    Commented Oct 18, 2017 at 22:01
  • $\begingroup$ I have found the link below to explain the answer for convolution and not cross-correlation: thewolfsound.com/mathematical-properties-of-convolution Can you please explain the same for cross-correlation? To me, the answer above was not so 100% clear, so would appreciate more explanation. $\endgroup$ Commented Dec 29, 2022 at 17:12
  • $\begingroup$ @HossamAmer If this question doesn't answer your question and you don't have a different answer for it, please ask a new question, perhaps referring to this one. Adding 'answers' that do not answer the asked question will be deleted. $\endgroup$
    – Peter K.
    Commented Jan 1, 2023 at 19:05

1 Answer 1

3
$\begingroup$

Subtraction is also not associative: (a-b)-c does not equal a-(b-c) in general. The order of the flipping of the sign matters, just like it does for the flipping of the kernel.

$\endgroup$

Your Answer

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

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