1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Fix Farneback Optical Flow Algorithm

- Before this PR, following tests failed on some platform.
  CUDA_OptFlow/FarnebackOpticalFlow.Accuracy/19
  CUDA_OptFlow/FarnebackOpticalFlow.Accuracy/23

- The algorithm now recognizes the OPTFLOW_USE_INITIAL_FLOW flag.
  Previously, when the flag was set, it did not use the flow data
  passed as input, instead used some garbage data in memory.

- More strict test limit.
This commit is contained in:
Namgoo Lee
2019-01-11 04:00:08 +00:00
parent 054bd23a43
commit 4366c8734f
3 changed files with 49 additions and 14 deletions
+9 -1
View File
@@ -337,7 +337,15 @@ CUDA_TEST_P(FarnebackOpticalFlow, Accuracy)
frame0, frame1, flow, farn->getPyrScale(), farn->getNumLevels(), farn->getWinSize(),
farn->getNumIters(), farn->getPolyN(), farn->getPolySigma(), farn->getFlags());
EXPECT_MAT_SIMILAR(flow, d_flow, 0.1);
// Relax test limit when the flag is set
if (farn->getFlags() & cv::OPTFLOW_FARNEBACK_GAUSSIAN)
{
EXPECT_MAT_SIMILAR(flow, d_flow, 2e-2);
}
else
{
EXPECT_MAT_SIMILAR(flow, d_flow, 1e-4);
}
}
INSTANTIATE_TEST_CASE_P(CUDA_OptFlow, FarnebackOpticalFlow, testing::Combine(