Skip to content

VariationalRefinement

Motion and trackingclassOpenCV 5.0.0
import { VariationalRefinement } from '@banou/opencv-wasm'

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

ARGUMENTSConstructor or factory
CLASSVariationalRefinement
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. Inherits DenseOpticalFlow.

Variational optical flow refinement

This class implements variational refinement of the input flow field, i.e. it uses input flow to initialize the minimization of the following functional: E(U) = \int_{\Omega} \delta \Psi(E_I) + \gamma \Psi(E_G) + \alpha \Psi(E_S) , where E_I,E_G,E_S are color constancy, gradient constancy and smoothness terms respectively. \Psi(s^2)=\sqrt{s^2+\epsilon^2} is a robust penalizer to limit the influence of outliers. A complete formulation and a description of the minimization procedure can be found in [Brox2004]

Constructors and members

static create

Creates an instance of VariationalRefinement

create(): VariationalRefinement | null;
Returns

The VariationalRefinement | 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.

calcUV

calc function overload to handle separate horizontal (u) and vertical (v) flow components (to avoid extra splits/merges)

calcUV(I0: Mat, I1: Mat, flow_u: Mat, flow_v: Mat): void;
I0

i0 argument (Mat).

I1

i1 argument (Mat).

flow_u

Input/output value, modified by the native operation. flow u argument (Mat).

flow_v

Input/output value, modified by the native operation. flow v argument (Mat).

getFixedPointIterations

Number of outer (fixed-point) iterations in the minimization procedure. See: setFixedPointIterations

getFixedPointIterations(): number;
Returns

The number result.

setFixedPointIterations

Number of outer (fixed-point) iterations in the minimization procedure. See: setFixedPointIterations See: getFixedPointIterations

setFixedPointIterations(val: number): void;
val

val argument (number).

getSorIterations

Number of inner successive over-relaxation (SOR) iterations in the minimization procedure to solve the respective linear system. See: setSorIterations

getSorIterations(): number;
Returns

The number result.

setSorIterations

Number of inner successive over-relaxation (SOR) iterations in the minimization procedure to solve the respective linear system. See: setSorIterations See: getSorIterations

setSorIterations(val: number): void;
val

val argument (number).

getOmega

Relaxation factor in SOR See: setOmega

getOmega(): number;
Returns

The number result.

setOmega

Relaxation factor in SOR See: setOmega See: getOmega

setOmega(val: number): void;
val

val argument (number).

getAlpha

Weight of the smoothness term See: setAlpha

getAlpha(): number;
Returns

The number result.

setAlpha

Weight of the smoothness term See: setAlpha See: getAlpha

setAlpha(val: number): void;
val

val argument (number).

getDelta

Weight of the color constancy term See: setDelta

getDelta(): number;
Returns

The number result.

setDelta

Weight of the color constancy term See: setDelta See: getDelta

setDelta(val: number): void;
val

val argument (number).

getGamma

Weight of the gradient constancy term See: setGamma

getGamma(): number;
Returns

The number result.

setGamma

Weight of the gradient constancy term See: setGamma See: getGamma

setGamma(val: number): void;
val

val argument (number).

getEpsilon

Norm value shift for robust penalizer See: setEpsilon

getEpsilon(): number;
Returns

The number result.

setEpsilon

Norm value shift for robust penalizer See: setEpsilon See: getEpsilon

setEpsilon(val: number): void;
val

val argument (number).

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.