Rlof lof_param->useInitialFlow = true; error: (-215:Assertion failed) nextPtsMat.checkVector(2, CV_32F, true) == npoints in function 'calcLocalOpticalFlowCore' 。

I solved it,

cv::Ptr<cv::optflow::RLOFOpticalFlowParameter> rlof_param = cv::optflow::RLOFOpticalFlowParameter::create();
rlof_param->useInitialFlow= true;
rlof_param->useGlobalMotionPrior = false;

At that time, rlof-param ->useInitialFlow=true; was used;, This rlof-param ->useGlobalMotionPrior=false; It must be false, otherwise the above error will be reported.

1 Like