OpenCV GPU Module Example (Use HOG,Release 2.3)Not use GPU Module:
Mat frame;
VideoCapture capture(camera);
cv::HOGDescriptor hog;
hog.setSVMDetector(cv::HOGDescriptor::
getDefaultPeopleDetectorector());
capture >> frame;
vector<Rect> found;
hog.detectMultiScale(frame, found,
1.4, Size(16, 16), Size(0, 0), 1.05, 16);
Use GPU Module:
Mat frame;
VideoCapture capture(camera);
cv::gpu::HOGDescriptor hog;
hog.setSVMDetector(cv::HOGDescriptor::
getDefaultPeopleDetectorector());
capture >> frame;
GpuMat gpu_frame;
gpu_frame.upload(frame);
vector<Rect> found;
hog.detectMultiScale(gpu_frame, found,
1.4, Size(16, 16), Size(0, 0), 1.05,16);
https://blog.sciencenet.cn/blog-297739-580754.html
上一篇:
敏捷十二条下一篇:
VC环境下OpenGL多视图窗口的实现