2012-01-16 21:35:16 +08:00
|
|
|
#include "perf_precomp.hpp"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace cv;
|
|
|
|
using namespace perf;
|
|
|
|
using std::tr1::make_tuple;
|
|
|
|
using std::tr1::get;
|
|
|
|
|
|
|
|
CV_ENUM(BorderType, BORDER_REPLICATE, BORDER_CONSTANT, BORDER_REFLECT, BORDER_REFLECT_101)
|
|
|
|
|
2013-02-25 00:14:01 +08:00
|
|
|
typedef std::tr1::tuple<string, int, int, double, BorderType> Img_BlockSize_ApertureSize_k_BorderType_t;
|
2012-01-16 21:35:16 +08:00
|
|
|
typedef perf::TestBaseWithParam<Img_BlockSize_ApertureSize_k_BorderType_t> Img_BlockSize_ApertureSize_k_BorderType;
|
|
|
|
|
|
|
|
PERF_TEST_P(Img_BlockSize_ApertureSize_k_BorderType, cornerHarris,
|
|
|
|
testing::Combine(
|
2012-10-03 03:07:46 +08:00
|
|
|
testing::Values( "stitching/a1.png", "cv/shared/pic5.png"),
|
2012-01-16 21:35:16 +08:00
|
|
|
testing::Values( 3, 5 ),
|
|
|
|
testing::Values( 3, 5 ),
|
2012-05-24 23:42:07 +08:00
|
|
|
testing::Values( 0.04, 0.1 ),
|
2013-04-15 23:39:49 +08:00
|
|
|
BorderType::all()
|
2012-01-16 21:35:16 +08:00
|
|
|
)
|
|
|
|
)
|
|
|
|
{
|
2013-02-25 00:14:01 +08:00
|
|
|
string filename = getDataPath(get<0>(GetParam()));
|
2012-01-16 21:35:16 +08:00
|
|
|
int blockSize = get<1>(GetParam());
|
|
|
|
int apertureSize = get<2>(GetParam());
|
|
|
|
double k = get<3>(GetParam());
|
|
|
|
BorderType borderType = get<4>(GetParam());
|
|
|
|
|
|
|
|
Mat src = imread(filename, IMREAD_GRAYSCALE);
|
|
|
|
if (src.empty())
|
|
|
|
FAIL() << "Unable to load source image" << filename;
|
2012-10-17 15:12:04 +08:00
|
|
|
|
2012-01-16 21:35:16 +08:00
|
|
|
Mat dst;
|
|
|
|
|
|
|
|
TEST_CYCLE() cornerHarris(src, dst, blockSize, apertureSize, k, borderType);
|
|
|
|
|
2012-05-24 23:42:07 +08:00
|
|
|
SANITY_CHECK(dst, 2e-5);
|
2013-08-21 21:26:54 +08:00
|
|
|
}
|