Skip to content

Repository files navigation

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 Alldelete of;
delete imga;
delete imgb;

Result Examples

Result exampleResult exampleResult exampleResult exampleResult exampleResult example

References

Releases

Packages

Contributors

Languages