• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "perf_precomp.hpp"
2 
3 using namespace std;
4 using namespace cv;
5 using namespace perf;
6 using std::tr1::make_tuple;
7 using std::tr1::get;
8 
9 enum { AGAST_5_8 = AgastFeatureDetector::AGAST_5_8, AGAST_7_12d = AgastFeatureDetector::AGAST_7_12d,
10        AGAST_7_12s = AgastFeatureDetector::AGAST_7_12s, OAST_9_16 = AgastFeatureDetector::OAST_9_16 };
11 CV_ENUM(AgastType, AGAST_5_8, AGAST_7_12d,
12                    AGAST_7_12s, OAST_9_16)
13 
14 typedef std::tr1::tuple<string, AgastType> File_Type_t;
15 typedef perf::TestBaseWithParam<File_Type_t> agast;
16 
17 #define AGAST_IMAGES \
18     "cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png",\
19     "stitching/a3.png"
20 
PERF_TEST_P(agast,detect,testing::Combine (testing::Values (AGAST_IMAGES),AgastType::all ()))21 PERF_TEST_P(agast, detect, testing::Combine(
22                             testing::Values(AGAST_IMAGES),
23                             AgastType::all()
24                           ))
25 {
26     string filename = getDataPath(get<0>(GetParam()));
27     int type = get<1>(GetParam());
28     Mat frame = imread(filename, IMREAD_GRAYSCALE);
29 
30     if (frame.empty())
31         FAIL() << "Unable to load source image " << filename;
32 
33     declare.in(frame);
34 
35     Ptr<FeatureDetector> fd = AgastFeatureDetector::create(70, true, type);
36     ASSERT_FALSE( fd.empty() );
37     vector<KeyPoint> points;
38 
39     TEST_CYCLE() fd->detect(frame, points);
40 
41     SANITY_CHECK_KEYPOINTS(points);
42 }
43