Table of Contents

Class SparseOpticalFlow

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Base interface for sparse optical flow algorithms.

public abstract class SparseOpticalFlow : Algorithm, IDisposable
Inheritance
SparseOpticalFlow
Implements
Derived
Inherited Members

Constructors

SparseOpticalFlow(nint, nint, Action<nint>)

Constructor for the factory pattern (cv::Ptr<T>* + raw T*).

protected SparseOpticalFlow(nint smartPtr, nint rawPtr, Action<nint> release)

Parameters

smartPtr nint
rawPtr nint
release Action<nint>

Methods

Calc(InputArray, InputArray, InputArray, InputOutputArray, OutputArray, OutputArray)

Calculates a sparse optical flow.

public virtual void Calc(InputArray prevImg, InputArray nextImg, InputArray prevPts, InputOutputArray nextPts, OutputArray status, OutputArray err = default)

Parameters

prevImg InputArray

First input image.

nextImg InputArray

Second input image of the same size and the same type as prevImg.

prevPts InputArray

Vector of 2D points for which the flow needs to be found.

nextPts InputOutputArray

Output vector of 2D points containing the calculated new positions of input features in the second image.

status OutputArray

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 OutputArray

Optional output vector that contains error response for each point (inverse confidence).