opencv/modules/gpu/perf/perf_objdetect.cpp

28 lines
621 B
C++
Raw Normal View History

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