Currently I'm pretty sure there's some nasty memory bugs waiting to surface and a lot of unnecessary data copying going on to account for this.
We should be taking advantage of the NumpyAllocator through the pyopencv_to and pyopencv_from functions in https://github.com/opencv/opencv/blob/master/modules/python/src2/cv2.cpp.
I'm not 100% sure how to do this, so need to do a spike first to figure out the details. A few places to draw inspiration:
Currently I'm pretty sure there's some nasty memory bugs waiting to surface and a lot of unnecessary data copying going on to account for this.
We should be taking advantage of the
NumpyAllocatorthrough thepyopencv_toandpyopencv_fromfunctions in https://github.com/opencv/opencv/blob/master/modules/python/src2/cv2.cpp.I'm not 100% sure how to do this, so need to do a spike first to figure out the details. A few places to draw inspiration: