Package org.opencv.video
Class DISOpticalFlow
java.lang.Object
org.opencv.core.Algorithm
org.opencv.video.DenseOpticalFlow
org.opencv.video.DISOpticalFlow
public class DISOpticalFlow extends DenseOpticalFlow
DIS optical flow algorithm.
This class implements the Dense Inverse Search (DIS) optical flow algorithm. More
details about the algorithm can be found at CITE: 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 (REF: getUseSpatialPropagation), as well as an option to
utilize an initial flow approximation passed to REF: calc (which is, essentially, temporal propagation,
if the previous frame's flow field is passed).
-
Field Summary
Fields Modifier and Type Field Description static intPRESET_FASTstatic intPRESET_MEDIUMstatic intPRESET_ULTRAFAST -
Constructor Summary
Constructors Modifier Constructor Description protectedDISOpticalFlow(long addr) -
Method Summary
Modifier and Type Method Description static DISOpticalFlow__fromPtr__(long addr)static DISOpticalFlowcreate()Creates an instance of DISOpticalFlowstatic DISOpticalFlowcreate(int preset)Creates an instance of DISOpticalFlowprotected voidfinalize()intgetFinestScale()Finest level of the Gaussian pyramid on which the flow is computed (zero level corresponds to the original image resolution).intgetGradientDescentIterations()Maximum number of gradient descent iterations in the patch inverse search stage.intgetPatchSize()Size of an image patch for matching (in pixels).intgetPatchStride()Stride between neighbor patches.booleangetUseMeanNormalization()Whether to use mean-normalization of patches when computing patch distance.booleangetUseSpatialPropagation()Whether to use spatial propagation of good optical flow vectors.floatgetVariationalRefinementAlpha()Weight of the smoothness term SEE: setVariationalRefinementAlphafloatgetVariationalRefinementDelta()Weight of the color constancy term SEE: setVariationalRefinementDeltafloatgetVariationalRefinementGamma()Weight of the gradient constancy term SEE: setVariationalRefinementGammaintgetVariationalRefinementIterations()Number of fixed point iterations of variational refinement per scale.voidsetFinestScale(int val)getFinestScale SEE: getFinestScalevoidsetGradientDescentIterations(int val)getGradientDescentIterations SEE: getGradientDescentIterationsvoidsetPatchSize(int val)getPatchSize SEE: getPatchSizevoidsetPatchStride(int val)getPatchStride SEE: getPatchStridevoidsetUseMeanNormalization(boolean val)getUseMeanNormalization SEE: getUseMeanNormalizationvoidsetUseSpatialPropagation(boolean val)getUseSpatialPropagation SEE: getUseSpatialPropagationvoidsetVariationalRefinementAlpha(float val)getVariationalRefinementAlpha SEE: getVariationalRefinementAlphavoidsetVariationalRefinementDelta(float val)getVariationalRefinementDelta SEE: getVariationalRefinementDeltavoidsetVariationalRefinementGamma(float val)getVariationalRefinementGamma SEE: getVariationalRefinementGammavoidsetVariationalRefinementIterations(int val)getGradientDescentIterations SEE: getGradientDescentIterationsMethods inherited from class org.opencv.core.Algorithm
clear, empty, getDefaultName, getNativeObjAddr, save
-
Field Details
-
PRESET_ULTRAFAST
- See Also:
- Constant Field Values
-
PRESET_FAST
- See Also:
- Constant Field Values
-
PRESET_MEDIUM
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
__fromPtr__
-
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: setFinestScale- Returns:
- automatically generated
-
setFinestScale
getFinestScale SEE: getFinestScale- Parameters:
val- automatically generated
-
getPatchSize
Size of an image patch for matching (in pixels). Normally, default 8x8 patches work well enough in most cases. SEE: setPatchSize- Returns:
- automatically generated
-
setPatchSize
getPatchSize SEE: getPatchSize- Parameters:
val- automatically generated
-
getPatchStride
Stride between neighbor patches. Must be less than patch size. Lower values correspond to higher flow quality. SEE: setPatchStride- Returns:
- automatically generated
-
setPatchStride
getPatchStride SEE: getPatchStride- Parameters:
val- automatically generated
-
getGradientDescentIterations
Maximum number of gradient descent iterations in the patch inverse search stage. Higher values may improve quality in some cases. SEE: setGradientDescentIterations- Returns:
- automatically generated
-
setGradientDescentIterations
getGradientDescentIterations SEE: getGradientDescentIterations- Parameters:
val- automatically generated
-
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: setGradientDescentIterations- Returns:
- automatically generated
-
setVariationalRefinementIterations
getGradientDescentIterations SEE: getGradientDescentIterations- Parameters:
val- automatically generated
-
getVariationalRefinementAlpha
Weight of the smoothness term SEE: setVariationalRefinementAlpha- Returns:
- automatically generated
-
setVariationalRefinementAlpha
getVariationalRefinementAlpha SEE: getVariationalRefinementAlpha- Parameters:
val- automatically generated
-
getVariationalRefinementDelta
Weight of the color constancy term SEE: setVariationalRefinementDelta- Returns:
- automatically generated
-
setVariationalRefinementDelta
getVariationalRefinementDelta SEE: getVariationalRefinementDelta- Parameters:
val- automatically generated
-
getVariationalRefinementGamma
Weight of the gradient constancy term SEE: setVariationalRefinementGamma- Returns:
- automatically generated
-
setVariationalRefinementGamma
getVariationalRefinementGamma SEE: getVariationalRefinementGamma- Parameters:
val- automatically generated
-
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: setUseMeanNormalization- Returns:
- automatically generated
-
setUseMeanNormalization
getUseMeanNormalization SEE: getUseMeanNormalization- Parameters:
val- automatically generated
-
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: setUseSpatialPropagation- Returns:
- automatically generated
-
setUseSpatialPropagation
getUseSpatialPropagation SEE: getUseSpatialPropagation- Parameters:
val- automatically generated
-
create
Creates an instance of DISOpticalFlow- Parameters:
preset- one of PRESET_ULTRAFAST, PRESET_FAST and PRESET_MEDIUM- Returns:
- automatically generated
-
create
Creates an instance of DISOpticalFlow- Returns:
- automatically generated
-
finalize
- Overrides:
finalizein classDenseOpticalFlow- Throws:
Throwable
-