refactoring the test as it should be in 2.4
This commit is contained in:
parent
4d28e8243c
commit
a7821c60e5
@ -105,31 +105,45 @@ PERF_TEST_P( Cascade_Image_MinSize, CascadeClassifier_UMat,
|
|||||||
const string imagePath = get<1>(GetParam());
|
const string imagePath = get<1>(GetParam());
|
||||||
const int min_size = get<2>(GetParam());
|
const int min_size = get<2>(GetParam());
|
||||||
Size minSize(min_size, min_size);
|
Size minSize(min_size, min_size);
|
||||||
|
|
||||||
ocl::OclCascadeClassifier cc;
|
|
||||||
if (!cc.load( getDataPath(cascasePath) ))
|
|
||||||
FAIL() << "Can't load cascade file: " << getDataPath(cascasePath);
|
|
||||||
|
|
||||||
Mat img = imread(getDataPath(imagePath), IMREAD_GRAYSCALE);
|
|
||||||
if (img.empty())
|
|
||||||
FAIL() << "Can't load source image: " << getDataPath(imagePath);
|
|
||||||
|
|
||||||
vector<Rect> faces;
|
vector<Rect> faces;
|
||||||
|
|
||||||
|
Mat img = imread(getDataPath(imagePath), IMREAD_GRAYSCALE);
|
||||||
|
ASSERT_TRUE(!img.empty()) << "Can't load source image: " << getDataPath(imagePath);
|
||||||
equalizeHist(img, img);
|
equalizeHist(img, img);
|
||||||
declare.in(img).time(60);
|
declare.in(img);
|
||||||
|
|
||||||
ocl::oclMat uimg(img);
|
if (RUN_PLAIN_IMPL)
|
||||||
|
|
||||||
while(next())
|
|
||||||
{
|
{
|
||||||
faces.clear();
|
CascadeClassifier cc;
|
||||||
|
ASSERT_TRUE(cc.load(getDataPath(cascasePath))) << "Can't load cascade file: " << getDataPath(cascasePath);
|
||||||
|
|
||||||
startTimer();
|
while (next())
|
||||||
cc.detectMultiScale(uimg, faces, 1.1, 3, 0, minSize);
|
{
|
||||||
stopTimer();
|
faces.clear();
|
||||||
|
|
||||||
|
startTimer();
|
||||||
|
cc.detectMultiScale(img, faces, 1.1, 3, 0, minSize);
|
||||||
|
stopTimer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else if (RUN_OCL_IMPL)
|
||||||
|
{
|
||||||
|
ocl::oclMat uimg(img);
|
||||||
|
ocl::OclCascadeClassifier cc;
|
||||||
|
ASSERT_TRUE(cc.load(getDataPath(cascasePath))) << "Can't load cascade file: " << getDataPath(cascasePath);
|
||||||
|
|
||||||
//sort(faces.begin(), faces.end(), comparators::RectLess());
|
while (next())
|
||||||
SANITY_CHECK_NOTHING();//(faces, min_size/5);
|
{
|
||||||
|
faces.clear();
|
||||||
|
|
||||||
|
startTimer();
|
||||||
|
cc.detectMultiScale(uimg, faces, 1.1, 3, 0, minSize);
|
||||||
|
stopTimer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
OCL_PERF_ELSE
|
||||||
|
|
||||||
|
//sort(faces.begin(), faces.end(), comparators::RectLess());
|
||||||
|
SANITY_CHECK_NOTHING();//(faces, min_size/5);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user