Adding 1 to moments to avoid tests fails
This commit is contained in:
parent
1138a38dbe
commit
20156d1eeb
@ -34,5 +34,11 @@ PERF_TEST_P(MomentsFixture_val, Moments1,
|
|||||||
|
|
||||||
TEST_CYCLE() m = cv::moments(src, binaryImage);
|
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);
|
SANITY_CHECK_MOMENTS(m, 1e-4, ERROR_RELATIVE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user