Table of Contents

Class DISOpticalFlow

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

DIS optical flow algorithm. This class implements the Dense Inverse Search (DIS) optical flow algorithm. Includes three presets with preselected parameters to provide reasonable trade-off between speed and quality.

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

Properties

CoarsestScale

Coarsest level of the Gaussian pyramid on which the flow is computed. If set to -1, the auto-computed coarsest scale will be used.

public int CoarsestScale { get; set; }

Property Value

int

FinestScale

Finest level of the Gaussian pyramid on which the flow is computed (zero level corresponds to the original image resolution). The final flow is obtained by bilinear upscaling.

public int FinestScale { get; set; }

Property Value

int

GradientDescentIterations

Maximum number of gradient descent iterations in the patch inverse search stage. Higher values may improve quality in some cases.

public int GradientDescentIterations { get; set; }

Property Value

int

PatchSize

Size of an image patch for matching (in pixels). Normally, default 8x8 patches work well enough in most cases.

public int PatchSize { get; set; }

Property Value

int

PatchStride

Stride between neighbor patches. Must be less than patch size. Lower values correspond to higher flow quality.

public int PatchStride { get; set; }

Property Value

int

UseMeanNormalization

Whether to use mean-normalization of patches when computing patch distance. It is turned on by default as it typically provides a noticeable quality boost because of increased robustness to illumination variations. Turn it off if you are certain that your sequence doesn't contain any changes in illumination.

public bool UseMeanNormalization { get; set; }

Property Value

bool

UseSpatialPropagation

Whether to use spatial propagation of good optical flow vectors. This option is turned on by default, as it tends to work better on average and can sometimes help recover from major errors introduced by the coarse-to-fine scheme employed by the DIS optical flow algorithm. Turning this option off can make the output flow field a bit smoother, however.

public bool UseSpatialPropagation { get; set; }

Property Value

bool

VariationalRefinementAlpha

Weight of the smoothness term

public float VariationalRefinementAlpha { get; set; }

Property Value

float

VariationalRefinementDelta

Weight of the color constancy term

public float VariationalRefinementDelta { get; set; }

Property Value

float

VariationalRefinementEpsilon

Norm value shift for robust penalizer

public float VariationalRefinementEpsilon { get; set; }

Property Value

float

VariationalRefinementGamma

Weight of the gradient constancy term

public float VariationalRefinementGamma { get; set; }

Property Value

float

VariationalRefinementIterations

Number of fixed point iterations of variational refinement per scale. Set to zero to disable variational refinement completely. Higher values will typically result in more smooth and high-quality flow.

public int VariationalRefinementIterations { get; set; }

Property Value

int

Methods

Create(DISOpticalFlowPresetTypes)

Creates an instance of DISOpticalFlow

public static DISOpticalFlow Create(DISOpticalFlowPresetTypes preset = DISOpticalFlowPresetTypes.Fast)

Parameters

preset DISOpticalFlowPresetTypes

one of PRESET_ULTRAFAST, PRESET_FAST and PRESET_MEDIUM

Returns

DISOpticalFlow