Struct opencv::optflow::DenseRLOFOpticalFlow
source · pub struct DenseRLOFOpticalFlow { /* private fields */ }
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
Implementations§
source§impl DenseRLOFOpticalFlow
impl 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<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<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
sourcepub fn create_def() -> Result<Ptr<DenseRLOFOpticalFlow>>
pub fn create_def() -> Result<Ptr<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
§Note
This alternative version of DenseRLOFOpticalFlow::create function uses the following default values for its arguments:
- 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
Trait Implementations§
source§impl AlgorithmTraitConst for DenseRLOFOpticalFlow
impl AlgorithmTraitConst for DenseRLOFOpticalFlow
fn as_raw_Algorithm(&self) -> *const c_void
source§fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>
fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>
source§fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>
fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>
source§fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
source§fn write_with_name_def(&self, fs: &Ptr<FileStorage>) -> Result<()>
fn write_with_name_def(&self, fs: &Ptr<FileStorage>) -> Result<()>
§Note
source§fn empty(&self) -> Result<bool>
fn empty(&self) -> Result<bool>
source§fn save(&self, filename: &str) -> Result<()>
fn save(&self, filename: &str) -> Result<()>
source§fn get_default_name(&self) -> Result<String>
fn get_default_name(&self) -> Result<String>
source§impl Boxed for DenseRLOFOpticalFlow
impl Boxed for DenseRLOFOpticalFlow
source§unsafe fn from_raw(
ptr: <DenseRLOFOpticalFlow as OpenCVFromExtern>::ExternReceive
) -> Self
unsafe fn from_raw( ptr: <DenseRLOFOpticalFlow as OpenCVFromExtern>::ExternReceive ) -> Self
source§fn into_raw(
self
) -> <DenseRLOFOpticalFlow as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw( self ) -> <DenseRLOFOpticalFlow as OpenCVTypeExternContainer>::ExternSendMut
source§fn as_raw(
&self
) -> <DenseRLOFOpticalFlow as OpenCVTypeExternContainer>::ExternSend
fn as_raw( &self ) -> <DenseRLOFOpticalFlow as OpenCVTypeExternContainer>::ExternSend
source§fn as_raw_mut(
&mut self
) -> <DenseRLOFOpticalFlow as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self ) -> <DenseRLOFOpticalFlow as OpenCVTypeExternContainer>::ExternSendMut
source§impl Debug for DenseRLOFOpticalFlow
impl Debug for DenseRLOFOpticalFlow
source§impl DenseOpticalFlowTrait for DenseRLOFOpticalFlow
impl DenseOpticalFlowTrait for DenseRLOFOpticalFlow
fn as_raw_mut_DenseOpticalFlow(&mut self) -> *mut c_void
source§fn calc(
&mut self,
i0: &impl ToInputArray,
i1: &impl ToInputArray,
flow: &mut impl ToInputOutputArray
) -> Result<()>
fn calc( &mut self, i0: &impl ToInputArray, i1: &impl ToInputArray, flow: &mut impl ToInputOutputArray ) -> Result<()>
source§fn collect_garbage(&mut self) -> Result<()>
fn collect_garbage(&mut self) -> Result<()>
source§impl DenseOpticalFlowTraitConst for DenseRLOFOpticalFlow
impl DenseOpticalFlowTraitConst for DenseRLOFOpticalFlow
fn as_raw_DenseOpticalFlow(&self) -> *const c_void
source§impl DenseRLOFOpticalFlowTrait for DenseRLOFOpticalFlow
impl DenseRLOFOpticalFlowTrait for DenseRLOFOpticalFlow
fn as_raw_mut_DenseRLOFOpticalFlow(&mut self) -> *mut c_void
source§fn set_rlof_optical_flow_parameter(
&mut self,
val: Ptr<RLOFOpticalFlowParameter>
) -> Result<()>
fn set_rlof_optical_flow_parameter( &mut self, val: Ptr<RLOFOpticalFlowParameter> ) -> Result<()>
source§fn set_forward_backward(&mut self, val: f32) -> Result<()>
fn set_forward_backward(&mut self, val: f32) -> Result<()>
source§fn set_grid_step(&mut self, val: Size) -> Result<()>
fn set_grid_step(&mut self, val: Size) -> Result<()>
source§fn set_interpolation(&mut self, val: InterpolationType) -> Result<()>
fn set_interpolation(&mut self, val: InterpolationType) -> Result<()>
source§fn set_epick(&mut self, val: i32) -> Result<()>
fn set_epick(&mut self, val: i32) -> Result<()>
source§fn set_epic_sigma(&mut self, val: f32) -> Result<()>
fn set_epic_sigma(&mut self, val: f32) -> Result<()>
source§fn set_epic_lambda(&mut self, val: f32) -> Result<()>
fn set_epic_lambda(&mut self, val: f32) -> Result<()>
source§fn set_fgs_lambda(&mut self, val: f32) -> Result<()>
fn set_fgs_lambda(&mut self, val: f32) -> Result<()>
source§fn set_fgs_sigma(&mut self, val: f32) -> Result<()>
fn set_fgs_sigma(&mut self, val: f32) -> Result<()>
source§fn set_use_post_proc(&mut self, val: bool) -> Result<()>
fn set_use_post_proc(&mut self, val: bool) -> Result<()>
source§fn set_use_variational_refinement(&mut self, val: bool) -> Result<()>
fn set_use_variational_refinement(&mut self, val: bool) -> Result<()>
source§impl DenseRLOFOpticalFlowTraitConst for DenseRLOFOpticalFlow
impl DenseRLOFOpticalFlowTraitConst for DenseRLOFOpticalFlow
fn as_raw_DenseRLOFOpticalFlow(&self) -> *const c_void
source§fn get_rlof_optical_flow_parameter(
&self
) -> Result<Ptr<RLOFOpticalFlowParameter>>
fn get_rlof_optical_flow_parameter( &self ) -> Result<Ptr<RLOFOpticalFlowParameter>>
source§fn get_forward_backward(&self) -> Result<f32>
fn get_forward_backward(&self) -> Result<f32>
source§fn get_grid_step(&self) -> Result<Size>
fn get_grid_step(&self) -> Result<Size>
source§fn get_interpolation(&self) -> Result<InterpolationType>
fn get_interpolation(&self) -> Result<InterpolationType>
source§fn get_epick(&self) -> Result<i32>
fn get_epick(&self) -> Result<i32>
source§fn get_epic_sigma(&self) -> Result<f32>
fn get_epic_sigma(&self) -> Result<f32>
source§fn get_epic_lambda(&self) -> Result<f32>
fn get_epic_lambda(&self) -> Result<f32>
source§fn get_fgs_lambda(&self) -> Result<f32>
fn get_fgs_lambda(&self) -> Result<f32>
source§fn get_fgs_sigma(&self) -> Result<f32>
fn get_fgs_sigma(&self) -> Result<f32>
source§fn get_use_post_proc(&self) -> Result<bool>
fn get_use_post_proc(&self) -> Result<bool>
source§fn get_use_variational_refinement(&self) -> Result<bool>
fn get_use_variational_refinement(&self) -> Result<bool>
source§impl Drop for DenseRLOFOpticalFlow
impl Drop for DenseRLOFOpticalFlow
source§impl From<DenseRLOFOpticalFlow> for Algorithm
impl From<DenseRLOFOpticalFlow> for Algorithm
source§fn from(s: DenseRLOFOpticalFlow) -> Self
fn from(s: DenseRLOFOpticalFlow) -> Self
source§impl From<DenseRLOFOpticalFlow> for DenseOpticalFlow
impl From<DenseRLOFOpticalFlow> for DenseOpticalFlow
source§fn from(s: DenseRLOFOpticalFlow) -> Self
fn from(s: DenseRLOFOpticalFlow) -> Self
impl Send for DenseRLOFOpticalFlow
Auto Trait Implementations§
impl Freeze for DenseRLOFOpticalFlow
impl RefUnwindSafe for DenseRLOFOpticalFlow
impl !Sync for DenseRLOFOpticalFlow
impl Unpin for DenseRLOFOpticalFlow
impl UnwindSafe for DenseRLOFOpticalFlow
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is of course unsafe as it breaks the Rust aliasing rules, but it might be useful for some performance
sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold
. Read more