1
#include "../perf_precomp.hpp"
2
#include "opencv2/ts/ocl_perf.hpp"
9
typedef ::perf::TestBaseWithParam<std::string> ORBFixture;
11
#define ORB_IMAGES OCL_PERF_ENUM("cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png", "stitching/a3.png")
13
OCL_PERF_TEST_P(ORBFixture, ORB_Detect, ORB_IMAGES)
15
string filename = getDataPath(GetParam());
16
Mat mframe = imread(filename, IMREAD_GRAYSCALE);
19
FAIL() << "Unable to load source image " << filename;
25
Ptr<ORB> detector = ORB::create(1500, 1.3f, 1);
26
vector<KeyPoint> points;
28
OCL_TEST_CYCLE() detector->detect(frame, points, mask);
30
std::sort(points.begin(), points.end(), comparators::KeypointGreater());
31
SANITY_CHECK_KEYPOINTS(points, 1e-5);
34
OCL_PERF_TEST_P(ORBFixture, ORB_Extract, ORB_IMAGES)
36
string filename = getDataPath(GetParam());
37
Mat mframe = imread(filename, IMREAD_GRAYSCALE);
40
FAIL() << "Unable to load source image " << filename;
47
Ptr<ORB> detector = ORB::create(1500, 1.3f, 1);
48
vector<KeyPoint> points;
49
detector->detect(frame, points, mask);
50
std::sort(points.begin(), points.end(), comparators::KeypointGreater());
54
OCL_TEST_CYCLE() detector->compute(frame, points, descriptors);
56
SANITY_CHECK(descriptors);
59
OCL_PERF_TEST_P(ORBFixture, ORB_Full, ORB_IMAGES)
61
string filename = getDataPath(GetParam());
62
Mat mframe = imread(filename, IMREAD_GRAYSCALE);
64
double desc_eps = 1e-6;
66
if (cv::ocl::Device::getDefault().isNVidia())
71
FAIL() << "Unable to load source image " << filename;
77
Ptr<ORB> detector = ORB::create(1500, 1.3f, 1);
79
vector<KeyPoint> points;
82
OCL_TEST_CYCLE() detector->detectAndCompute(frame, mask, points, descriptors, false);
84
::perf::sort(points, descriptors);
85
SANITY_CHECK_KEYPOINTS(points, 1e-5);
86
SANITY_CHECK(descriptors, desc_eps);