pub trait SparseOpticalFlowTrait: AlgorithmTrait + SparseOpticalFlowTraitConst {
    // Required method
    fn as_raw_mut_SparseOpticalFlow(&mut self) -> *mut c_void;

    // Provided methods
    fn calc(
        &mut self,
        prev_img: &impl ToInputArray,
        next_img: &impl ToInputArray,
        prev_pts: &impl ToInputArray,
        next_pts: &mut impl ToInputOutputArray,
        status: &mut impl ToOutputArray,
        err: &mut impl ToOutputArray
    ) -> Result<()> { ... }
    fn calc_def(
        &mut self,
        prev_img: &impl ToInputArray,
        next_img: &impl ToInputArray,
        prev_pts: &impl ToInputArray,
        next_pts: &mut impl ToInputOutputArray,
        status: &mut impl ToOutputArray
    ) -> Result<()> { ... }
}
Expand description

Mutable methods for crate::video::SparseOpticalFlow

Required Methods§

Provided Methods§

source

fn calc( &mut self, prev_img: &impl ToInputArray, next_img: &impl ToInputArray, prev_pts: &impl ToInputArray, next_pts: &mut impl ToInputOutputArray, status: &mut impl ToOutputArray, err: &mut impl ToOutputArray ) -> Result<()>

Calculates a sparse optical flow.

Parameters
  • prevImg: First input image.
  • nextImg: Second input image of the same size and the same type as prevImg.
  • prevPts: Vector of 2D points for which the flow needs to be found.
  • nextPts: Output vector of 2D points containing the calculated new positions of input features in the second image.
  • status: Output status vector. Each element of the vector is set to 1 if the flow for the corresponding features has been found. Otherwise, it is set to 0.
  • err: Optional output vector that contains error response for each point (inverse confidence).
C++ default parameters
  • err: cv::noArray()
source

fn calc_def( &mut self, prev_img: &impl ToInputArray, next_img: &impl ToInputArray, prev_pts: &impl ToInputArray, next_pts: &mut impl ToInputOutputArray, status: &mut impl ToOutputArray ) -> Result<()>

Calculates a sparse optical flow.

Parameters
  • prevImg: First input image.
  • nextImg: Second input image of the same size and the same type as prevImg.
  • prevPts: Vector of 2D points for which the flow needs to be found.
  • nextPts: Output vector of 2D points containing the calculated new positions of input features in the second image.
  • status: Output status vector. Each element of the vector is set to 1 if the flow for the corresponding features has been found. Otherwise, it is set to 0.
  • err: Optional output vector that contains error response for each point (inverse confidence).
Note

This alternative version of [calc] function uses the following default values for its arguments:

  • err: cv::noArray()

Object Safety§

This trait is not object safe.

Implementors§