Giter Club home page Giter Club logo

farneback3d's Introduction

farneback3d

https://travis-ci.org/theHamsta/farnback3d.svg?branch=master

A CUDA implementation of the Farneback optical flow algorithm [1] for the calculation of dense volumetric flow fields. Since this algorithm is based on the approximation of the signal by polynomial expansion it is especial suited for the motion estimation in smooth signals without clear edges.

To know more about the implementation, have a look on this OpenCV class that was used as a template for this implementation.

Development takes place on Github.

Python interface

The project uses pycuda to provide a pure-python package available on PyPi

pip install farneback3d

Usage:

import farneback3d

... # create some numpy volumes vol0 and vol1 (can also be pycuda GPUArrays)

# set parameters for optical flow (parameters have the same meaning as in the OpenCV implementation)
optflow = farneback3d.Farneback(
        pyr_scale=0.8,         # Scaling between multi-scale pyramid levels
        levels=6,              # Number of multi-scale levels
        num_iterations=5,      # Iterations on each multi-scale level
        winsize=9,             # Window size for Gaussian filtering of polynomial coefficients
        poly_n=5,              # Size of window for weighted least-square estimation of polynomial coefficients
        poly_sigma=1.2,        # Sigma for Gaussian weighting of least-square estimation of polynomial coefficients
    )

# calculate frame-to-frame flow between vol0 and vol1
flow = optflow.calc_flow(vol0, vol1)

C++ interface

To be implemented...

Future plans

The current implementation uses a naive approach to perform the necessary convolutions. The algorithm could be sped up drastically by performing separable convolutions along each coordinate axis.

References

[1]Farnebäck, Gunnar. "Two-frame motion estimation based on polynomial expansion." Scandinavian conference on Image analysis. Springer, Berlin, Heidelberg, 2003.

farneback3d's People

Contributors

nikitinvv avatar thehamsta avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.