Adding 1 to moments to avoid tests fails

This commit is contained in:
kalistratovag 2015-04-22 16:29:10 +03:00 committed by Maksim Shabunin
parent 1138a38dbe
commit 20156d1eeb

View File

@ -34,5 +34,11 @@ PERF_TEST_P(MomentsFixture_val, Moments1,
TEST_CYCLE() m = cv::moments(src, binaryImage);
int len = (int)sizeof(cv::Moments) / sizeof(double);
cv::Mat mat(1, len, CV_64F, (void*)&m);
//adding 1 to moments to avoid accidental tests fail on values close to 0
mat += 1;
SANITY_CHECK_MOMENTS(m, 1e-4, ERROR_RELATIVE);
}