1 #include "../perf_precomp.hpp"
2 #include "opencv2/ts/ocl_perf.hpp"
3 
4 #ifdef HAVE_OPENCL
5 
6 namespace cvtest {
7 namespace ocl {
8 
9 enum { TYPE_5_8 =FastFeatureDetector::TYPE_5_8, TYPE_7_12 = FastFeatureDetector::TYPE_7_12, TYPE_9_16 = FastFeatureDetector::TYPE_9_16 };
10 CV_ENUM(FastType, TYPE_5_8, TYPE_7_12)
11 
12 typedef std::tr1::tuple<string, FastType> File_Type_t;
13 typedef TestBaseWithParam<File_Type_t> FASTFixture;
14 
15 #define FAST_IMAGES \
16     "cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png",\
17     "stitching/a3.png"
18 
OCL_PERF_TEST_P(FASTFixture,FastDetect,testing::Combine (testing::Values (FAST_IMAGES),FastType::all ()))19 OCL_PERF_TEST_P(FASTFixture, FastDetect, testing::Combine(
20                             testing::Values(FAST_IMAGES),
21                             FastType::all()
22                           ))
23 {
24     string filename = getDataPath(get<0>(GetParam()));
25     int type = get<1>(GetParam());
26     Mat mframe = imread(filename, IMREAD_GRAYSCALE);
27 
28     if (mframe.empty())
29         FAIL() << "Unable to load source image " << filename;
30 
31     UMat frame;
32     mframe.copyTo(frame);
33     declare.in(frame);
34 
35     Ptr<FeatureDetector> fd = FastFeatureDetector::create(20, true, type);
36     ASSERT_FALSE( fd.empty() );
37     vector<KeyPoint> points;
38 
39     OCL_TEST_CYCLE() fd->detect(frame, points);
40 
41     SANITY_CHECK_KEYPOINTS(points);
42 }
43 
44 } // ocl
45 } // cvtest
46 
47 #endif // HAVE_OPENCL
48