Getting error while saving through Filestorage using opencv
I am trying to save the vocabulary from the BOW algorithm , below is my code
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" );
Here is my error :
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
hey fly, it's a key - value store here.
fs << "Vocabulary" << vocabulary ;
fs2 ["Vocabulary"] >> vocabulary ;