diff --git a/modules/features2d/perf/opencl/perf_brute_force_matcher.cpp b/modules/features2d/perf/opencl/perf_brute_force_matcher.cpp index f7bd24cf52..2e6e574160 100644 --- a/modules/features2d/perf/opencl/perf_brute_force_matcher.cpp +++ b/modules/features2d/perf/opencl/perf_brute_force_matcher.cpp @@ -123,7 +123,7 @@ OCL_PERF_TEST_P(BruteForceMatcherFixture, RadiusMatch, ::testing::Combine(OCL_PE SANITY_CHECK_MATCHES(matches1, 1e-3); } -}//ocl -}//cvtest +} // ocl +} // cvtest -#endif //HAVE_OPENCL +#endif // HAVE_OPENCL diff --git a/modules/features2d/perf/opencl/perf_orb.cpp b/modules/features2d/perf/opencl/perf_orb.cpp new file mode 100644 index 0000000000..78a82aa449 --- /dev/null +++ b/modules/features2d/perf/opencl/perf_orb.cpp @@ -0,0 +1,86 @@ +#include "perf_precomp.hpp" +#include "opencv2/ts/ocl_perf.hpp" + +#ifdef HAVE_OPENCL + +namespace cvtest { +namespace ocl { + +typedef ::perf::TestBaseWithParam ORBFixture; + +#define ORB_IMAGES OCL_PERF_ENUM("cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png", "stitching/a3.png") + +OCL_PERF_TEST_P(ORBFixture, ORB_Detect, ORB_IMAGES) +{ + string filename = getDataPath(GetParam()); + Mat mframe = imread(filename, IMREAD_GRAYSCALE); + + if (mframe.empty()) + FAIL() << "Unable to load source image " << filename; + + UMat frame, mask; + mframe.copyTo(frame); + + declare.in(frame); + ORB detector(1500, 1.3f, 1); + vector points; + + OCL_TEST_CYCLE() detector(frame, mask, points); + + sort(points.begin(), points.end(), comparators::KeypointGreater()); + SANITY_CHECK_KEYPOINTS(points, 1e-5); +} + +OCL_PERF_TEST_P(ORBFixture, ORB_Extract, ORB_IMAGES) +{ + string filename = getDataPath(GetParam()); + Mat mframe = imread(filename, IMREAD_GRAYSCALE); + + if (mframe.empty()) + FAIL() << "Unable to load source image " << filename; + + UMat mask, frame; + mframe.copyTo(frame); + + declare.in(frame); + + ORB detector(1500, 1.3f, 1); + vector points; + detector(frame, mask, points); + sort(points.begin(), points.end(), comparators::KeypointGreater()); + + UMat descriptors; + + OCL_TEST_CYCLE() detector(frame, mask, points, descriptors, true); + + SANITY_CHECK(descriptors); +} + +OCL_PERF_TEST_P(ORBFixture, ORB_Full, ORB_IMAGES) +{ + string filename = getDataPath(GetParam()); + Mat mframe = imread(filename, IMREAD_GRAYSCALE); + + if (mframe.empty()) + FAIL() << "Unable to load source image " << filename; + + UMat mask, frame; + mframe.copyTo(frame); + + declare.in(frame); + ORB detector(1500, 1.3f, 1); + + vector points; + UMat descriptors; + + OCL_TEST_CYCLE() detector(frame, mask, points, descriptors, false); + + ::perf::sort(points, descriptors); + SANITY_CHECK_KEYPOINTS(points, 1e-5); + SANITY_CHECK(descriptors); +} + +} // ocl +} // cvtest + +#endif // HAVE_OPENCL