2012-01-16 14:35:16 +01:00
|
|
|
#include "perf_precomp.hpp"
|
|
|
|
|
|
|
|
#include "cmath"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace cv;
|
|
|
|
using namespace perf;
|
|
|
|
using std::tr1::make_tuple;
|
|
|
|
using std::tr1::get;
|
|
|
|
|
|
|
|
typedef std::tr1::tuple<String, double, double, int> Image_RhoStep_ThetaStep_Threshold_t;
|
|
|
|
typedef perf::TestBaseWithParam<Image_RhoStep_ThetaStep_Threshold_t> Image_RhoStep_ThetaStep_Threshold;
|
|
|
|
|
|
|
|
PERF_TEST_P(Image_RhoStep_ThetaStep_Threshold, HoughLines,
|
|
|
|
testing::Combine(
|
2012-10-02 21:07:46 +02:00
|
|
|
testing::Values( "cv/shared/pic5.png", "stitching/a1.png" ),
|
2012-01-16 14:35:16 +01:00
|
|
|
testing::Values( 1, 10 ),
|
|
|
|
testing::Values( 0.01, 0.1 ),
|
2012-10-17 09:12:04 +02:00
|
|
|
testing::Values( 300, 500 )
|
2012-01-16 14:35:16 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
String filename = getDataPath(get<0>(GetParam()));
|
|
|
|
double rhoStep = get<1>(GetParam());
|
|
|
|
double thetaStep = get<2>(GetParam());
|
|
|
|
int threshold = get<3>(GetParam());
|
|
|
|
|
|
|
|
Mat image = imread(filename, IMREAD_GRAYSCALE);
|
|
|
|
if (image.empty())
|
|
|
|
FAIL() << "Unable to load source image" << filename;
|
2012-10-17 09:12:04 +02:00
|
|
|
|
2012-01-16 14:35:16 +01:00
|
|
|
Canny(image, image, 0, 0);
|
2012-10-17 09:12:04 +02:00
|
|
|
|
2012-01-16 14:35:16 +01:00
|
|
|
Mat lines;
|
|
|
|
declare.time(7);
|
|
|
|
|
|
|
|
TEST_CYCLE() HoughLines(image, lines, rhoStep, thetaStep, threshold);
|
|
|
|
|
|
|
|
SANITY_CHECK(lines);
|
|
|
|
}
|