diff --git a/modules/objdetect/perf/perf_cascadeclassifier.cpp b/modules/objdetect/perf/perf_cascadeclassifier.cpp new file mode 100644 index 000000000..309fdf3a8 --- /dev/null +++ b/modules/objdetect/perf/perf_cascadeclassifier.cpp @@ -0,0 +1,27 @@ +#include "perf_precomp.hpp" + +using namespace std; +using namespace cv; +using namespace perf; + +typedef std::tr1::tuple ImageName_MinSize_t; +typedef perf::TestBaseWithParam ImageName_MinSize; + +PERF_TEST_P( ImageName_MinSize, CascadeClassifierLBPFrontalFace, testing::Values( ImageName_MinSize_t("cv/shared/lena.jpg", 10) ) ) +{ + const char* filename = std::tr1::get<0>(GetParam()); + int min_size = std::tr1::get<1>(GetParam()); + Size minSize(min_size, min_size); + + CascadeClassifier cc(getDataPath("cv/cascadeandhog/cascades/lbpcascade_frontalface.xml")); + + Mat img=imread(getDataPath(filename)); + vector res; + + declare.in(img).time(10000); + TEST_CYCLE(100) + { + res.clear(); + cc.detectMultiScale(img, res, 1.1, 3, 0, minSize); + } +} diff --git a/modules/objdetect/perf/perf_main.cpp b/modules/objdetect/perf/perf_main.cpp new file mode 100644 index 000000000..69b8ecac5 --- /dev/null +++ b/modules/objdetect/perf/perf_main.cpp @@ -0,0 +1,3 @@ +#include "perf_precomp.hpp" + +CV_PERF_TEST_MAIN(objdetect) diff --git a/modules/objdetect/perf/perf_precomp.cpp b/modules/objdetect/perf/perf_precomp.cpp new file mode 100644 index 000000000..8552ac3d4 --- /dev/null +++ b/modules/objdetect/perf/perf_precomp.cpp @@ -0,0 +1 @@ +#include "perf_precomp.hpp" diff --git a/modules/objdetect/perf/perf_precomp.hpp b/modules/objdetect/perf/perf_precomp.hpp new file mode 100644 index 000000000..397f127c6 --- /dev/null +++ b/modules/objdetect/perf/perf_precomp.hpp @@ -0,0 +1,12 @@ +#ifndef __OPENCV_PERF_PRECOMP_HPP__ +#define __OPENCV_PERF_PRECOMP_HPP__ + +#include "opencv2/ts/ts.hpp" +#include "opencv2/objdetect/objdetect.hpp" +#include "opencv2/highgui/highgui.hpp" + +#if GTEST_CREATE_SHARED_LIBRARY +#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined +#endif + +#endif