OpenCV  4.1.0
Open Source Computer Vision
Public Types | Public Member Functions | Static Public Member Functions | List of all members
cv::DISOpticalFlow Class Referenceabstract

DIS optical flow algorithm. More...

#include <opencv2/video/tracking.hpp>

Inheritance diagram for cv::DISOpticalFlow:
cv::DenseOpticalFlow cv::Algorithm

Public Types

enum  {
  PRESET_ULTRAFAST = 0,
  PRESET_FAST = 1,
  PRESET_MEDIUM = 2
}
 

Public Member Functions

virtual int getFinestScale () const =0
 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.
 
virtual int getGradientDescentIterations () const =0
 Maximum number of gradient descent iterations in the patch inverse search stage. Higher values may improve quality in some cases.
 
virtual int getPatchSize () const =0
 Size of an image patch for matching (in pixels). Normally, default 8x8 patches work well enough in most cases.
 
virtual int getPatchStride () const =0
 Stride between neighbor patches. Must be less than patch size. Lower values correspond to higher flow quality.
 
virtual bool getUseMeanNormalization () const =0
 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.
 
virtual bool getUseSpatialPropagation () const =0
 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.
 
virtual float getVariationalRefinementAlpha () const =0
 Weight of the smoothness term.
 
virtual float getVariationalRefinementDelta () const =0
 Weight of the color constancy term.
 
virtual float getVariationalRefinementGamma () const =0
 Weight of the gradient constancy term.
 
virtual int getVariationalRefinementIterations () const =0
 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.
 
virtual void setFinestScale (int val)=0
 
virtual void setGradientDescentIterations (int val)=0
 
virtual void setPatchSize (int val)=0
 
virtual void setPatchStride (int val)=0
 
virtual void setUseMeanNormalization (bool val)=0
 
virtual void setUseSpatialPropagation (bool val)=0
 
virtual void setVariationalRefinementAlpha (float val)=0
 
virtual void setVariationalRefinementDelta (float val)=0
 
virtual void setVariationalRefinementGamma (float val)=0
 
virtual void setVariationalRefinementIterations (int val)=0
 
- Public Member Functions inherited from cv::DenseOpticalFlow
virtual void calc (InputArray I0, InputArray I1, InputOutputArray flow)=0
 Calculates an optical flow.
 
virtual void collectGarbage ()=0
 Releases all inner buffers.
 
- Public Member Functions inherited from cv::Algorithm
 Algorithm ()
 
virtual ~Algorithm ()
 
virtual void clear ()
 Clears the algorithm state.
 
virtual bool empty () const
 Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read.
 
virtual String getDefaultName () const
 
virtual void read (const FileNode &fn)
 Reads algorithm parameters from a file storage.
 
virtual void save (const String &filename) const
 
virtual void write (FileStorage &fs) const
 Stores algorithm parameters in a file storage.
 
void write (const Ptr< FileStorage > &fs, const String &name=String()) const
 simplified API for language bindingsThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Static Public Member Functions

static Ptr< DISOpticalFlowcreate (int preset=DISOpticalFlow::PRESET_FAST)
 Creates an instance of DISOpticalFlow.
 

Additional Inherited Members

- Protected Member Functions inherited from cv::Algorithm
void writeFormat (FileStorage &fs) const
 

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 atKroeger2016 . 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 Enumeration Documentation

anonymous enum
Enumerator
PRESET_ULTRAFAST 
PRESET_FAST 
PRESET_MEDIUM 

Member Function Documentation

static Ptr<DISOpticalFlow> cv::DISOpticalFlow::create ( int  preset = DISOpticalFlow::PRESET_FAST)
static
Python:
retval=cv.DISOpticalFlow_create([, preset])

Creates an instance of DISOpticalFlow.

