mirror of https://github.com/opencv/opencv.git
Open Source Computer Vision Library
https://opencv.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.6 KiB
66 lines
1.6 KiB
13 years ago
|
#include "perf_precomp.hpp"
|
||
|
|
||
|
using namespace std;
|
||
|
using namespace cv;
|
||
|
using namespace perf;
|
||
13 years ago
|
using std::tr1::make_tuple;
|
||
|
using std::tr1::get;
|
||
13 years ago
|
|
||
|
typedef perf::TestBaseWithParam<std::string> surf;
|
||
|
|
||
|
#define SURF_IMAGES \
|
||
|
"cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png",\
|
||
|
"stitching/a3.jpg"
|
||
|
|
||
13 years ago
|
PERF_TEST_P(surf, detect, testing::Values(SURF_IMAGES))
|
||
13 years ago
|
{
|
||
|
String filename = getDataPath(GetParam());
|
||
|
Mat frame = imread(filename, IMREAD_GRAYSCALE);
|
||
|
|
||
|
if (frame.empty())
|
||
|
FAIL() << "Unable to load source image " << filename;
|
||
|
|
||
|
Mat mask;
|
||
|
declare.in(frame).time(90);
|
||
|
SURF detector;
|
||
|
vector<KeyPoint> points;
|
||
|
|
||
13 years ago
|
TEST_CYCLE() detector(frame, mask, points);
|
||
13 years ago
|
}
|
||
|
|
||
13 years ago
|
PERF_TEST_P(surf, extract, testing::Values(SURF_IMAGES))
|
||
13 years ago
|
{
|
||
|
String filename = getDataPath(GetParam());
|
||
|
Mat frame = imread(filename, IMREAD_GRAYSCALE);
|
||
|
|
||
|
if (frame.empty())
|
||
|
FAIL() << "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);
|
||
|
|
||
13 years ago
|
TEST_CYCLE() detector(frame, mask, points, descriptors, true);
|
||
13 years ago
|
}
|
||
|
|
||
13 years ago
|
PERF_TEST_P(surf, full, testing::Values(SURF_IMAGES))
|
||
13 years ago
|
{
|
||
|
String filename = getDataPath(GetParam());
|
||
|
Mat frame = imread(filename, IMREAD_GRAYSCALE);
|
||
|
|
||
|
if (frame.empty())
|
||
|
FAIL() << "Unable to load source image " << filename;
|
||
|
|
||
|
Mat mask;
|
||
|
declare.in(frame).time(90);
|
||
|
SURF detector;
|
||
|
vector<KeyPoint> points;
|
||
|
vector<float> descriptors;
|
||
|
|
||
13 years ago
|
TEST_CYCLE() detector(frame, mask, points, descriptors, false);
|
||
13 years ago
|
}
|