Ask Your Question
0

Getting error while saving through Filestorage using opencv

asked 2013-10-01 13:55:54 -0600

FLY gravatar image

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
edit retag flag offensive close merge delete

Comments

1

hey fly, it's a key - value store here.

fs << "Vocabulary" << vocabulary ;

fs2 ["Vocabulary"] >> vocabulary ;

berak gravatar imageberak ( 2013-10-01 14:42:00 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-10-01 15:03:23 -0600

FLY gravatar image

@berak hello berak , finally i am accepting your answer on first attempt :) , it works

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-10-01 13:55:54 -0600

Seen: 1,221 times

Last updated: Oct 01 '13