OpenCV for Unity 2.6.4
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
Loading...
Searching...
No Matches
OpenCVForUnity.VideoModule.DISOpticalFlow Class Reference

DIS optical flow algorithm. More...

Public Member Functions

int getFinestScale ()
 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.
 
int getGradientDescentIterations ()
 Maximum number of gradient descent iterations in the patch inverse search stage. Higher values may improve quality in some cases.
 
int getPatchSize ()
 Size of an image patch for matching (in pixels). Normally, default 8x8 patches work well enough in most cases.
 
int getPatchStride ()
 Stride between neighbor patches. Must be less than patch size. Lower values correspond to higher flow quality.
 
bool getUseMeanNormalization ()
 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.
 
bool getUseSpatialPropagation ()
 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.
 
float getVariationalRefinementAlpha ()
 Weight of the smoothness term.
 
float getVariationalRefinementDelta ()
 Weight of the color constancy term.
 
float getVariationalRefinementEpsilon ()
 Norm value shift for robust penalizer.
 
float getVariationalRefinementGamma ()
 Weight of the gradient constancy term.
 
int getVariationalRefinementIterations ()
 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.
 
void setFinestScale (int val)
 
void setGradientDescentIterations (int val)
 
void setPatchSize (int val)
 
void setPatchStride (int val)
 
void setUseMeanNormalization (bool val)
 
void setUseSpatialPropagation (bool val)
 
void setVariationalRefinementAlpha (float val)
 
void setVariationalRefinementDelta (float val)
 
void setVariationalRefinementEpsilon (float val)
 
void setVariationalRefinementGamma (float val)
 
void setVariationalRefinementIterations (int val)
 
- Public Member Functions inherited from OpenCVForUnity.VideoModule.DenseOpticalFlow
void calc (Mat I0, Mat I1, Mat flow)
 Calculates an optical flow.
 
void collectGarbage ()
 Releases all inner buffers.
 
- Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
virtual void clear ()
 Clears the algorithm state.
 
virtual bool empty ()
 Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read.
 
virtual string getDefaultName ()
 
IntPtr getNativeObjAddr ()
 
void save (string filename)
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

static new DISOpticalFlow __fromPtr__ (IntPtr addr)
 
static DISOpticalFlow create ()
 Creates an instance of DISOpticalFlow.
 
static DISOpticalFlow create (int preset)
 Creates an instance of DISOpticalFlow.
 
- Static Public Member Functions inherited from OpenCVForUnity.VideoModule.DenseOpticalFlow
static new DenseOpticalFlow __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
static Algorithm __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 

Static Public Attributes

const int PRESET_FAST = 1
 
const int PRESET_MEDIUM = 2
 
const int PRESET_ULTRAFAST = 0
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.VideoModule.DenseOpticalFlow
- Protected Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
- Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject
 DisposableOpenCVObject ()
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

- Package Functions inherited from OpenCVForUnity.VideoModule.DenseOpticalFlow
- Package Functions inherited from OpenCVForUnity.CoreModule.Algorithm
- Package Attributes inherited from OpenCVForUnity.DisposableOpenCVObject
- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

DIS optical flow algorithm.

This class implements the Dense Inverse Search (DIS) optical flow algorithm. More details about the algorithm can be found at [Kroeger2016] . Includes three presets with preselected parameters to provide reasonable trade-off between speed and quality. However, even the slowest preset is still relatively fast, use DeepFlow if you need better quality and don't care about speed.

