更新时间:2023-12-02 12:15:34
您可以读取文件并将每个值都推回float
数组,因此首先声明它:
You can read the file and push every value back to an array of float
, so first declare it:
vector<float> myDescriptorVector;
然后推送每个值:
ifstream infile ("yourFile.dat".c_str());
float number;
while (infile >> number)
myDescriptorVector.push_back(number);
return myDescriptorVector;
最后,对HOG使用标准初始化,然后将向量传递到SVM检测器,就像您已经猜到的那样:
Finally use the standard initialization for the HOG and pass the vector to the SVM detector as you already guessed:
hog.setSVMDetector(myDescriptorVector);