Ask Your Question
3

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

asked Oct 8 '12

Leszek gravatar image

updated Oct 8 '12

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?

Preview: (hide)

Comments

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

SR gravatar imageSR (Jul 17 '13)edit

1 answer

Sort by » oldest newest most voted
0

answered Oct 10 '12

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.

Preview: (hide)

Comments

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

Leszek gravatar imageLeszek (Oct 10 '12)edit

Question Tools

2 followers

Stats

Asked: Oct 8 '12

Seen: 929 times

Last updated: Oct 10 '12