opencv/modules/nonfree/perf/perf_surf.cpp
Roman Donchenko f77c68e0fa Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/imgproc/src/opencl/integral_sqrsum.cl
	modules/nonfree/doc/feature_detection.rst
	modules/nonfree/include/opencv2/nonfree/ocl.hpp
	modules/nonfree/src/surf_ocl.cpp
	modules/nonfree/test/test_features2d.cpp
	modules/ocl/doc/image_processing.rst
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/perf/perf_imgproc.cpp
	modules/ocl/perf/perf_match_template.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/match_template.cpp
	modules/ocl/src/opencl/haarobjectdetect.cl
	modules/ocl/src/opencl/haarobjectdetect_scaled2.cl
	modules/ocl/test/test_imgproc.cpp
2014-03-31 14:42:00 +04:00

67 lines
1.7 KiB
C++

#include "perf_precomp.hpp"
using namespace std;
using namespace cv;
using namespace perf;
using std::tr1::make_tuple;
using std::tr1::get;
typedef perf::TestBaseWithParam<std::string> surf;
#define SURF_IMAGES \
"cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png",\
"stitching/a3.png"
PERF_TEST_P(surf, detect, testing::Values(SURF_IMAGES))
{
string filename = getDataPath(GetParam());
Mat frame = imread(filename, IMREAD_GRAYSCALE);
ASSERT_FALSE(frame.empty()) << "Unable to load source image " << filename;
Mat mask;
declare.in(frame).time(90);
SURF detector;
vector<KeyPoint> points;
TEST_CYCLE() detector(frame, mask, points);
SANITY_CHECK_KEYPOINTS(points, 1e-3);
}
PERF_TEST_P(surf, extract, testing::Values(SURF_IMAGES))
{
string filename = getDataPath(GetParam());
Mat frame = imread(filename, IMREAD_GRAYSCALE);
ASSERT_FALSE(frame.empty()) << "Unable to load source image " << filename;
Mat mask;
declare.in(frame).time(90);
SURF detector;
vector<KeyPoint> points;
vector<float> descriptors;
detector(frame, mask, points);
TEST_CYCLE() detector(frame, mask, points, descriptors, true);
SANITY_CHECK(descriptors, 1e-4);
}
PERF_TEST_P(surf, full, testing::Values(SURF_IMAGES))
{
string filename = getDataPath(GetParam());
Mat frame = imread(filename, IMREAD_GRAYSCALE);
ASSERT_FALSE(frame.empty()) << "Unable to load source image " << filename;
Mat mask;
declare.in(frame).time(90);
SURF detector;
vector<KeyPoint> points;
vector<float> descriptors;
TEST_CYCLE() detector(frame, mask, points, descriptors, false);
SANITY_CHECK_KEYPOINTS(points, 1e-3);
SANITY_CHECK(descriptors, 1e-4);
}