Using OpenCV 3 from #golang

Go is a great language. But when you need to use OpenCV, you’re stuck with a dilemma. Do you use OpenCV 2.4, which is aging but has C bindings so it’s usable from Go? Or do you use OpenCV 3, which is up-to-date with the latest algorithms and optimisations but only has a C++ interface? If you need OpenCV 3, you cannot call it directly from Go because Go doesn’t support calls to C++ code.

This blog article describes how to use OpenCV from Go anyway, using a C callable wrapper function. All source code is provided in the article.