OpenCV for Unity  2.6.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.9.0/index.html ) for the details of the argument of the method.
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
OpenCVForUnity.VideoModule.DISOpticalFlow Class Reference

DIS optical flow algorithm. More...

Inheritance diagram for OpenCVForUnity.VideoModule.DISOpticalFlow:
OpenCVForUnity.VideoModule.DenseOpticalFlow OpenCVForUnity.CoreModule.Algorithm OpenCVForUnity.DisposableOpenCVObject OpenCVForUnity.DisposableObject

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

Static Public Member Functions

static new DISOpticalFlow __fromPtr__ (IntPtr addr)
 
static DISOpticalFlow create (int preset)
 Creates an instance of DISOpticalFlow. More...
 
static DISOpticalFlow create ()
 Creates an instance of DISOpticalFlow. More...
 
- 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)
 

Public Attributes

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

Protected Member Functions

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

Additional Inherited Members

- 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 ( int  preset)
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 ( )
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

◆ 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

◆ 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

◆ PRESET_MEDIUM

const int OpenCVForUnity.VideoModule.DISOpticalFlow.PRESET_MEDIUM = 2

◆ PRESET_ULTRAFAST

const int OpenCVForUnity.VideoModule.DISOpticalFlow.PRESET_ULTRAFAST = 0

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