I need to do 2D convolution using C++. I am looking for a function like MATLAB's conv2 function, but for C++.
I am not looking for any general tips, such as:
- Why don't you use fftw for implementation?
- Why don't you write it yourself for small kernel sizes using for loops?
Because I am 100% sure that many people already have been doing this in a much better way then I will be able to, ever.
Like I said, I am looking for a function like conv2, taking a matrix, a kernel and that let me specify the mode like 'same' http://de.mathworks.com/help/matlab/ref/conv2.html?refresh=true
I have been using Armadillo in the project so far, it only comes with a 1D convolution function. The only library I could come up with providing a 2D convolution is OpenCV. But I would prefer to not add a new giant library only because I am missing one function especially because I am using Qt for displaying graphics.
Any additional suggestions other than OpenCV?