Table of Contents

Method CalcOpticalFlowSparseToDense

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

CalcOpticalFlowSparseToDense(InputArray, InputArray, OutputArray, int, int, float, bool, float, float)

Fast dense optical flow based on PyrLK sparse matches interpolation.

public static void CalcOpticalFlowSparseToDense(InputArray from, InputArray to, OutputArray flow, int gridStep = 8, int k = 128, float sigma = 0.05, bool usePostProc = true, float fgsLambda = 500, float fgsSigma = 1.5)

Parameters

from InputArray

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

to InputArray

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

flow OutputArray

computed flow image that has the same size as from and CV_32FC2 type

gridStep int

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

k int

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 float

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.

usePostProc bool

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

fgsLambda float

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

fgsSigma float

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