[][src]Function opencv::optflow::calc_optical_flow_sparse_rlof

pub fn calc_optical_flow_sparse_rlof(
    prev_img: &dyn ToInputArray,
    next_img: &dyn ToInputArray,
    prev_pts: &dyn ToInputArray,
    next_pts: &mut dyn ToInputOutputArray,
    status: &mut dyn ToOutputArray,
    err: &mut dyn ToOutputArray,
    rlof_param: Ptr<RLOFOpticalFlowParameter>,
    forward_backward_threshold: f32
) -> Result<()>

Calculates fast optical flow for a sparse feature set using the robust local optical flow (RLOF) similar to optflow::calcOpticalFlowPyrLK().

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

Parameters

  • prevImg: first 8-bit input image. If The cross-based RLOF is used (by selecting optflow::RLOFOpticalFlowParameter::supportRegionType = SupportRegionType::SR_CROSS) image has to be a 8-bit 3 channel image.
  • nextImg: second 8-bit input image. If The cross-based RLOF is used (by selecting optflow::RLOFOpticalFlowParameter::supportRegionType = SupportRegionType::SR_CROSS) image has to be a 8-bit 3 channel image.
  • prevPts: vector of 2D points for which the flow needs to be found; point coordinates must be single-precision floating-point numbers.
  • nextPts: output vector of 2D points (with single-precision floating-point coordinates) containing the calculated new positions of input features in the second image; when optflow::RLOFOpticalFlowParameter::useInitialFlow variable is true the vector must have the same size as in the input and contain the initialization point correspondences.
  • status: output status vector (of unsigned chars); each element of the vector is set to 1 if the flow for the corresponding features has passed the forward backward check.
  • err: output vector of errors; each element of the vector is set to the forward backward error for the corresponding feature.
  • rlofParam: see optflow::RLOFOpticalFlowParameter
  • forwardBackwardThreshold: Threshold for the forward backward confidence check. If forewardBackwardThreshold <=0 the forward

Note: SIMD parallelization is only available when compiling with SSE4.1.

Parameters have been described in Senst2012, Senst2013, Senst2014 and Senst2016. For the RLOF configuration see optflow::RLOFOpticalFlowParameter for further details.

C++ default parameters

  • rlof_param: Ptr()
  • forward_backward_threshold: 0