3/04/2014

(OpenCV Study) xml write & read, example source code.

This is very simple example source code for write and read xml file.
OpenCV version will be no matter.
I hope helpful to you.
Thank you.



//Write example
FileStorage xmlW("A.xml", FileStorage::WRITE);
Mat A(3,3, CV_32F);
setIdentity(A);
xmlW << "A" << A;
xmlW.release();

//read example
FileStorage xmlR;
xmlR.open("A.xml", FileStorage::READ);
Mat B;
xmlR["A"] >> B;
cout << B << endl;
xmlR.release();

No comments:

Post a Comment