Skip to content

optflow_calcOpticalFlowSparseToDense

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

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

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

Fast dense optical flow based on PyrLK sparse matches interpolation.

optflow_calcOpticalFlowSparseToDense(from_: Mat, to: Mat, flow: Mat, grid_step: number, k: number, sigma: number, use_post_proc: boolean, fgs_lambda: number, fgs_sigma: number): void;
7 available overloads
optflow_calcOpticalFlowSparseToDense(from_: Mat, to: Mat, flow: Mat): void;
optflow_calcOpticalFlowSparseToDense(from_: Mat, to: Mat, flow: Mat, grid_step: number): void;
optflow_calcOpticalFlowSparseToDense(from_: Mat, to: Mat, flow: Mat, grid_step: number, k: number): void;
optflow_calcOpticalFlowSparseToDense(from_: Mat, to: Mat, flow: Mat, grid_step: number, k: number, sigma: number): void;
optflow_calcOpticalFlowSparseToDense(from_: Mat, to: Mat, flow: Mat, grid_step: number, k: number, sigma: number, use_post_proc: boolean): void;
optflow_calcOpticalFlowSparseToDense(from_: Mat, to: Mat, flow: Mat, grid_step: number, k: number, sigma: number, use_post_proc: boolean, fgs_lambda: number): void;
optflow_calcOpticalFlowSparseToDense(from_: Mat, to: Mat, flow: Mat, grid_step: number, k: number, sigma: number, use_post_proc: boolean, fgs_lambda: number, fgs_sigma: number): void;
from_

first 8-bit 3-channel or 1-channel image.

to

second 8-bit 3-channel or 1-channel image of the same size as from

flow

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

grid_step

stride used in sparse match computation. Lower values usually result in higher quality but slow down the algorithm.

k

number of nearest-neighbor matches considered, when fitting a locally affine model. Lower values can make the algorithm noticeably faster at the cost of some quality degradation.

sigma

parameter defining how fast the weights decrease in the locally-weighted affine fitting. Higher values can help preserve fine details, lower values can help to get rid of the noise in the output flow.

use_post_proc

defines whether the ximgproc::fastGlobalSmootherFilter() is used for post-processing after interpolation

fgs_lambda

see the respective parameter of the ximgproc::fastGlobalSmootherFilter()

fgs_sigma

see the respective parameter of the ximgproc::fastGlobalSmootherFilter()

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.