Home | History | Annotate | Download | only in perf
      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 { 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, TYPE_9_16)
     11 
     12 typedef std::tr1::tuple<string, FastType> File_Type_t;
     13 typedef perf::TestBaseWithParam<File_Type_t> fast;
     14 
     15 #define FAST_IMAGES \
     16     "cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png",\
     17     "stitching/a3.png"
     18 
     19 PERF_TEST_P(fast, detect, 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 frame = imread(filename, IMREAD_GRAYSCALE);
     27 
     28     if (frame.empty())
     29         FAIL() << "Unable to load source image " << filename;
     30 
     31     declare.in(frame);
     32 
     33     Ptr<FeatureDetector> fd = FastFeatureDetector::create(20, true, type);
     34     ASSERT_FALSE( fd.empty() );
     35     vector<KeyPoint> points;
     36 
     37     TEST_CYCLE() fd->detect(frame, points);
     38 
     39     SANITY_CHECK_KEYPOINTS(points);
     40 }
     41