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 typedef std::tr1::tuple<std::string, cv::Size> String_Size_t;
     10 typedef perf::TestBaseWithParam<String_Size_t> String_Size;
     11 
     12 PERF_TEST_P(String_Size, asymm_circles_grid, testing::Values(
     13                 String_Size_t("cv/cameracalibration/asymmetric_circles/acircles1.png", Size(7,13)),
     14                 String_Size_t("cv/cameracalibration/asymmetric_circles/acircles2.png", Size(7,13)),
     15                 String_Size_t("cv/cameracalibration/asymmetric_circles/acircles3.png", Size(7,13)),
     16                 String_Size_t("cv/cameracalibration/asymmetric_circles/acircles4.png", Size(5,5)),
     17                 String_Size_t("cv/cameracalibration/asymmetric_circles/acircles5.png", Size(5,5)),
     18                 String_Size_t("cv/cameracalibration/asymmetric_circles/acircles6.png", Size(5,5)),
     19                 String_Size_t("cv/cameracalibration/asymmetric_circles/acircles7.png", Size(3,9)),
     20                 String_Size_t("cv/cameracalibration/asymmetric_circles/acircles8.png", Size(3,9)),
     21                 String_Size_t("cv/cameracalibration/asymmetric_circles/acircles9.png", Size(3,9))
     22                 )
     23             )
     24 {
     25     string filename = getDataPath(get<0>(GetParam()));
     26     Size gridSize = get<1>(GetParam());
     27 
     28     Mat frame = imread(filename);
     29     if (frame.empty())
     30         FAIL() << "Unable to load source image " << filename;
     31 
     32     vector<Point2f> ptvec;
     33     ptvec.resize(gridSize.area());
     34 
     35     cvtColor(frame, frame, COLOR_BGR2GRAY);
     36 
     37     declare.in(frame).out(ptvec);
     38 
     39     TEST_CYCLE() ASSERT_TRUE(findCirclesGrid(frame, gridSize, ptvec, CALIB_CB_CLUSTERING | CALIB_CB_ASYMMETRIC_GRID));
     40 
     41     SANITY_CHECK(ptvec, 2);
     42 }
     43