Ask Your Question

filter2d and convolutions

asked 2014-01-03 05:11:22 -0500

Hansg91 gravatar image


For a project i am working on, I want to perform a convolution to get a wavelet response. For this i wanted to use filter2d, but in the documentation it states that it is a correlation and not a convolution. If you want a convolution you'd have to flip the kernel and move the anchor.

Now my question is, if I have a symmetric 2d kernel and keep the anchor at its center (such as with a gaussian kernel), is the correlation calculated with filter2d equal to the convolution? If not, what do I have to change?

Best regards, Hans

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2014-01-03 07:14:37 -0500

Guanta gravatar image

Yes it is the same for symmetric kernels, see e.g.

edit flag offensive delete link more

answered 2014-01-03 07:49:12 -0500

In the OpenCV library for correlation operation you have to use the matchTemplate function. For more information use the this link .

edit flag offensive delete link more

Question Tools


Asked: 2014-01-03 05:11:22 -0500

Seen: 966 times

Last updated: Jan 03 '14