DISOpticalFlow

Objective-C

@interface DISOpticalFlow : DenseOpticalFlow

Swift

class DISOpticalFlow : 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).

Member of Video

Class Constants

  • Declaration

    Objective-C

    @property (class, readonly) int PRESET_ULTRAFAST

    Swift

    class var PRESET_ULTRAFAST: Int32 { get }
  • Declaration

    Objective-C

    @property (class, readonly) int PRESET_FAST

    Swift

    class var PRESET_FAST: Int32 { get }
  • Declaration

    Objective-C

    @property (class, readonly) int PRESET_MEDIUM

    Swift

    class var PRESET_MEDIUM: Int32 { get }

Methods

  • Creates an instance of DISOpticalFlow

    Declaration

    Objective-C

    + (nonnull DISOpticalFlow *)create:(int)preset;

    Swift

    class func create(preset: Int32) -> DISOpticalFlow

    Parameters

    preset

    one of PRESET_ULTRAFAST, PRESET_FAST and PRESET_MEDIUM

  • Creates an instance of DISOpticalFlow

    Declaration

    Objective-C

    + (nonnull DISOpticalFlow *)create;

    Swift

    class func create() -> DISOpticalFlow
  • 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.

    Declaration

    Objective-C

    - (BOOL)getUseMeanNormalization;

    Swift

    func getUseMeanNormalization() -> Bool
  • 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.

    Declaration

    Objective-C

    - (BOOL)getUseSpatialPropagation;

    Swift

    func getUseSpatialPropagation() -> Bool
  • Weight of the smoothness term

    Declaration

    Objective-C

    - (float)getVariationalRefinementAlpha;

    Swift

    func getVariationalRefinementAlpha() -> Float
  • Weight of the color constancy term

    Declaration

    Objective-C

    - (float)getVariationalRefinementDelta;

    Swift

    func getVariationalRefinementDelta() -> Float
  • Weight of the gradient constancy term

    Declaration

    Objective-C

    - (float)getVariationalRefinementGamma;

    Swift

    func getVariationalRefinementGamma() -> Float
  • 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.

    Declaration

    Objective-C

    - (int)getFinestScale;

    Swift

    func getFinestScale() -> Int32
  • Maximum number of gradient descent iterations in the patch inverse search stage. Higher values may improve quality in some cases.

    Declaration

    Objective-C

    - (int)getGradientDescentIterations;

    Swift

    func getGradientDescentIterations() -> Int32
  • Size of an image patch for matching (in pixels). Normally, default 8x8 patches work well enough in most cases.

    Declaration

    Objective-C

    - (int)getPatchSize;

    Swift

    func getPatchSize() -> Int32
  • Stride between neighbor patches. Must be less than patch size. Lower values correspond to higher flow quality.

    Declaration

    Objective-C

    - (int)getPatchStride;

    Swift

    func getPatchStride() -> Int32
  • 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.

    Declaration

    Objective-C

    - (int)getVariationalRefinementIterations;

    Swift

    func getVariationalRefinementIterations() -> Int32
  • getFinestScale - see: -getFinestScale:

    Declaration

    Objective-C

    - (void)setFinestScale:(int)val;

    Swift

    func setFinestScale(val: Int32)
  • getGradientDescentIterations - see: -getGradientDescentIterations:

    Declaration

    Objective-C

    - (void)setGradientDescentIterations:(int)val;

    Swift

    func setGradientDescentIterations(val: Int32)
  • getPatchSize - see: -getPatchSize:

    Declaration

    Objective-C

    - (void)setPatchSize:(int)val;

    Swift

    func setPatchSize(val: Int32)
  • getPatchStride - see: -getPatchStride:

    Declaration

    Objective-C

    - (void)setPatchStride:(int)val;

    Swift

    func setPatchStride(val: Int32)
  • getUseMeanNormalization - see: -getUseMeanNormalization:

    Declaration

    Objective-C

    - (void)setUseMeanNormalization:(BOOL)val;

    Swift

    func setUseMeanNormalization(val: Bool)
  • getUseSpatialPropagation - see: -getUseSpatialPropagation:

    Declaration

    Objective-C

    - (void)setUseSpatialPropagation:(BOOL)val;

    Swift

    func setUseSpatialPropagation(val: Bool)
  • getVariationalRefinementAlpha - see: -getVariationalRefinementAlpha:

    Declaration

    Objective-C

    - (void)setVariationalRefinementAlpha:(float)val;

    Swift

    func setVariationalRefinementAlpha(val: Float)
  • getVariationalRefinementDelta - see: -getVariationalRefinementDelta:

    Declaration

    Objective-C

    - (void)setVariationalRefinementDelta:(float)val;

    Swift

    func setVariationalRefinementDelta(val: Float)
  • getVariationalRefinementGamma - see: -getVariationalRefinementGamma:

    Declaration

    Objective-C

    - (void)setVariationalRefinementGamma:(float)val;

    Swift

    func setVariationalRefinementGamma(val: Float)
  • getGradientDescentIterations - see: -getGradientDescentIterations:

    Declaration

    Objective-C

    - (void)setVariationalRefinementIterations:(int)val;

    Swift

    func setVariationalRefinementIterations(val: Int32)