Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Golang binding for C++ API


I maintain a Golang binding for OpenCV, see It uses CGO for bridging C & Go, which means I can only use C API interface.

However, I notice that in OpenCV 2 (and afterward), there is only C++ API. After some googling, I know that you're not gonna support C API anymore after 2.x. Therefore, I decide to try to make a wrapper for C++ API instead. I'm wondering if you could give me suggestion on how I can make it or how I can start with?

Currently, I'm looking into SWIG. My concern is ... when I make a repository (or Go package) for OpenCV wrapper, do I must include the header files of OpenCV if I want to use SWIG? Can I use SWIG without include OpenCV's header files (e.g., leave them in /usr/local/opt/opencv/include)?