Opencv HOG特征检测

HOGDescriptor hogDescriptor = HOGDescriptor();
hogDescriptor.setSVMDetector(hogDescriptor.getDefaultPeopleDetector());

vector<Rect> vec_rect;
hogDescriptor.detectMultiScale(img1, vec_rect, 0, Size(4, 4), Size(64, 64), 1.05, 2);
for (size_t t=0;t<vec_rect.size();t++)
{
Scalar color_1 = Scalar(rng1.uniform(0,255), rng1.uniform(0, 255), rng1.uniform(0, 255));
rectangle(img2, vec_rect[t], color_1, 2, 8, 0);
}

 

posted @ 2018-10-05 09:50  西北逍遥  阅读(612)  评论(0编辑  收藏  举报