1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

ocl: corner*: fix memory access in kernels; change error check to relative

This commit is contained in:
Alexander Alekhin
2013-11-01 16:38:04 +04:00
parent e7e6d9d63c
commit 99ae9d9cc1
3 changed files with 30 additions and 24 deletions
+14 -6
View File
@@ -93,14 +93,22 @@ PARAM_TEST_CASE(ImgprocTestBase, MatType,
generateOclMat(gdst_whole, gdst_roi, dst_whole, roiSize, dstBorder);
}
void Near(double threshold = 0.0)
void Near(double threshold = 0.0, bool relative = false)
{
Mat whole, roi;
Mat roi, whole;
gdst_whole.download(whole);
gdst_roi.download(roi);
EXPECT_MAT_NEAR(dst_whole, whole, threshold);
EXPECT_MAT_NEAR(dst_roi, roi, threshold);
if (relative)
{
EXPECT_MAT_NEAR_RELATIVE(dst_whole, whole, threshold);
EXPECT_MAT_NEAR_RELATIVE(dst_roi, roi, threshold);
}
else
{
EXPECT_MAT_NEAR(dst_whole, whole, threshold);
EXPECT_MAT_NEAR(dst_roi, roi, threshold);
}
}
};
@@ -228,7 +236,7 @@ OCL_TEST_P(CornerMinEigenVal, Mat)
cornerMinEigenVal(src_roi, dst_roi, blockSize, apertureSize, borderType);
ocl::cornerMinEigenVal(gsrc_roi, gdst_roi, blockSize, apertureSize, borderType);
Near(0.02);
Near(1e-5, true);
}
}
@@ -248,7 +256,7 @@ OCL_TEST_P(CornerHarris, Mat)
cornerHarris(src_roi, dst_roi, blockSize, apertureSize, k, borderType);
ocl::cornerHarris(gsrc_roi, gdst_roi, blockSize, apertureSize, k, borderType);
Near(0.02);
Near(1e-5, true);
}
}