Ask Your Question

Python wrapper for C++ function taking cv::Mat arguments

asked 2012-10-08 17:31:44 -0600

Leszek gravatar image

updated 2012-10-08 17:34:55 -0600

How can I write my own python wrapper function for a C++ function, which does the automatic numpy->cv::Mat conversion for its arguments in the same way as the OpenCV python wrappers do?

As near as I can tell, the (generated) OpenCV python wrappers use pyopencv_to and pyopencv_from from modules/python/cv2.cpp. Should I just copy these (with appropriate licensing)? Or is there a library I can link against which provides such helper functions?

edit retag flag offensive close merge delete


Excellent question. I would also like to know how to exploit these facilities.

SR gravatar imageSR ( 2013-07-17 03:28:34 -0600 )edit

1 answer

Sort by » oldest newest most voted

answered 2012-10-10 02:31:14 -0600

I too am looking for a library or header file that makes it simple to access OpenCV code written in C++ from Python. In case anyone have an idea on the best way to do it, but not enough time to implement it, I might be able to help.

edit flag offensive delete link more


Something like Boost::Python may be a good place to start, if you're interested.

Leszek gravatar imageLeszek ( 2012-10-10 15:38:06 -0600 )edit

Question Tools



Asked: 2012-10-08 17:31:44 -0600

Seen: 826 times

Last updated: Oct 10 '12