2011-09-12 15:48:09 +08:00
|
|
|
#include "perf_precomp.hpp"
|
|
|
|
|
2011-12-28 20:53:08 +08:00
|
|
|
#ifdef HAVE_CUDA
|
|
|
|
|
|
|
|
GPU_PERF_TEST_1(HOG, cv::gpu::DeviceInfo)
|
2011-09-12 15:48:09 +08:00
|
|
|
{
|
2011-12-28 20:53:08 +08:00
|
|
|
cv::gpu::DeviceInfo devInfo = GetParam();
|
2011-09-12 15:48:09 +08:00
|
|
|
|
2011-12-28 20:53:08 +08:00
|
|
|
cv::gpu::setDevice(devInfo.deviceID());
|
2011-09-12 15:48:09 +08:00
|
|
|
|
2011-12-28 20:53:08 +08:00
|
|
|
cv::Mat img_host = readImage("gpu/hog/road.png", cv::IMREAD_GRAYSCALE);
|
2011-09-12 15:48:09 +08:00
|
|
|
|
2011-12-28 20:53:08 +08:00
|
|
|
cv::gpu::GpuMat img(img_host);
|
|
|
|
std::vector<cv::Rect> found_locations;
|
2011-09-12 15:48:09 +08:00
|
|
|
|
2011-12-28 20:53:08 +08:00
|
|
|
cv::gpu::HOGDescriptor hog;
|
|
|
|
hog.setSVMDetector(cv::gpu::HOGDescriptor::getDefaultPeopleDetector());
|
2011-09-12 15:48:09 +08:00
|
|
|
|
2011-12-30 00:46:16 +08:00
|
|
|
TEST_CYCLE()
|
2011-09-12 15:48:09 +08:00
|
|
|
{
|
|
|
|
hog.detectMultiScale(img, found_locations);
|
|
|
|
}
|
|
|
|
}
|
2011-12-28 20:53:08 +08:00
|
|
|
|
|
|
|
INSTANTIATE_TEST_CASE_P(ObjDetect, HOG, ALL_DEVICES);
|
|
|
|
|
|
|
|
#endif
|