在openCV中,使用HOGDescriptor的setSVMDetector功能和输入数组

时间:2014-12-05 02:02:51

标签: android opencv opencv4android

我在OpenCV4Android中使用HOGDescriptor.setSVMDetector功能时遇到了一些问题。

Android需要为HOGDescriptor.setSVMDetector()方法传递Mat()。请注意,这与C ++规范不同,后者将函数声明为setSVMDetector(const vector<float>& detector)。问题是如何输入线性SVM模型 - 也就是说,如何将浮点值数组转换为OpenCV4Android Mat,以便HOGDescriptor对象接受它作为setSVMDetector方法的输入?

我试过分析HOGDescriptor.getDefaultPeopleDetector()的输出。这为Mat提供了3781行,1列和CV_32F类型。在重新创建此项时,以及在尝试任何变化时(例如换位,1x1 Mat与单个数组条目等),输出为:

error: checkDetectorSize() in function virtual void cv::HOGDescriptor::setSVMDetector(cv::InputArray)

如何在Android中以这种方式设置SVM探测器的建议将非常受欢迎!

0 个答案:

没有答案