This repository is a PyTorch fork of the OpticalFlow_Visualization (flow_vis) repository, originally published under the MIT license. The optical flow visualization follows the color encoding proposed in the paper "A database and evaluation methodology for optical flow" by Baker et al. published at ICCV 2007 [1].
Simply run the following command to install flow_vis_torch
.
pip install git+https://github.com/ChristophReich1996/Optical-Flow-Visualization-PyTorch
Convert a given flow of the shape [batch size (optional), 2, height, width]
to an RGB image of the shape [batch size (optional), 3, height, width]
by calling flow_vis_torch.flow_to_color
.
import flow_vis_torch
flow_rgb = flow_vis_torch.flow_to_color(flow)
For a detailed example have a look at the example script.
Flow maps taken from the MPI Sintel Flow Dataset [2].
Output flow_vis_torch | Output flow_vis |
[1] @inproceedings{Baker2007,
title={{A Database and Evaluation Methodology for Optical Flow}},
author={Baker, Simon and Roth, Stefan and Scharstein, Daniel and Black, Michael J and Lewis, JP and Szeliski, Richard},
booktitle={{International Conference on Computer Vision (ICCV)}},
pages={1--8},
year={2007},
organization={IEEE}
}
[2] @inproceedings{Butler2012,
title={{A Naturalistic Open Source Movie for Optical Flow Evaluation}},
author={Butler, Daniel J and Wulff, Jonas and Stanley, Garrett B and Black, Michael J},
booktitle={{European Conference on Computer Vision (ECCV)}},
pages = {611--625},
year = {2012},
publisher={Springer}
}