https://github.com/scivision/pyoptflow
Optical Flow estimation in pure Python
https://github.com/scivision/pyoptflow
geoscience horn-schunck lucas-kanade optical-flow python
Last synced: about 1 year ago
JSON representation
Optical Flow estimation in pure Python
- Host: GitHub
- URL: https://github.com/scivision/pyoptflow
- Owner: scivision
- License: apache-2.0
- Created: 2016-10-19T03:21:45.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2021-10-18T06:11:16.000Z (over 4 years ago)
- Last Synced: 2025-04-12T08:12:27.334Z (about 1 year ago)
- Topics: geoscience, horn-schunck, lucas-kanade, optical-flow, python
- Language: Python
- Size: 2.61 MB
- Stars: 77
- Watchers: 3
- Forks: 17
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Optical Flow: Horn-Schunck
[](https://doi.org/10.5281/zenodo.1043971)
[](https://github.com/scivision/pyoptflow/actions)
[](http://pepy.tech/project/pyoptflow)
Python implementation of optical flow estimation using only the Scipy stack for:
* Horn Schunck
Lucas-Kanade is also possible in the future, let us know if you're interested in Lucas Kanade.
## Install
```sh
python -m pip install -e .
```
optionally, to run self-tests:
```sh
python -m pip install -e .[tests]
pytest -v
```
## Examples
The program scripts expect `directory` `glob pattern`
[imageio](https://imageio.github.io/) loads a wide varity of images *and* video.
**Box:**
```sh
python HornSchunck.py src/pyoptflow/data/tests/box box*.bmp
```
**Office**: all time steps:
```sh
python HornSchunck.py src/pyoptflow/data/tests/office office*.bmp
```
or just the first 2 time steps:
```sh
python HornSchunck.py src/pyoptflow/data/tests/office office.[0-2].bmp
```
**Rubic**:
```sh
python HornSchunck.py src/pyoptflow/data/tests/rubic rubic*.bmp
```
**Sphere**
```sh
python HornSchunck.py src/pyoptflow/data/tests/sphere sphere*.bmp
```
Compare: Matlab Computer Vision toolbox: in [matlab](./matlab),
similar method in Octave and a comparison plot using Matlab Computer Vision toolbox.
Reference:[Inspiration](https://github.com/ablarry91/Optical-Flow-LucasKanade-HornSchunck/)