Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Port opencv c++ application code to python without losing speed

I've been working on a C++ OpenCV application that needs to be ported to Python (merging with neural net code). I am not concerned so much with OpenCV built in functions, but I have a lot of code that accesses Mats on a pixel level, using matName.at<type>(y, x) as raw index into pixels. I presume that this will slow to a crawl when I try to do the equivalent in Python.

Is there a recommended method for somehow getting the existing C++ code to work under Python? The normal approach in a non-OpenCV app would be to use Cython or similar. But I'm betting that this is encountered often, and that there are more streamlined methods.

Any recommendations appreciated.