opencv/modules/gpu/perf_cpu/perf_objdetect.cpp

46 lines
1.0 KiB
C++
Raw Normal View History

2012-05-22 18:29:58 +08:00
#include "perf_cpu_precomp.hpp"
#ifdef HAVE_CUDA
GPU_PERF_TEST_1(HOG, cv::gpu::DeviceInfo)
{
2012-05-22 18:29:58 +08:00
cv::Mat img = readImage("gpu/hog/road.png", cv::IMREAD_GRAYSCALE);
std::vector<cv::Rect> found_locations;
2012-05-22 18:29:58 +08:00
cv::HOGDescriptor hog;
hog.setSVMDetector(cv::gpu::HOGDescriptor::getDefaultPeopleDetector());
TEST_CYCLE()
{
hog.detectMultiScale(img, found_locations);
}
}
INSTANTIATE_TEST_CASE_P(ObjDetect, HOG, ALL_DEVICES);
GPU_PERF_TEST_1(HaarClassifier, cv::gpu::DeviceInfo)
{
cv::Mat img = readImage("gpu/haarcascade/group_1_640x480_VGA.pgm", cv::IMREAD_GRAYSCALE);
cv::CascadeClassifier cascade;
if (!cascade.load("haarcascade_frontalface_alt.xml"))
CV_Error(0, "Can't load cascade");
std::vector<cv::Rect> rects;
rects.reserve(1000);
TEST_CYCLE()
{
cascade.detectMultiScale(img, rects);
}
}
INSTANTIATE_TEST_CASE_P(ObjDetect, HaarClassifier, ALL_DEVICES);
#endif