C++使用OpenCV保存和读取XML
代码
// save xml file cv::FileStorage file(save_transform, cv::FileStorage::WRITE); cv::Mat TransM = cv::Mat::ones(100,200,CV_8UC1); file << "TransM" << TransM; // read xml file cv::FileStorage file("xml_file_path", cv::FileStorage::READ); if (!file.isOpened()) return std::vector<cv::Mat>(); cv::Mat TransM; file["TransM"] >> TransM;
注意
xml中保存的节点超过4个就会打开失败,opencv的问题。