Trait opencv::prelude::DenseRLOFOpticalFlow
source · pub trait DenseRLOFOpticalFlow: DenseRLOFOpticalFlowConst + DenseOpticalFlow {
Show 14 methods
// Required method
fn as_raw_mut_DenseRLOFOpticalFlow(&mut self) -> *mut c_void;
// Provided methods
fn set_rlof_optical_flow_parameter(
&mut self,
val: Ptr<RLOFOpticalFlowParameter>
) -> Result<()> { ... }
fn set_forward_backward(&mut self, val: f32) -> Result<()> { ... }
fn set_grid_step(&mut self, val: Size) -> Result<()> { ... }
fn set_interpolation(&mut self, val: InterpolationType) -> Result<()> { ... }
fn set_epick(&mut self, val: i32) -> Result<()> { ... }
fn set_epic_sigma(&mut self, val: f32) -> Result<()> { ... }
fn set_epic_lambda(&mut self, val: f32) -> Result<()> { ... }
fn set_fgs_lambda(&mut self, val: f32) -> Result<()> { ... }
fn set_fgs_sigma(&mut self, val: f32) -> Result<()> { ... }
fn set_use_post_proc(&mut self, val: bool) -> Result<()> { ... }
fn set_use_variational_refinement(&mut self, val: bool) -> Result<()> { ... }
fn set_ricsp_size(&mut self, val: i32) -> Result<()> { ... }
fn set_ricslic_type(&mut self, val: i32) -> Result<()> { ... }
}
Expand description
Fast dense optical flow computation based on robust local optical flow (RLOF) algorithms and sparse-to-dense interpolation scheme.
The RLOF is a fast local optical flow approach described in Senst2012 Senst2013 Senst2014 and Senst2016 similar to the pyramidal iterative Lucas-Kanade method as proposed by Bouguet00. More details and experiments can be found in the following thesis Senst2019. The implementation is derived from optflow::calcOpticalFlowPyrLK().
The sparse-to-dense interpolation scheme allows for fast computation of dense optical flow using RLOF (see Geistert2016). For this scheme the following steps are applied: -# motion vector seeded at a regular sampled grid are computed. The sparsity of this grid can be configured with setGridStep -# (optinally) errornous motion vectors are filter based on the forward backward confidence. The threshold can be configured with setForwardBackward. The filter is only applied if the threshold >0 but than the runtime is doubled due to the estimation of the backward flow. -# Vector field interpolation is applied to the motion vector set to obtain a dense vector field.
For the RLOF configuration see optflow::RLOFOpticalFlowParameter for further details. Parameters have been described in Senst2012 Senst2013 Senst2014 and Senst2016.
Note: If the grid size is set to (1,1) and the forward backward threshold <= 0 than pixelwise dense optical flow field is computed by RLOF without using interpolation.
Note: Note that in output, if no correspondences are found between \a I0 and \a I1, the \a flow is set to 0.
See also
optflow::calcOpticalFlowDenseRLOF(), optflow::RLOFOpticalFlowParameter
Required Methods§
fn as_raw_mut_DenseRLOFOpticalFlow(&mut self) -> *mut c_void
Provided Methods§
sourcefn set_rlof_optical_flow_parameter(
&mut self,
val: Ptr<RLOFOpticalFlowParameter>
) -> Result<()>
fn set_rlof_optical_flow_parameter( &mut self, val: Ptr<RLOFOpticalFlowParameter> ) -> Result<()>
Configuration of the RLOF alogrithm.
See also
optflow::RLOFOpticalFlowParameter, getRLOFOpticalFlowParameter
sourcefn set_forward_backward(&mut self, val: f32) -> Result<()>
fn set_forward_backward(&mut self, val: f32) -> Result<()>
Threshold for the forward backward confidence check
For each grid point a motion vector
is computed.
* If the forward backward error
* is larger than threshold given by this function then the motion vector will not be used by the following
* vector field interpolation.
denotes the backward flow. Note, the forward backward test
* will only be applied if the threshold > 0. This may results into a doubled runtime for the motion estimation.
* see also: getForwardBackward, setGridStep
sourcefn set_grid_step(&mut self, val: Size) -> Result<()>
fn set_grid_step(&mut self, val: Size) -> Result<()>
Size of the grid to spawn the motion vectors. For each grid point a motion vector is computed. Some motion vectors will be removed due to the forwatd backward * threshold (if set >0). The rest will be the base of the vector field interpolation. * see also: getForwardBackward, setGridStep * see also: getGridStep
sourcefn set_interpolation(&mut self, val: InterpolationType) -> Result<()>
fn set_interpolation(&mut self, val: InterpolationType) -> Result<()>
Interpolation used to compute the dense optical flow. Two interpolation algorithms are supported * - INTERP_GEO applies the fast geodesic interpolation, see Geistert2016. * - INTERP_EPIC_RESIDUAL applies the edge-preserving interpolation, see Revaud2015,Geistert2016. * see also: ximgproc::EdgeAwareInterpolator, getInterpolation
sourcefn set_epick(&mut self, val: i32) -> Result<()>
fn set_epick(&mut self, val: i32) -> Result<()>
see ximgproc::EdgeAwareInterpolator() K value. K is a number of nearest-neighbor matches considered, when fitting a locally affine * model. Usually it should be around 128. However, lower values would make the interpolation noticeably faster. * see also: ximgproc::EdgeAwareInterpolator, setEPICK * see also: ximgproc::EdgeAwareInterpolator, getEPICK
sourcefn set_epic_sigma(&mut self, val: f32) -> Result<()>
fn set_epic_sigma(&mut self, val: f32) -> Result<()>
see ximgproc::EdgeAwareInterpolator() sigma value. Sigma is a parameter defining how fast the weights decrease in the locally-weighted affine * fitting. Higher values can help preserve fine details, lower values can help to get rid of noise in the * output flow. * see also: ximgproc::EdgeAwareInterpolator, setEPICSigma * see also: ximgproc::EdgeAwareInterpolator, getEPICSigma
sourcefn set_epic_lambda(&mut self, val: f32) -> Result<()>
fn set_epic_lambda(&mut self, val: f32) -> Result<()>
see ximgproc::EdgeAwareInterpolator() lambda value. Lambda is a parameter defining the weight of the edge-aware term in geodesic distance, * should be in the range of 0 to 1000. * see also: ximgproc::EdgeAwareInterpolator, setEPICSigma * see also: ximgproc::EdgeAwareInterpolator, getEPICLambda
sourcefn set_fgs_lambda(&mut self, val: f32) -> Result<()>
fn set_fgs_lambda(&mut self, val: f32) -> Result<()>
see ximgproc::EdgeAwareInterpolator(). Sets the respective fastGlobalSmootherFilter() parameter. * see also: ximgproc::EdgeAwareInterpolator, setFgsLambda * see also: ximgproc::EdgeAwareInterpolator, ximgproc::fastGlobalSmootherFilter, getFgsLambda
sourcefn set_fgs_sigma(&mut self, val: f32) -> Result<()>
fn set_fgs_sigma(&mut self, val: f32) -> Result<()>
see ximgproc::EdgeAwareInterpolator(). Sets the respective fastGlobalSmootherFilter() parameter. * see also: ximgproc::EdgeAwareInterpolator, ximgproc::fastGlobalSmootherFilter, setFgsSigma * see also: ximgproc::EdgeAwareInterpolator, ximgproc::fastGlobalSmootherFilter, getFgsSigma
sourcefn set_use_post_proc(&mut self, val: bool) -> Result<()>
fn set_use_post_proc(&mut self, val: bool) -> Result<()>
enables ximgproc::fastGlobalSmootherFilter
- see also: getUsePostProc
sourcefn set_use_variational_refinement(&mut self, val: bool) -> Result<()>
fn set_use_variational_refinement(&mut self, val: bool) -> Result<()>
enables VariationalRefinement
- see also: getUseVariationalRefinement
sourcefn set_ricsp_size(&mut self, val: i32) -> Result<()>
fn set_ricsp_size(&mut self, val: i32) -> Result<()>
Parameter to tune the approximate size of the superpixel used for oversegmentation.
- see also: cv::ximgproc::createSuperpixelSLIC, cv::ximgproc::RICInterpolator
sourcefn set_ricslic_type(&mut self, val: i32) -> Result<()>
fn set_ricslic_type(&mut self, val: i32) -> Result<()>
Parameter to choose superpixel algorithm variant to use:
- cv::ximgproc::SLICType SLIC segments image using a desired region_size (value: 100)
- cv::ximgproc::SLICType SLICO will optimize using adaptive compactness factor (value: 101)
- cv::ximgproc::SLICType MSLIC will optimize using manifold methods resulting in more content-sensitive superpixels (value: 102).
See also
cv::ximgproc::createSuperpixelSLIC, cv::ximgproc::RICInterpolator
Implementations§
source§impl dyn DenseRLOFOpticalFlow + '_
impl dyn DenseRLOFOpticalFlow + '_
sourcepub fn create(
rlof_param: Ptr<RLOFOpticalFlowParameter>,
forward_backward_threshold: f32,
grid_step: Size,
interp_type: InterpolationType,
epic_k: i32,
epic_sigma: f32,
epic_lambda: f32,
ric_sp_size: i32,
ric_slic_type: i32,
use_post_proc: bool,
fgs_lambda: f32,
fgs_sigma: f32,
use_variational_refinement: bool
) -> Result<Ptr<dyn DenseRLOFOpticalFlow>>
pub fn create( rlof_param: Ptr<RLOFOpticalFlowParameter>, forward_backward_threshold: f32, grid_step: Size, interp_type: InterpolationType, epic_k: i32, epic_sigma: f32, epic_lambda: f32, ric_sp_size: i32, ric_slic_type: i32, use_post_proc: bool, fgs_lambda: f32, fgs_sigma: f32, use_variational_refinement: bool ) -> Result<Ptr<dyn DenseRLOFOpticalFlow>>
Creates instance of optflow::DenseRLOFOpticalFlow
Parameters
- rlofParam: see optflow::RLOFOpticalFlowParameter
- forwardBackwardThreshold: see setForwardBackward
- gridStep: see setGridStep
- interp_type: see setInterpolation
- epicK: see setEPICK
- epicSigma: see setEPICSigma
- epicLambda: see setEPICLambda
- ricSPSize: see setRICSPSize
- ricSLICType: see setRICSLICType
- use_post_proc: see setUsePostProc
- fgsLambda: see setFgsLambda
- fgsSigma: see setFgsSigma
- use_variational_refinement: see setUseVariationalRefinement
C++ default parameters
- rlof_param: Ptr
() - forward_backward_threshold: 1.f
- grid_step: Size(6,6)
- interp_type: InterpolationType::INTERP_EPIC
- epic_k: 128
- epic_sigma: 0.05f
- epic_lambda: 999.0f
- ric_sp_size: 15
- ric_slic_type: 100
- use_post_proc: true
- fgs_lambda: 500.0f
- fgs_sigma: 1.5f
- use_variational_refinement: false