【问题标题】:Getting error while saving through Filestorage using opencv使用opencv通过Filestorage保存时出错
【发布时间】:2013-10-08 01:19:46
【问题描述】:

我正在尝试从 BOW 算法中保存词汇表。下面是我的代码。

FileStorage fs; 
fs.open("Vocabulary.xml", FileStorage::WRITE); 
Mat vocabulary = bow.cluster(); 
fs << vocabulary ;
fs.release();
FileStorage fs2; 
fs2.open("Vocabulary.xml", FileStorage::READ); 
fs2 ["Vocabulary"] >> vocabulary ;
dextract.setVocabulary(vocabulary);

cv::Mat training_mat(num_img , dictionarySize,CV_32FC1);
cv::Mat labels(num_img,1,CV_32FC1);

CvSVM svm;
svm.load( "trainsvm.xml" );

这是我的错误:

OpenCV Error: Unspecified error (No element name has been given) in unknown function , file c:\opencv\2.4.4\build\include\opencv2\core\operations.hpp , line 2908

【问题讨论】:

    标签: c++ opencv image-processing computer-vision svm


    【解决方案1】:

    您没有在文件中设置词汇的名称,试试这个:

    fs << "Vocabulary" << vocabulary ;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-03-28
      • 1970-01-01
      • 1970-01-01
      • 2014-07-03
      • 2012-06-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多