2011-09-08 03:52:52 +08:00
|
|
|
#include "perf_precomp.hpp"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace cv;
|
|
|
|
using namespace perf;
|
|
|
|
|
2011-09-08 17:29:27 +08:00
|
|
|
typedef std::tr1::tuple<std::string, int> ImageName_MinSize_t;
|
2011-09-08 03:52:52 +08:00
|
|
|
typedef perf::TestBaseWithParam<ImageName_MinSize_t> ImageName_MinSize;
|
|
|
|
|
|
|
|
PERF_TEST_P( ImageName_MinSize, CascadeClassifierLBPFrontalFace, testing::Values( ImageName_MinSize_t("cv/shared/lena.jpg", 10) ) )
|
|
|
|
{
|
2011-09-08 17:29:27 +08:00
|
|
|
const string filename = std::tr1::get<0>(GetParam());
|
2011-09-08 03:52:52 +08:00
|
|
|
int min_size = std::tr1::get<1>(GetParam());
|
|
|
|
Size minSize(min_size, min_size);
|
|
|
|
|
|
|
|
CascadeClassifier cc(getDataPath("cv/cascadeandhog/cascades/lbpcascade_frontalface.xml"));
|
2011-09-08 17:29:27 +08:00
|
|
|
if (cc.empty())
|
|
|
|
FAIL() << "Can't load cascade file";
|
2011-09-08 03:52:52 +08:00
|
|
|
|
|
|
|
Mat img=imread(getDataPath(filename));
|
2011-09-08 17:29:27 +08:00
|
|
|
if (img.empty())
|
|
|
|
FAIL() << "Can't load source image";
|
|
|
|
|
2011-09-08 03:52:52 +08:00
|
|
|
vector<Rect> res;
|
|
|
|
|
2011-09-08 17:29:27 +08:00
|
|
|
declare.in(img);//.out(res)
|
|
|
|
|
|
|
|
while(next())
|
2011-09-08 03:52:52 +08:00
|
|
|
{
|
|
|
|
res.clear();
|
2011-09-08 17:29:27 +08:00
|
|
|
|
|
|
|
startTimer();
|
2011-09-08 03:52:52 +08:00
|
|
|
cc.detectMultiScale(img, res, 1.1, 3, 0, minSize);
|
2011-09-08 17:29:27 +08:00
|
|
|
stopTimer();
|
2011-09-08 03:52:52 +08:00
|
|
|
}
|
|
|
|
}
|