opencv xml 文件的读写:

参考网址:https://blog.csdn.net/u013752202/article/details/50224049

	//写数据
	//Mat src = (Mat_<double>(3, 3) << 1, 2, 3, 4, 5, 6, 7, 8, 9);
	double src = 10;
	FileStorage fswrite("test.xml", FileStorage::WRITE);
	fswrite << "src1" << src;
    fswrite.release();
	cout << "Write Finished" << endl;
	// 读数据 
	FileStorage fsread("test.xml", FileStorage::READ);
	//Mat dst;
	double dst;
	fsread["src1"] >> dst;
	cout << dst << endl;
	fsread.release();
	cout << "Read Finished" << endl;

结果:

 

猜你喜欢

转载自blog.csdn.net/SenPaul/article/details/82841006
今日推荐