Skip to content

optflow_calcOpticalFlowSF1

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

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

ARGUMENTSfrom_, to, flow, layers
FUNCTIONoptflow_calcOpticalFlowSF1
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_calcOpticalFlowSF1(from_: Mat, to: Mat, flow: Mat, layers: number, averaging_block_size: number, max_flow: number, sigma_dist: number, sigma_color: number, postprocess_window: number, sigma_dist_fix: number, sigma_color_fix: number, occ_thr: number, upscale_averaging_radius: number, upscale_sigma_dist: number, upscale_sigma_color: number, speed_up_thr: 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

sigma_dist

vector smooth spatial sigma parameter

sigma_color

vector smooth color sigma parameter

postprocess_window

window size for postprocess cross bilateral filter

sigma_dist_fix

spatial sigma for postprocess cross bilateralf filter

sigma_color_fix

color sigma for postprocess cross bilateral filter

occ_thr

threshold for detecting occlusions

upscale_averaging_radius

window size for bilateral upscale operation

upscale_sigma_dist

spatial sigma for bilateral upscale operation

upscale_sigma_color

color sigma for bilateral upscale operation

speed_up_thr

threshold to detect point with irregular flow - where flow should be recalculated after upscale

See [Tao2012] . And site of project - http://graphics.berkeley.edu/papers/Tao-SAN-2012-05/.

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.