Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 2.17 KB

README.md

File metadata and controls

52 lines (40 loc) · 2.17 KB

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