This implementation includes several additional features compared to the algorithm described in the paper, including spatial propagation of flow vectors (getUseSpatialPropagation), as well as an option to utilize an initial flow approximation passed to calc (which is, essentially, temporal propagation, if the previous frame's flow field is passed).

Member Function Documentation

◆ __fromPtr__()

static new DISOpticalFlow OpenCVForUnity.VideoModule.DISOpticalFlow.__fromPtr__ ( IntPtr addr)
static

◆ create() [1/2]

static DISOpticalFlow OpenCVForUnity.VideoModule.DISOpticalFlow.create ( )
static

Creates an instance of DISOpticalFlow.

Parameters
presetone of PRESET_ULTRAFAST, PRESET_FAST and PRESET_MEDIUM

◆ create() [2/2]

static DISOpticalFlow OpenCVForUnity.VideoModule.DISOpticalFlow.create ( int preset)
static

Creates an instance of DISOpticalFlow.

Parameters
presetone of PRESET_ULTRAFAST, PRESET_FAST and PRESET_MEDIUM

◆ Dispose()

override void OpenCVForUnity.VideoModule.DISOpticalFlow.Dispose ( bool disposing)
protectedvirtual

◆ getFinestScale()

int OpenCVForUnity.VideoModule.DISOpticalFlow.getFinestScale ( )

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.

See also
setFinestScale

◆ getGradientDescentIterations()

int OpenCVForUnity.VideoModule.DISOpticalFlow.getGradientDescentIterations ( )

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

See also
setGradientDescentIterations

◆ getPatchSize()

int OpenCVForUnity.VideoModule.DISOpticalFlow.getPatchSize ( )

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

See also
setPatchSize

◆ getPatchStride()

int OpenCVForUnity.VideoModule.DISOpticalFlow.getPatchStride ( )

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

See also
setPatchStride

◆ getUseMeanNormalization()

bool OpenCVForUnity.VideoModule.DISOpticalFlow.getUseMeanNormalization ( )

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.

See also
setUseMeanNormalization

◆ getUseSpatialPropagation()

bool OpenCVForUnity.VideoModule.DISOpticalFlow.getUseSpatialPropagation ( )

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.

See also
setUseSpatialPropagation

◆ getVariationalRefinementAlpha()

float OpenCVForUnity.VideoModule.DISOpticalFlow.getVariationalRefinementAlpha ( )

Weight of the smoothness term.

See also
setVariationalRefinementAlpha

◆ getVariationalRefinementDelta()

float OpenCVForUnity.VideoModule.DISOpticalFlow.getVariationalRefinementDelta ( )

Weight of the color constancy term.

See also
setVariationalRefinementDelta

◆ getVariationalRefinementEpsilon()

float OpenCVForUnity.VideoModule.DISOpticalFlow.getVariationalRefinementEpsilon ( )

Norm value shift for robust penalizer.

See also
setVariationalRefinementEpsilon

◆ getVariationalRefinementGamma()

float OpenCVForUnity.VideoModule.DISOpticalFlow.getVariationalRefinementGamma ( )

Weight of the gradient constancy term.

See also
setVariationalRefinementGamma

◆ getVariationalRefinementIterations()

int OpenCVForUnity.VideoModule.DISOpticalFlow.getVariationalRefinementIterations ( )

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.

See also
setGradientDescentIterations

◆ setFinestScale()

void OpenCVForUnity.VideoModule.DISOpticalFlow.setFinestScale ( int val)

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.

See also
getFinestScale

◆ setGradientDescentIterations()

void OpenCVForUnity.VideoModule.DISOpticalFlow.setGradientDescentIterations ( int val)

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

See also
getGradientDescentIterations

◆ setPatchSize()

void OpenCVForUnity.VideoModule.DISOpticalFlow.setPatchSize ( int val)

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

See also
getPatchSize

◆ setPatchStride()

void OpenCVForUnity.VideoModule.DISOpticalFlow.setPatchStride ( int val)

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

See also
getPatchStride

◆ setUseMeanNormalization()

void OpenCVForUnity.VideoModule.DISOpticalFlow.setUseMeanNormalization ( bool val)

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.

See also
getUseMeanNormalization

◆ setUseSpatialPropagation()

void OpenCVForUnity.VideoModule.DISOpticalFlow.setUseSpatialPropagation ( bool val)

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.

See also
getUseSpatialPropagation

◆ setVariationalRefinementAlpha()

void OpenCVForUnity.VideoModule.DISOpticalFlow.setVariationalRefinementAlpha ( float val)

Weight of the smoothness term.

See also
getVariationalRefinementAlpha

◆ setVariationalRefinementDelta()

void OpenCVForUnity.VideoModule.DISOpticalFlow.setVariationalRefinementDelta ( float val)

Weight of the color constancy term.

See also
getVariationalRefinementDelta

◆ setVariationalRefinementEpsilon()

void OpenCVForUnity.VideoModule.DISOpticalFlow.setVariationalRefinementEpsilon ( float val)

Norm value shift for robust penalizer.

See also
getVariationalRefinementEpsilon

◆ setVariationalRefinementGamma()

void OpenCVForUnity.VideoModule.DISOpticalFlow.setVariationalRefinementGamma ( float val)

Weight of the gradient constancy term.

See also
getVariationalRefinementGamma

◆ setVariationalRefinementIterations()

void OpenCVForUnity.VideoModule.DISOpticalFlow.setVariationalRefinementIterations ( int val)

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

See also
getGradientDescentIterations

Member Data Documentation

◆ PRESET_FAST

const int OpenCVForUnity.VideoModule.DISOpticalFlow.PRESET_FAST = 1
static

◆ PRESET_MEDIUM

const int OpenCVForUnity.VideoModule.DISOpticalFlow.PRESET_MEDIUM = 2
static

◆ PRESET_ULTRAFAST

const int OpenCVForUnity.VideoModule.DISOpticalFlow.PRESET_ULTRAFAST = 0
static

The documentation for this class was generated from the following file: