1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

fix test error on Tinker Board (OpenCL on Arm platform)

* loosen some test threshold mainly for integer types
  * use relative error for floating points result
  * avoid division by zero by following the comment
  * fix the indentation
This commit is contained in:
Tomoaki Teshima
2018-02-26 22:55:06 +09:00
parent c0eaff3608
commit 8fd1bbde76
3 changed files with 25 additions and 17 deletions
+9 -3
View File
@@ -329,11 +329,14 @@ OCL_TEST_P(Mul, Mat_Scale)
OCL_OFF(cv::multiply(src1_roi, src2_roi, dst1_roi, val[0]));
OCL_ON(cv::multiply(usrc1_roi, usrc2_roi, udst1_roi, val[0]));
if (udst1_roi.depth() >= CV_32F)
#ifdef __ANDROID__
Near(udst1_roi.depth() >= CV_32F ? 2e-1 : 1);
Near(2e-1, true);
#else
Near(udst1_roi.depth() >= CV_32F ? 1e-3 : 1);
Near(1e-3, true);
#endif
else
Near(1);
}
}
@@ -867,7 +870,10 @@ OCL_TEST_P(AddWeighted, Mat)
OCL_OFF(cv::addWeighted(src1_roi, alpha, src2_roi, beta, gama, dst1_roi));
OCL_ON(cv::addWeighted(usrc1_roi, alpha, usrc2_roi, beta, gama, udst1_roi));
Near(3e-4);
if(dst1_roi.depth() >= CV_32F)
Near(3e-4, true);
else
Near(1);
}
}