This is a code base for optical flow estimation using Python language, integrating various methods of OpenCV.
- Opencv:
pip3 install opencv-python
- opencv-contrib:
pip3 install opencv-contrib-python==3.3.0.10
pip3 install opencv-contrib-python==3.4.2.16
What if we need to capture the dense optical flow between two images? We only need the following code:
import cv2
from opencv_flow import OpticFlow
of = OpticFLow(mode = 'pcaflow')
img1 = cv2.imread('test/1.jpg')
img2 = cv2.imread('test/2.jpg')
flow = of.getflow(img1, img2)
You can check the wiki docs for specific methods!
In the quick start section, all of our data structures are based on numpy. In this chapter, we mainly make the data structure compatible with Pytorch and develop more functions. You can check the wiki docs for specific methods!