Merge pull request #1744 from liuxing6666:2.4_fix_harris_test

This commit is contained in:
Andrey Pavlenko
2013-12-02 20:38:48 +04:00
committed by OpenCV Buildbot
2 changed files with 45 additions and 12 deletions

View File

@@ -254,8 +254,28 @@ OCL_TEST_P(CornerMinEigenVal, Mat)
}
////////////////////////////////cornerHarris//////////////////////////////////////////
struct CornerHarris :
public ImgprocTestBase
{
void Near(double threshold = 0.0)
{
Mat whole, roi;
gdst_whole.download(whole);
gdst_roi.download(roi);
typedef CornerTestBase CornerHarris;
absdiff(whole, dst_whole, whole);
absdiff(roi, dst_roi, roi);
divide(whole, dst_whole, whole);
divide(roi, dst_roi, roi);
absdiff(dst_whole, dst_whole, dst_whole);
absdiff(dst_roi, dst_roi, dst_roi);
EXPECT_MAT_NEAR(dst_whole, whole, threshold);
EXPECT_MAT_NEAR(dst_roi, roi, threshold);
}
};
OCL_TEST_P(CornerHarris, Mat)
{
@@ -269,7 +289,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(1e-5, true);
Near(1e-5);
}
}