Table of Contents

Class FarnebackOpticalFlow

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Class computing a dense optical flow using the Gunnar Farneback's algorithm.

public class FarnebackOpticalFlow : DenseOpticalFlow, IDisposable
Inheritance
FarnebackOpticalFlow
Implements
Inherited Members

Properties

FastPyramids

Whether to use fast pyramids

public bool FastPyramids { get; set; }

Property Value

bool

Flags

operation flags

public int Flags { get; set; }

Property Value

int

NumIters

number of iterations the algorithm does at each pyramid level

public int NumIters { get; set; }

Property Value

int

NumLevels

number of pyramid layers including the initial image

public int NumLevels { get; set; }

Property Value

int

PolyN

size of the pixel neighborhood used to find polynomial expansion in each pixel

public int PolyN { get; set; }

Property Value

int

PolySigma

standard deviation of the Gaussian that is used to smooth derivatives used as a basis for the polynomial expansion

public double PolySigma { get; set; }

Property Value

double

PyrScale

image scale (<1) to build pyramids for each image

public double PyrScale { get; set; }

Property Value

double

WinSize

averaging window size

public int WinSize { get; set; }

Property Value

int

Methods

Create(int, double, bool, int, int, int, double, int)

Creates instance of cv::FarnebackOpticalFlow.

public static FarnebackOpticalFlow Create(int numLevels = 5, double pyrScale = 0.5, bool fastPyramids = false, int winSize = 13, int numIters = 10, int polyN = 5, double polySigma = 1.1, int flags = 0)

Parameters

numLevels int

number of pyramid layers including the initial image; levels=1 means that no extra layers are created and only the original images are used.

pyrScale double

parameter, specifying the image scale (<1) to build pyramids for each image; pyrScale=0.5 means a classical pyramid, where each next layer is twice smaller than the previous one.

fastPyramids bool
winSize int

averaging window size; larger values increase the algorithm robustness to image noise and give more chances for fast motion detection, but yield more blurred motion field.

numIters int

number of iterations the algorithm does at each pyramid level.

polyN int

size of the pixel neighborhood used to find polynomial expansion in each pixel; larger values mean that the image will be approximated with smoother surfaces, yielding more robust algorithm and more blurred motion field, typically polyN =5 or 7.

polySigma double

standard deviation of the Gaussian that is used to smooth derivatives used as a basis for the polynomial expansion; for polyN=5, you can set polySigma=1.1, for polyN=7, a good value would be polySigma=1.5.

flags int

operation flags that can be a combination of OPTFLOW_USE_INITIAL_FLOW and/or OPTFLOW_FARNEBACK_GAUSSIAN

Returns

FarnebackOpticalFlow