简体   繁体   English

HoG + SVM - > HOGDescriptor :: setsvmdetector

[英]HoG+SVM -> HOGDescriptor::setsvmdetector

I want to feed the HOGDescriptor (CPU interface) with a trained SVM. 我想用经过训练的SVM提供HOGDescriptor (CPU接口)。 The HOG Descriptor offers a method setSVMDetector(const vector<float>& detector) and I'm asking what has to be in vector<float>& detector ? HOG描述符提供了一个方法setSVMDetector(const vector<float>& detector) ,我想知道vector<float>& detector什么?

I have a trained SVM which can create a xml file. 我有一个训练有素的SVM,可以创建一个xml文件。 I want to use hog.setSVMdetector(const vector<float>& detector) for the custom dataset. 我想对自定义数据集使用hog.setSVMdetector(const vector<float>& detector) How to use this function for our own data? 如何将此功能用于我们自己的数据? Kindly anyone suggest the solution. 请有人建议解决方案。

I am using MS VS to execute the code. 我正在使用MS VS来执行代码。

This detector (or a set of coefficients) has to be computed from your trained model (XML file). 必须根据训练的模型(XML文件)计算此检测器(或一组系数 )。 This XML file contains all the information about your model/classifier (most importantly support vectors ). 此XML文件包含有关模型/分类器的所有信息(最重要的是支持向量 )。 These coefficients are computed from the support vectors. 这些系数是从支持向量计算的。 If you are using OpenCV SVM, then you can use this code (check the answer) for computing detector which you can directly use to customize your HOG detector. 如果您使用的是OpenCV SVM,那么您可以使用此代码 (检查答案)来计算探测器 ,您可以直接使用它来自定义HOG探测器。

Few things to note: in their answer, they are calling detector (or set of coefficients) as support_vector . 很少有事情需要注意:在他们的回答中,他们将探测器(或系数集)称为support_vector But they are the same thing. 但他们是一回事。 Also, use your class labels as +1 (positive) and -1 (negative). 另外,使用您的班级标签为+1(正面)和-1面(负面)。 Otherwise you might get incorrect detections. 否则您可能会得到错误的检测。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM