Skip to main content

CUDA-accelerated volumetric optical flow estimation using the Farneback algorithm

Project description

===========
farneback3d
===========

.. image:: https://badge.fury.io/py/farneback3d.svg
:target: https://badge.fury.io/py/farneback3d
.. image:: https://travis-ci.org/theHamsta/farnback3d.svg?branch=master
:target: https://travis-ci.org/theHamsta/farnback3d


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: <https://docs.opencv.org/3.3.0/de/d9e/classcv_1_1FarnebackOpticalFlow.html>`_ that was used as inspiration for this implementation.

Python interface
===========

The project uses `pycuda <https://github.com/inducer/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
optflow = farneback3d.Farneback(
levels=5,
num_iterations=5,
poly_n=5
)
# 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.


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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

farneback3d-0.0.1.1.tar.gz (31.6 kB view details)

Uploaded Source

File details

Details for the file farneback3d-0.0.1.1.tar.gz.

File metadata

File hashes

Hashes for farneback3d-0.0.1.1.tar.gz
Algorithm Hash digest
SHA256 8e432bcf2389144089a48018bff70d240f339af0ebbae78ddc764adce273ab0d
MD5 7bd32f6f55f816f3c70445721749c6e8
BLAKE2b-256 1112f51a205fa4d5991487caa549186c31e03a86c874d10f67c3fc0df0bde7cd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page