Refactored performance tests. TEST_CYCLE macro is renamed to TEST_CYCLE_N; SIMPLE_TEST_CYCLE is renamed to TEST_CYCLE; from now 100 iterations are default for performance tests
This commit is contained in:
@@ -4,26 +4,30 @@
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
using namespace perf;
|
||||
using std::tr1::make_tuple;
|
||||
using std::tr1::get;
|
||||
|
||||
typedef std::tr1::tuple<std::string, int> ImageName_MinSize_t;
|
||||
typedef perf::TestBaseWithParam<ImageName_MinSize_t> ImageName_MinSize;
|
||||
|
||||
PERF_TEST_P( ImageName_MinSize, CascadeClassifierLBPFrontalFace,
|
||||
testing::Combine(testing::Values( std::string("cv/shared/lena.jpg"),
|
||||
std::string("cv/shared/1_itseez-0000247.jpg"),
|
||||
std::string("cv/shared/1_itseez-0000289.jpg"),
|
||||
std::string("cv/shared/1_itseez-0000492.jpg"),
|
||||
std::string("cv/shared/1_itseez-0000573.jpg"),
|
||||
std::string("cv/shared/1_itseez-0000803.jpg"),
|
||||
std::string("cv/shared/1_itseez-0000892.jpg"),
|
||||
std::string("cv/shared/1_itseez-0000984.jpg"),
|
||||
std::string("cv/shared/1_itseez-0001238.jpg"),
|
||||
std::string("cv/shared/1_itseez-0001438.jpg"),
|
||||
std::string("cv/shared/1_itseez-0002524.jpg")),
|
||||
testing::Values(24, 30, 40, 50, 60, 70, 80, 90) ) )
|
||||
PERF_TEST_P(ImageName_MinSize, CascadeClassifierLBPFrontalFace,
|
||||
testing::Combine(testing::Values( std::string("cv/shared/lena.jpg"),
|
||||
std::string("cv/shared/1_itseez-0000247.jpg"),
|
||||
std::string("cv/shared/1_itseez-0000289.jpg"),
|
||||
std::string("cv/shared/1_itseez-0000492.jpg"),
|
||||
std::string("cv/shared/1_itseez-0000573.jpg"),
|
||||
std::string("cv/shared/1_itseez-0000803.jpg"),
|
||||
std::string("cv/shared/1_itseez-0000892.jpg"),
|
||||
std::string("cv/shared/1_itseez-0000984.jpg"),
|
||||
std::string("cv/shared/1_itseez-0001238.jpg"),
|
||||
std::string("cv/shared/1_itseez-0001438.jpg"),
|
||||
std::string("cv/shared/1_itseez-0002524.jpg")),
|
||||
testing::Values(24, 30, 40, 50, 60, 70, 80, 90)
|
||||
)
|
||||
)
|
||||
{
|
||||
const string filename = std::tr1::get<0>(GetParam());
|
||||
int min_size = std::tr1::get<1>(GetParam());
|
||||
const string filename = get<0>(GetParam());
|
||||
int min_size = get<1>(GetParam());
|
||||
Size minSize(min_size, min_size);
|
||||
|
||||
CascadeClassifier cc(getDataPath("cv/cascadeandhog/cascades/lbpcascade_frontalface.xml"));
|
||||
@@ -36,15 +40,14 @@ PERF_TEST_P( ImageName_MinSize, CascadeClassifierLBPFrontalFace,
|
||||
|
||||
vector<Rect> res;
|
||||
|
||||
|
||||
declare.in(img);//.out(res)
|
||||
equalizeHist(img, img);
|
||||
declare.in(img);
|
||||
|
||||
while(next())
|
||||
{
|
||||
res.clear();
|
||||
|
||||
startTimer();
|
||||
equalizeHist(img, img);
|
||||
cc.detectMultiScale(img, res, 1.1, 3, 0, minSize);
|
||||
stopTimer();
|
||||
}
|
||||
|
Reference in New Issue
Block a user