This is python3 code to show optical flow (in npy or pfm) by line. (not arrow yet, maybe when I have more free time)
If there are any bug, please feel free to post an issue.
Coding and testing by Anaconda in Windows 10 with python 3.6.5.
Please make sure already install following package before using this repository:
- opencv
- numpy
- argparse
In this project will have a sample .pfm and a sample .png to show how to use this code.
These .pfm and .png are download from Monkaa scene flow dataset sample pack
You can also find original code about how to read .pfm by python from the above website.
You can run python3 main.py 0048.pfm 0048.png
immediately after you download this repository.
It will save an JPG image named 'output.jpg' and create a windows to show the result.
Run with default augments:
python3 main.py <path/to/pfm> <path/to/image>
Run python3 main.py -h
for more help.
Those lines length mean optical flow vector magnitude and direction mean optical flow vectore direction.