[][src]Trait opencv::video::DISOpticalFlow

pub trait DISOpticalFlow: DenseOpticalFlow {
    pub fn as_raw_DISOpticalFlow(&self) -> *const c_void;
pub fn as_raw_mut_DISOpticalFlow(&mut self) -> *mut c_void; pub fn get_finest_scale(&self) -> Result<i32> { ... }
pub fn set_finest_scale(&mut self, val: i32) -> Result<()> { ... }
pub fn get_patch_size(&self) -> Result<i32> { ... }
pub fn set_patch_size(&mut self, val: i32) -> Result<()> { ... }
pub fn get_patch_stride(&self) -> Result<i32> { ... }
pub fn set_patch_stride(&mut self, val: i32) -> Result<()> { ... }
pub fn get_gradient_descent_iterations(&self) -> Result<i32> { ... }
pub fn set_gradient_descent_iterations(&mut self, val: i32) -> Result<()> { ... }
pub fn get_variational_refinement_iterations(&self) -> Result<i32> { ... }
pub fn set_variational_refinement_iterations(
        &mut self,
        val: i32
    ) -> Result<()> { ... }
pub fn get_variational_refinement_alpha(&self) -> Result<f32> { ... }
pub fn set_variational_refinement_alpha(&mut self, val: f32) -> Result<()> { ... }
pub fn get_variational_refinement_delta(&self) -> Result<f32> { ... }
pub fn set_variational_refinement_delta(&mut self, val: f32) -> Result<()> { ... }
pub fn get_variational_refinement_gamma(&self) -> Result<f32> { ... }
pub fn set_variational_refinement_gamma(&mut self, val: f32) -> Result<()> { ... }
pub fn get_use_mean_normalization(&self) -> Result<bool> { ... }
pub fn set_use_mean_normalization(&mut self, val: bool) -> Result<()> { ... }
pub fn get_use_spatial_propagation(&self) -> Result<bool> { ... }
pub fn set_use_spatial_propagation(&mut self, val: bool) -> Result<()> { ... } }

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

Required methods

Loading content...

Provided methods

pub fn get_finest_scale(&self) -> Result<i32>[src]

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

pub fn set_finest_scale(&mut self, val: i32) -> Result<()>[src]

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 getFinestScale

pub fn get_patch_size(&self) -> Result<i32>[src]

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

See also

setPatchSize

pub fn set_patch_size(&mut self, val: i32) -> Result<()>[src]

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

See also

setPatchSize getPatchSize

pub fn get_patch_stride(&self) -> Result<i32>[src]

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

See also

setPatchStride

pub fn set_patch_stride(&mut self, val: i32) -> Result<()>[src]

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

See also

setPatchStride getPatchStride

pub fn get_gradient_descent_iterations(&self) -> Result<i32>[src]

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

See also

setGradientDescentIterations

pub fn set_gradient_descent_iterations(&mut self, val: i32) -> Result<()>[src]

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

See also

setGradientDescentIterations getGradientDescentIterations

pub fn get_variational_refinement_iterations(&self) -> Result<i32>[src]

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

pub fn set_variational_refinement_iterations(&mut self, val: i32) -> Result<()>[src]

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

See also

setGradientDescentIterations getGradientDescentIterations

pub fn get_variational_refinement_alpha(&self) -> Result<f32>[src]

Weight of the smoothness term

See also

setVariationalRefinementAlpha

pub fn set_variational_refinement_alpha(&mut self, val: f32) -> Result<()>[src]

Weight of the smoothness term

See also

setVariationalRefinementAlpha getVariationalRefinementAlpha

pub fn get_variational_refinement_delta(&self) -> Result<f32>[src]

Weight of the color constancy term

See also

setVariationalRefinementDelta

pub fn set_variational_refinement_delta(&mut self, val: f32) -> Result<()>[src]

Weight of the color constancy term

See also

setVariationalRefinementDelta getVariationalRefinementDelta

pub fn get_variational_refinement_gamma(&self) -> Result<f32>[src]

Weight of the gradient constancy term

See also

setVariationalRefinementGamma

pub fn set_variational_refinement_gamma(&mut self, val: f32) -> Result<()>[src]

Weight of the gradient constancy term

See also

setVariationalRefinementGamma getVariationalRefinementGamma

pub fn get_use_mean_normalization(&self) -> Result<bool>[src]

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

pub fn set_use_mean_normalization(&mut self, val: bool) -> Result<()>[src]

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 getUseMeanNormalization

pub fn get_use_spatial_propagation(&self) -> Result<bool>[src]

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

pub fn set_use_spatial_propagation(&mut self, val: bool) -> Result<()>[src]

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 getUseSpatialPropagation

Loading content...

Implementations

impl<'_> dyn DISOpticalFlow + '_[src]

pub fn create(preset: i32) -> Result<Ptr<dyn DISOpticalFlow>>[src]

Creates an instance of DISOpticalFlow

Parameters

  • preset: one of PRESET_ULTRAFAST, PRESET_FAST and PRESET_MEDIUM

C++ default parameters

  • preset: DISOpticalFlow::PRESET_FAST

Implementors

Loading content...