uba / of

Methods for estimating optical flow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Optical Flow

C++ (experimental) implementation of methods for estimating optical flow

Optical flow is the pattern of apparent motion of objects in a visual scene caused by the relative motion between an observer (an eye or a camera) and the scene. (Wikipedia).

Methods:

  • Horn & Schunck
  • Lucas & Kanade
  • Lucas & Kanade Pyramidal

Usage Example

#include <of/LucasKanadeC2F.h>

double* buffa, buffb; // <- Read images values

// Encapsulate buffers
of::Image* imga = new of::Image(buffa, nlines, ncols);
of::Image* imgb = new of::Image(buffb, nlines, ncols);

// Create specific method implementation
of::OpticalFlow* of = new of::LucasKanadeC2F(imga, imgb);

// Run!
of->compute();

// Can export (u,v) to Optical Flow Middlebury (.flo) file format
of->save("uv.flo");

// Get (u, v) coordinates
of::Image* u = of->getU();
of::Image* v = of->getV();

// Kill 'Em All
delete of;
delete imga;
delete imgb;

Result Examples

Result example Result example Result example Result example Result example Result example

References

About

Methods for estimating optical flow

License:GNU General Public License v3.0


Languages

Language:C++ 88.4%Language:Python 6.7%Language:CMake 2.5%Language:C 2.4%