Parameters
presetone of PRESET_ULTRAFAST, PRESET_FAST and PRESET_MEDIUM
virtual int cv::DISOpticalFlow::getFinestScale ( ) const
pure virtual
Python:
retval=cv.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
virtual int cv::DISOpticalFlow::getGradientDescentIterations ( ) const
pure virtual
Python:
retval=cv.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
virtual int cv::DISOpticalFlow::getPatchSize ( ) const
pure virtual
Python:
retval=cv.DISOpticalFlow.getPatchSize()

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

See Also
setPatchSize
virtual int cv::DISOpticalFlow::getPatchStride ( ) const
pure virtual
Python:
retval=cv.DISOpticalFlow.getPatchStride()

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

See Also
setPatchStride
virtual bool cv::DISOpticalFlow::getUseMeanNormalization ( ) const
pure virtual
Python:
retval=cv.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
virtual bool cv::DISOpticalFlow::getUseSpatialPropagation ( ) const
pure virtual
Python:
retval=cv.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
virtual float cv::DISOpticalFlow::getVariationalRefinementAlpha ( ) const
pure virtual
Python:
retval=cv.DISOpticalFlow.getVariationalRefinementAlpha()

Weight of the smoothness term.

See Also
setVariationalRefinementAlpha
virtual float cv::DISOpticalFlow::getVariationalRefinementDelta ( ) const
pure virtual
Python:
retval=cv.DISOpticalFlow.getVariationalRefinementDelta()

Weight of the color constancy term.

See Also
setVariationalRefinementDelta
virtual float cv::DISOpticalFlow::getVariationalRefinementGamma ( ) const
pure virtual
Python:
retval=cv.DISOpticalFlow.getVariationalRefinementGamma()

Weight of the gradient constancy term.

See Also
setVariationalRefinementGamma
virtual int cv::DISOpticalFlow::getVariationalRefinementIterations ( ) const
pure virtual
Python:
retval=cv.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
virtual void cv::DISOpticalFlow::setFinestScale ( int  val)
pure virtual
Python:
None=cv.DISOpticalFlow.setFinestScale(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
virtual void cv::DISOpticalFlow::setGradientDescentIterations ( int  val)
pure virtual
Python:
None=cv.DISOpticalFlow.setGradientDescentIterations(val)

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

See Also
getGradientDescentIterations
virtual void cv::DISOpticalFlow::setPatchSize ( int  val)
pure virtual
Python:
None=cv.DISOpticalFlow.setPatchSize(val)

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

See Also
getPatchSize
virtual void cv::DISOpticalFlow::setPatchStride ( int  val)
pure virtual
Python:
None=cv.DISOpticalFlow.setPatchStride(val)

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

See Also
getPatchStride
virtual void cv::DISOpticalFlow::setUseMeanNormalization ( bool  val)
pure virtual
Python:
None=cv.DISOpticalFlow.setUseMeanNormalization(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
virtual void cv::DISOpticalFlow::setUseSpatialPropagation ( bool  val)
pure virtual
Python:
None=cv.DISOpticalFlow.setUseSpatialPropagation(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
virtual void cv::DISOpticalFlow::setVariationalRefinementAlpha ( float  val)
pure virtual
Python:
None=cv.DISOpticalFlow.setVariationalRefinementAlpha(val)

Weight of the smoothness term.

See Also
getVariationalRefinementAlpha
virtual void cv::DISOpticalFlow::setVariationalRefinementDelta ( float  val)
pure virtual
Python:
None=cv.DISOpticalFlow.setVariationalRefinementDelta(val)

Weight of the color constancy term.

See Also
getVariationalRefinementDelta
virtual void cv::DISOpticalFlow::setVariationalRefinementGamma ( float  val)
pure virtual
Python:
None=cv.DISOpticalFlow.setVariationalRefinementGamma(val)

Weight of the gradient constancy term.

See Also
getVariationalRefinementGamma
virtual void cv::DISOpticalFlow::setVariationalRefinementIterations ( int  val)
pure virtual
Python:
None=cv.DISOpticalFlow.setVariationalRefinementIterations(val)

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

See Also
getGradientDescentIterations

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