Commit 8e42ca17 authored by Andrey Pavlenko's avatar Andrey Pavlenko

SURF keypoints rotation invariance test.

It calcs kpts for a cross and checks that 4 kpts at the edges have equal responce.
parent c49b23d4
......@@ -668,3 +668,22 @@ TEST(Features2d_ScaleInvariance_Descriptor_SIFT, regression)
0.87f);
test.safe_run();
}
TEST(Features2d_RotationInvariance2_Detector_SURF, regression)
{
Mat cross(100, 100, CV_8UC1, Scalar(255));
line(cross, Point(30, 50), Point(69, 50), Scalar(100), 3);
line(cross, Point(50, 30), Point(50, 69), Scalar(100), 3);
SURF surf(8000., 3, 4, true, false);
vector<KeyPoint> keypoints;
surf(cross, noArray(), keypoints);
ASSERT_EQ(keypoints.size(), 5);
ASSERT_LT( fabs(keypoints[1].response - keypoints[2].response), 1e-6);
ASSERT_LT( fabs(keypoints[1].response - keypoints[3].response), 1e-6);
ASSERT_LT( fabs(keypoints[1].response - keypoints[4].response), 1e-6);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment