OpenCV 2.4-读取svm模型在3.1中训练

时间:2017-03-06 20:33:07

标签: c++ opencv yaml

我在OpenCV3.1中训练了一个svm模型并以yaml格式保存。 我试图在OpenCV 2.4中读取这个.yml文件,但它无法解析文件(例如,svmType实际上是OpenCV2.4中的svm_type)。如何将模型文件转换为OpenCV 2.4 .yml格式?

.yml文件是:

%YAML:1.0
opencv_ml_svm:
   format: 3
   svmType: C_SVC
   kernel:
      type: RBF
      gamma: 5.0625000000000009e-001
   C: 3.1250000000000000e+002
   term_criteria: { iterations:100 }
   var_count: 3000
   class_count: 33
   class_labels: !!opencv-matrix
      rows: 33
      cols: 1
      dt: i
      data: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
          18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 ]
   sv_total: 660
   support_vectors:

感谢。

0 个答案:

没有答案