#include<iostream>
#include<opencv2/highgui.hpp>
#include<opencv2/core/core.hpp>
using namespace cv;
using namespace std;
int main(int argc,char**argv)
{
// 写yaml文件;
FileStorage fs("/home/finer/test.yaml",FileStorage::WRITE);
int num1,num2;
num1=3,num2=4;
fs<<"num1"<<num1;
fs<<"num2"<<num2;
Mat A(4,5,CV_32FC2,Scalar(10,5));
fs<<"A"<<A;
fs.release();
// 读yaml文件;
FileStorage fs2("/home/finer/test.yaml",FileStorage::READ);
if (fs2.isOpened())
{
cout<<"file is open!"<<endl;
}
else
return -1;
int d = fs2["num1"];
cout<<d<<endl;
fs2.release();
return 0;
}