mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 22:00:25 +08:00
f77c68e0fa
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
67 lines
1.7 KiB
C++
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);
|
|
}
|