OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Fri, 03 Jan 2014 07:49:12 -0600filter2d and convolutionshttp://answers.opencv.org/question/26065/filter2d-and-convolutions/Hi,
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,
HansFri, 03 Jan 2014 05:11:22 -0600http://answers.opencv.org/question/26065/filter2d-and-convolutions/Answer by Guanta for <p>Hi,</p>
<p>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.</p>
<p>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?</p>
<p>Best regards,
Hans</p>
http://answers.opencv.org/question/26065/filter2d-and-convolutions/?answer=26071#post-id-26071Yes it is the same for symmetric kernels, see e.g. [http://www.cs.umd.edu/~djacobs/CMSC426/Convolution.pdf](http://www.cs.umd.edu/~djacobs/CMSC426/Convolution.pdf)Fri, 03 Jan 2014 07:14:37 -0600http://answers.opencv.org/question/26065/filter2d-and-convolutions/?answer=26071#post-id-26071Answer by Mostafa Sataki for <p>Hi,</p>
<p>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.</p>
<p>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?</p>
<p>Best regards,
Hans</p>
http://answers.opencv.org/question/26065/filter2d-and-convolutions/?answer=26072#post-id-26072In the OpenCV library for correlation operation you have to use the matchTemplate function.
For more information use the [this link](http://answers.opencv.org/question/18424/source-image-having-2-or-more-part-matched-with-a/#18440) .Fri, 03 Jan 2014 07:49:12 -0600http://answers.opencv.org/question/26065/filter2d-and-convolutions/?answer=26072#post-id-26072