https://github.com/iv4n-ga6l/optical_flow_opencv
Optical Flow implementation in OpenCV
https://github.com/iv4n-ga6l/optical_flow_opencv
lucas-kanade opencv optical-flow python
Last synced: 7 months ago
JSON representation
Optical Flow implementation in OpenCV
- Host: GitHub
- URL: https://github.com/iv4n-ga6l/optical_flow_opencv
- Owner: iv4n-ga6l
- Created: 2024-08-17T20:36:09.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-17T20:38:06.000Z (about 1 year ago)
- Last Synced: 2025-01-31T13:13:48.480Z (8 months ago)
- Topics: lucas-kanade, opencv, optical-flow, python
- Language: Python
- Homepage:
- Size: 3.62 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Optical Flow implementation in OpenCV
Optical flow refers to the process of determining the movement of each pixel between two successive frames in a video. Essentially, it involves computing the vector that represents the change in position of a pixel as an object moves between two adjacent images. The core concept is to measure the shift in position of objects due to their motion or the movement of the camera.
### Sparse Optical Flow
There is a demo `lucas_kanade.py` script of **Lucas-Kanade** algorithm which can be run with this command:
```
py demo.py --algorithm lucaskanade --video_path video.mp4
```
### Dense Optical Flow
The wrapper of Dense Optical Flow algorithms `dense_optical_flow.py` can run a couple of OpenCV's algorithm implementations:
- To start the **Dense Lucas-Kanade** algorithm:
```
py demo.py --algorithm lucaskanade_dense --video_path video.mp4
```
- To start the **Farneback** algorithm:
```
py demo.py --algorithm farneback --video_path video.mp4
```
- To start the **RLOF** algorithm:
```
py demo.py --algorithm rlof --video_path video.mp4
```