Skip to content

optflow_calcOpticalFlowSF

optflowfunctionOpenCV 5.0.0
import { optflow_calcOpticalFlowSF } from '@banou/opencv-wasm'

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

ARGUMENTSfrom_, to, flow, layers
FUNCTIONoptflow_calcOpticalFlowSF
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Calculate an optical flow using "SimpleFlow" algorithm.

Note: - An example using the simpleFlow algorithm can be found at samples/simpleflow_demo.cpp

optflow_calcOpticalFlowSF(from_: Mat, to: Mat, flow: Mat, layers: number, averaging_block_size: number, max_flow: number): void;
from_

First 8-bit 3-channel image.

to

Second 8-bit 3-channel image of the same size as prev

flow

Output destination, filled by the native operation. computed flow image that has the same size as prev and type CV_32FC2

layers

Number of layers

averaging_block_size

Size of block through which we sum up when calculate cost function for pixel

max_flow

maximal flow that we search at each level

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.