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
fromInputArrayfirst 8-bit 3-channel or 1-channel image.
toInputArraysecond 8-bit 3-channel or 1-channel image of the same size as from
flowOutputArraycomputed flow image that has the same size as from and CV_32FC2 type
gridStepintstride used in sparse match computation. Lower values usually result in higher quality but slow down the algorithm.
kintnumber 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.
sigmafloatparameter 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.
usePostProcbooldefines whether the ximgproc::fastGlobalSmootherFilter() is used for post-processing after interpolation
fgsLambdafloatsee the respective parameter of the ximgproc::fastGlobalSmootherFilter()
fgsSigmafloatsee the respective parameter of the ximgproc::fastGlobalSmootherFilter()