2D Convolution Source Code (conv2)

I have interested with 2D convolution in Matlab. You can check at Matlab with command conv2. I want to use this function in other language (C#), but can not get the source code in matlab conv2.m files. My friend (Herlan) search in the internet and get the algorithm for 2D convolution source code. This is algorithm 2D Convolution in C#. If you need the other algorithm, you can convert this source to other language (C/C++, VB or other) without much modification.

Copy this code to your C# project and run the program. The sample output from 2D convolution source code above is:

If you check at matlab, our conv2 source code result is same with conv2(A,A,’same’) in Matlab. Please send the comment if you have questions.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.