1 #include "perf_precomp.hpp" 2 3 #include "cmath" 4 5 using namespace std; 6 using namespace cv; 7 using namespace perf; 8 using std::tr1::make_tuple; 9 using std::tr1::get; 10 11 typedef std::tr1::tuple<string, double, double, int> Image_RhoStep_ThetaStep_Threshold_t; 12 typedef perf::TestBaseWithParam<Image_RhoStep_ThetaStep_Threshold_t> Image_RhoStep_ThetaStep_Threshold; 13 14 PERF_TEST_P(Image_RhoStep_ThetaStep_Threshold, HoughLines, 15 testing::Combine( 16 testing::Values( "cv/shared/pic5.png", "stitching/a1.png" ), 17 testing::Values( 1, 10 ), 18 testing::Values( 0.01, 0.1 ), 19 testing::Values( 300, 500 ) 20 ) 21 ) 22 { 23 string filename = getDataPath(get<0>(GetParam())); 24 double rhoStep = get<1>(GetParam()); 25 double thetaStep = get<2>(GetParam()); 26 int threshold = get<3>(GetParam()); 27 28 Mat image = imread(filename, IMREAD_GRAYSCALE); 29 if (image.empty()) 30 FAIL() << "Unable to load source image" << filename; 31 32 Canny(image, image, 0, 0); 33 34 Mat lines; 35 declare.time(60); 36 37 TEST_CYCLE() HoughLines(image, lines, rhoStep, thetaStep, threshold); 38 39 transpose(lines, lines); 40 #if (0 && defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 801) 41 SANITY_CHECK_NOTHING(); 42 #else 43 SANITY_CHECK(lines); 44 #endif 45 } 46