Ask Your Question

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

asked 2018-08-19 20:37:41 -0500

Martian gravatar image

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<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.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-09-09 23:05:54 -0500

Martian gravatar image

For anyone else who has this same question:

There are additional links there to helpful info within Python docs.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-08-19 20:37:41 -0500

Seen: 55 times

Last updated: Sep 09 '18