-
Notifications
You must be signed in to change notification settings - Fork 1
Optical Flow
Optical flow or optic flow is the pattern of apparent motion of objects, surfaces, and edges in a visual scene caused by the relative motion between an observer and a scene. This essentially replaces the grayscale pixel values with motion vectors at each pixel that estimate direction and magnitude of movement at each pixel. These motion vectors are computed over small neighborhoods, making them much more robust than any grayscale-based statistics such as fluctuation variance or even beat frequency.
The term optical flow is also used by roboticists, encompassing related techniques from image processing and control of navigation including motion detection, object segmentation, time-to-contact information, focus of expansion calculations, luminance, motion compensated encoding, and stereo disparity measurement.
Figure 1. The optical flow vector of a moving object in a video sequence.
The implementation of optical-flow in this project is the Dense Optical flow, which uses Gunner Farneback's algorithm for the gradient parameter calculation. Open CV implementation code is available under 'util' directory(optical_flow.py), and the run instructions are in the file itself.
References:
- https://en.wikipedia.org/wiki/Optical_flow
- http://www.diva-portal.org/smash/get/diva2:273847/FULLTEXT01.pdf
- https://docs.opencv.org/3.3.1/d7/d8b/tutorial_py_lucas_kanade.html,
- https://docs.opencv.org/2.4/modules/video/doc/motion_analysis_and_object_tracking.html,
- https://github.com/opencv/opencv/blob/master/samples/python/opt_flow.py
- https://stackoverflow.com/questions/273192/how-can-i-create-a-directory-if-it-does-not-exist,
- https://stackoverflow.com/questions/19932130/python-iterate-through-folders-then-subfolders-and-print-filenames-with-path-t/19932441