Skip to content

optflow_RLOFOpticalFlowParameter

optflowclassOpenCV 5.0.0
import { optflow_RLOFOpticalFlowParameter } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSConstructor or factory
CLASSoptflow_RLOFOpticalFlowParameter
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods.

This is used store and set up the parameters of the robust local optical flow (RLOF) algoritm.

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(). This RLOF implementation can be seen as an improved pyramidal iterative Lucas-Kanade and includes a set of improving modules. The main improvements in respect to the pyramidal iterative Lucas-Kanade are:

  • A more robust redecending M-estimator framework (see [Senst2012]) to improve the accuracy at motion boundaries and appearing and disappearing pixels.
  • an adaptive support region strategies to improve the accuracy at motion boundaries to reduce the corona effect, i.e oversmoothing of the PLK at motion/object boundaries. The cross-based segementation strategy (SR_CROSS) proposed in [Senst2014] uses a simple segmenation approach to obtain the optimal shape of the support region.
  • To deal with illumination changes (outdoor sequences and shadow) the intensity constancy assumption based optical flow equation has been adopt with the Gennert and Negahdaripour illumination model (see [Senst2016]). This model can be switched on/off with the useIlluminationModel variable.
  • By using a global motion prior initialization (see [Senst2016]) of the iterative refinement the accuracy could be significantly improved for large displacements. This initialization can be switched on and of with useGlobalMotionPrior variable.

The RLOF can be computed with the SparseOpticalFlow class or function interface to track a set of features or with the DenseOpticalFlow class or function interface to compute dense optical flow.

See: optflow::DenseRLOFOpticalFlow, optflow::calcOpticalFlowDenseRLOF(), optflow::SparseRLOFOpticalFlow, optflow::calcOpticalFlowSparseRLOF()

Constructors and members

static create

Creates instance of optflow::RLOFOpticalFlowParameter

create(): optflow_RLOFOpticalFlowParameter | null;
Returns

The optflow_RLOFOpticalFlowParameter | null result.

clone

Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.

clone(): this;
Returns

The this result.

setUseMEstimator

To apply the global motion prior motion vectors will be computed on a regulary sampled which are the basis for Homography estimation using RANSAC. The reprojection threshold is based on n-th percentil (given by this value [0 ... 100]) of the motion vectors magnitude. See [Senst2016] for more details. Enable M-estimator or disable and use least-square estimator. Enables M-estimator by setting sigma parameters to (3.2, 7.0). Disabling M-estimator can reduce runtime, while enabling can improve the accuracy.

See: setNormSigma0, setNormSigma1

setUseMEstimator(val: boolean): void;
val

If true M-estimator is used. If false least-square estimator is used.

setSolverType

Set the solver type used by this optflow_RLOFOpticalFlowParameter object.

setSolverType(val: number): void;
val

val argument (number).

getSolverType

Return the solver type configured on this optflow_RLOFOpticalFlowParameter object.

getSolverType(): number;
Returns

The number result.

setSupportRegionType

Set the support region type used by this optflow_RLOFOpticalFlowParameter object.

setSupportRegionType(val: number): void;
val

val argument (number).

getSupportRegionType

Return the support region type configured on this optflow_RLOFOpticalFlowParameter object.

getSupportRegionType(): number;
Returns

The number result.

setNormSigma0

Set the norm sigma0 used by this optflow_RLOFOpticalFlowParameter object.

setNormSigma0(val: number): void;
val

val argument (number).

getNormSigma0

Return the norm sigma0 configured on this optflow_RLOFOpticalFlowParameter object.

getNormSigma0(): number;
Returns

The number result.

setNormSigma1

Set the norm sigma1 used by this optflow_RLOFOpticalFlowParameter object.

setNormSigma1(val: number): void;
val

val argument (number).

getNormSigma1

Return the norm sigma1 configured on this optflow_RLOFOpticalFlowParameter object.

getNormSigma1(): number;
Returns

The number result.

setSmallWinSize

Set the small win size used by this optflow_RLOFOpticalFlowParameter object.

setSmallWinSize(val: number): void;
val

val argument (number).

getSmallWinSize

Return the small win size configured on this optflow_RLOFOpticalFlowParameter object.

getSmallWinSize(): number;
Returns

The number result.

setLargeWinSize

Set the large win size used by this optflow_RLOFOpticalFlowParameter object.

setLargeWinSize(val: number): void;
val

val argument (number).

getLargeWinSize

Return the large win size configured on this optflow_RLOFOpticalFlowParameter object.

getLargeWinSize(): number;
Returns

The number result.

setCrossSegmentationThreshold

Set the cross segmentation threshold used by this optflow_RLOFOpticalFlowParameter object.

setCrossSegmentationThreshold(val: number): void;
val

val argument (number).

getCrossSegmentationThreshold

Return the cross segmentation threshold configured on this optflow_RLOFOpticalFlowParameter object.

getCrossSegmentationThreshold(): number;
Returns

The number result.

setMaxLevel

Set the max level used by this optflow_RLOFOpticalFlowParameter object.

setMaxLevel(val: number): void;
val

val argument (number).

getMaxLevel

Return the max level configured on this optflow_RLOFOpticalFlowParameter object.

getMaxLevel(): number;
Returns

The number result.

setUseInitialFlow

Set the use initial flow used by this optflow_RLOFOpticalFlowParameter object.

setUseInitialFlow(val: boolean): void;
val

val argument (boolean).

getUseInitialFlow

Return the use initial flow configured on this optflow_RLOFOpticalFlowParameter object.

getUseInitialFlow(): boolean;
Returns

The boolean result.

setUseIlluminationModel

Set the use illumination model used by this optflow_RLOFOpticalFlowParameter object.

setUseIlluminationModel(val: boolean): void;
val

val argument (boolean).

getUseIlluminationModel

Return the use illumination model configured on this optflow_RLOFOpticalFlowParameter object.

getUseIlluminationModel(): boolean;
Returns

The boolean result.

setUseGlobalMotionPrior

Set the use global motion prior used by this optflow_RLOFOpticalFlowParameter object.

setUseGlobalMotionPrior(val: boolean): void;
val

val argument (boolean).

getUseGlobalMotionPrior

Return the use global motion prior configured on this optflow_RLOFOpticalFlowParameter object.

getUseGlobalMotionPrior(): boolean;
Returns

The boolean result.

setMaxIteration

Set the max iteration used by this optflow_RLOFOpticalFlowParameter object.

setMaxIteration(val: number): void;
val

val argument (number).

getMaxIteration

Return the max iteration configured on this optflow_RLOFOpticalFlowParameter object.

getMaxIteration(): number;
Returns

The number result.

setMinEigenValue

Set the min eigen value used by this optflow_RLOFOpticalFlowParameter object.

setMinEigenValue(val: number): void;
val

val argument (number).

getMinEigenValue

Return the min eigen value configured on this optflow_RLOFOpticalFlowParameter object.

getMinEigenValue(): number;
Returns

The number result.

setGlobalMotionRansacThreshold

Set the global motion ransac threshold used by this optflow_RLOFOpticalFlowParameter object.

setGlobalMotionRansacThreshold(val: number): void;
val

val argument (number).

getGlobalMotionRansacThreshold

Return the global motion ransac threshold configured on this optflow_RLOFOpticalFlowParameter object.

getGlobalMotionRansacThreshold(): number;
Returns

The number result.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.