使用 opencv 通过文件存储保存时出错
Getting error while saving through Filestorage using opencv
我正在尝试从 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:opencv2.4.4buildincludeopencv2coreoperations.hpp , line 2908
您没有在文件中设置词汇名称,请尝试以下操作:
fs << "Vocabulary" << vocabulary ;
相关文章:
- 在全局变量中保存类的实例以重新创建类(创建"backup")
- 如何在选项卡视图Qt中设置一个新项目,并保存以前的项目
- 访问者访问变体并返回不同类型时出错
- 在Linux for Windows上编译C++代码时出错
- 读取文件的最后一行并输入到链接列表时出错
- 重载操作程序时出错>>用于类中的字符串 memebr
- 如何使用OpenCV将RBG图像转换为HSV,并将H、S和V值保存为C++中的3个独立图像
- 调用专用模板时出错"no matching function for call to [...]"
- C++-试图将函数指针推回到另一个CPP文件中的矢量时出错
- LINK 尝试使用 OpenSSL evp aes 256 c++ 时出错
- 在Google Kick start中提交时出错
- 在c++中访问int到类对象的映射时出错
- 使用提升库在队列和堆栈数据结构上保存和加载数据时出错
- 尝试使用 ostream 保存文件内容时出错
- 在Ubuntu中使用VideOwriter(OpenCV)保存视频作为MP4时出错
- 保存/加载C++数据时出错
- 使用 Stream 保存到文件的 C++ 时出错
- 使用 OpenCV 保存 .pgm 图像时出错
- 使用 opencv 通过文件存储保存时出错
- 我怎样才能在不出错的情况下保存一个unsigned long