From 3f22a1c40f717b9f177633e7b3af110a890e7404 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Thu, 27 Oct 2011 14:46:12 +0000 Subject: [PATCH] Performace tests for ORB --- modules/features2d/perf/perf_orb.cpp | 75 ++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 modules/features2d/perf/perf_orb.cpp diff --git a/modules/features2d/perf/perf_orb.cpp b/modules/features2d/perf/perf_orb.cpp new file mode 100644 index 0000000..78f2f92 --- /dev/null +++ b/modules/features2d/perf/perf_orb.cpp @@ -0,0 +1,75 @@ +#include "perf_precomp.hpp" + +using namespace std; +using namespace cv; +using namespace perf; + + +typedef perf::TestBaseWithParam orb; + +#define ORB_IMAGES \ + "cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png",\ + "stitching/a3.jpg" + +PERF_TEST_P( orb, detect, testing::Values(ORB_IMAGES) ) +{ + 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); + ORB detector(1500, ORB::CommonParams(1.3f, 5)); + vector points; + + TEST_CYCLE(100) + { + detector(frame, mask, points); + } +} + +PERF_TEST_P( orb, extract, testing::Values(ORB_IMAGES) ) +{ + 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); + + ORB detector(1500, ORB::CommonParams(1.3f, 5)); + vector points; + detector(frame, mask, points); + + Mat descriptors; + + TEST_CYCLE(100) + { + detector(frame, mask, points, descriptors, true); + } +} + +PERF_TEST_P( orb, full, testing::Values(ORB_IMAGES) ) +{ + 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); + ORB detector(1500, ORB::CommonParams(1.3f, 5)); + + vector points; + Mat descriptors; + + TEST_CYCLE(100) + { + detector(frame, mask, points, descriptors, false); + } +} -- 2.7.4