willprice / flowty

The swiss army knife for extracting optical flow
https://flowty.rtfd.org
16 stars 1 forks source link

Replace all Mat creations with NumpyAllocator #29

Open willprice opened 5 years ago

willprice commented 5 years ago

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: