Class cv::DISOpticalFlow#

DIS optical flow algorithm. View details

Collaboration diagram for cv::DISOpticalFlow:

Public Types#

Public Member Functions#

Public Member Functions inherited from cv::DenseOpticalFlow

Return

Name

Description

void

calc(
    InputArray I0,
    InputArray I1,
    InputOutputArray flow )

Calculates an optical flow.

void

collectGarbage()

Releases all inner buffers.

Public Member Functions inherited from cv::Algorithm

Return

Name

Description

Algorithm()

~Algorithm()

void

clear()

Clears the algorithm state.

bool

empty()

Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read.

String

getDefaultName()

void

read(const FileNode & fn)

Reads algorithm parameters from a file storage.

void

save(const String & filename)

void

write(
    const Ptr< FileStorage > & fs,
    const String & name = String() )

void

write(FileStorage & fs)

Stores algorithm parameters in a file storage.

void

write(
    FileStorage & fs,
    const String & name )

Static Public Member Functions#

Static Public Member Functions inherited from cv::Algorithm

Return

Name

Description

static Ptr< _Tp >

load(
    const String & filename,
    const String & objname = String() )

Loads algorithm from the file.

static Ptr< _Tp >

loadFromString(
    const String & strModel,
    const String & objname = String() )

Loads algorithm from a String.

static Ptr< _Tp >

read(const FileNode & fn)

Reads algorithm from the file node.

Additional Inherited Members#

Protected Member Functions inherited from cv::Algorithm

Return

Name

Description

void

writeFormat(FileStorage & fs)

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).

Examples
samples/python/snippets/dis_opt_flow.py.

Member Enumeration Documentation#

enum DISOpticalFlow

PRESET_ULTRAFAST

PRESET_FAST

PRESET_MEDIUM

Member Function Documentation#

getCoarsestScale()#

int cv::DISOpticalFlow::getCoarsestScale()

Python:

cv.DISOpticalFlow.getCoarsestScale() -> retval

Gets the coarsest scale.

getFinestScale()#

int cv::DISOpticalFlow::getFinestScale()

Python:

cv.DISOpticalFlow.getFinestScale() -> retval

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 cv::DISOpticalFlow::getGradientDescentIterations()

Python:

cv.DISOpticalFlow.getGradientDescentIterations() -> retval

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

getPatchSize()#

int cv::DISOpticalFlow::getPatchSize()

Python:

cv.DISOpticalFlow.getPatchSize() -> retval

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

See also

setPatchSize

getPatchStride()#

int cv::DISOpticalFlow::getPatchStride()

Python:

cv.DISOpticalFlow.getPatchStride() -> retval

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

See also

setPatchStride

getUseMeanNormalization()#

bool cv::DISOpticalFlow::getUseMeanNormalization()

Python:

cv.DISOpticalFlow.getUseMeanNormalization() -> retval

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.

getUseSpatialPropagation()#

bool cv::DISOpticalFlow::getUseSpatialPropagation()

Python:

cv.DISOpticalFlow.getUseSpatialPropagation() -> retval

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.

getVariationalRefinementAlpha()#

float cv::DISOpticalFlow::getVariationalRefinementAlpha()

Python:

cv.DISOpticalFlow.getVariationalRefinementAlpha() -> retval

Weight of the smoothness term.

getVariationalRefinementDelta()#

float cv::DISOpticalFlow::getVariationalRefinementDelta()

Python:

cv.DISOpticalFlow.getVariationalRefinementDelta() -> retval

Weight of the color constancy term.

getVariationalRefinementEpsilon()#

float cv::DISOpticalFlow::getVariationalRefinementEpsilon()

Python:

cv.DISOpticalFlow.getVariationalRefinementEpsilon() -> retval

Norm value shift for robust penalizer.

getVariationalRefinementGamma()#

float cv::DISOpticalFlow::getVariationalRefinementGamma()

Python:

cv.DISOpticalFlow.getVariationalRefinementGamma() -> retval

Weight of the gradient constancy term.

getVariationalRefinementIterations()#

int cv::DISOpticalFlow::getVariationalRefinementIterations()

Python:

cv.DISOpticalFlow.getVariationalRefinementIterations() -> retval

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.

setCoarsestScale()#

void cv::DISOpticalFlow::setCoarsestScale(int val)

Python:

cv.DISOpticalFlow.setCoarsestScale(val)

Sets the coarsest scale.

Parameters

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

setFinestScale()#

void cv::DISOpticalFlow::setFinestScale(int val)

Python:

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

setGradientDescentIterations()#

void cv::DISOpticalFlow::setGradientDescentIterations(int val)

Python:

cv.DISOpticalFlow.setGradientDescentIterations(val)

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

setPatchSize()#

void cv::DISOpticalFlow::setPatchSize(int val)

Python:

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

setPatchStride()#

void cv::DISOpticalFlow::setPatchStride(int val)

Python:

cv.DISOpticalFlow.setPatchStride(val)

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

See also

getPatchStride

setUseMeanNormalization()#

void cv::DISOpticalFlow::setUseMeanNormalization(bool val)

Python:

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.

setUseSpatialPropagation()#

void cv::DISOpticalFlow::setUseSpatialPropagation(bool val)

Python:

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.

setVariationalRefinementAlpha()#

void cv::DISOpticalFlow::setVariationalRefinementAlpha(float val)

Python:

cv.DISOpticalFlow.setVariationalRefinementAlpha(val)

Weight of the smoothness term.

setVariationalRefinementDelta()#

void cv::DISOpticalFlow::setVariationalRefinementDelta(float val)

Python:

cv.DISOpticalFlow.setVariationalRefinementDelta(val)

Weight of the color constancy term.

setVariationalRefinementEpsilon()#

void cv::DISOpticalFlow::setVariationalRefinementEpsilon(float val)

Python:

cv.DISOpticalFlow.setVariationalRefinementEpsilon(val)

Norm value shift for robust penalizer.

setVariationalRefinementGamma()#

void cv::DISOpticalFlow::setVariationalRefinementGamma(float val)

Python:

cv.DISOpticalFlow.setVariationalRefinementGamma(val)

Weight of the gradient constancy term.

setVariationalRefinementIterations()#

void cv::DISOpticalFlow::setVariationalRefinementIterations(int val)

Python:

cv.DISOpticalFlow.setVariationalRefinementIterations(val)

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

create()#

static Ptr< DISOpticalFlow > cv::DISOpticalFlow::create(int preset = DISOpticalFlow::PRESET_FAST)

Python:

cv.DISOpticalFlow.create([, preset]) -> retval
cv.DISOpticalFlow_create([, preset]) -> retval

Creates an instance of DISOpticalFlow.

Parameters

  • preset — one of PRESET_ULTRAFAST, PRESET_FAST and PRESET_MEDIUM

Source file#

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