Save Xml file directory problem. Openframeworks and fileStorage [closed]
Hello,
I'm working on an OpenFrameworks app, where I am using the OpenCV addon (ofxOpenCV). The problem occurs when I try to save the ANN parameters on a xml file. The xml does not appear on the entire system. I try another version with a simple matrix and the result is the same.
I am using Xcode (C++). OpenCV version : 3.4.1.
I try the following code and return the weights (one of the ANN parameters) so, maybe somewhere there is the xml file...
FileStorage fs;
fs.open("mlp.xml", FileStorage::WRITE);
ann[0]->write(fs);
fs.release();
FileStorage opencv_file("mlp.xml", FileStorage::READ);
Ptr<ANN_MLP> nn = ANN_MLP::create();
nn->read(opencv_file.root());
cout << nn->getWeights(0) <<endl; //RETURN THE WEIGHTS
opencv_file.release();
I also try to read by fileNode and the output matrix is empty.
The idea is to load/save (write/read) different xml files (or other types of files) to set different ANN parameters.
Any idea?
Thank you! Ignasi.
OpenCV version : 2.4.9. -- ouch.
please check again. above code would require opencv 3.x
maybe you also should check
fs.isOpened()
trying with an absolute path would be another idea.
Sorry, version edited (3.4.1). I also check if it is opened and it is ok.
Absolute path (but inside the project folder). Thank you! Thank you! Thank you! and Thank you!