opencv storage 操作C++
读取
#include #include using namespace std; using namespace cv; void main() { //FileStorage fs("caliResult.xml",FileStorage::READ); FileStorage fs; fs.open("caliResult.xml",FileStorage::READ); if(!fs.isOpened()) { return; } int cameraId; Mat intrMatrix(3,3,CV_64F); Mat distCoeffs(5,1,CV_64F); fs["cameraId"]>>cameraId;//下面还有子节点,data 行列等信息,这个读取方式就不用一步一步的读取了 fs["intrinsic_parameters"]>>intrMatrix; fs["distortion_parametes"]>>distCoeffs; fs.release(); }