Last active
August 29, 2015 14:01
-
-
Save denkiwakame/88dcb6838b95225c8854 to your computer and use it in GitHub Desktop.
OpenCV x XML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// filio::output | |
system("mkdir data"); | |
cv::FileStorage cvfs("./data/camera.xml", CV_STORAGE_WRITE); | |
cv::write(cvfs,"intrinsicMat", intrinsic_param_matrix); | |
cv::write(cvfs,"distCoeffs", distortion_coeffs); | |
// fileio::input | |
cv::FileStorage cvfs("./data/camera.xml", CV_STORAGE_READ); | |
cv::FileNode node(cvfs.fs, NULL); | |
cv::Mat in_mat, dist_coeff; | |
cv::read(node["intrinsicMat"], in_mat); | |
cv::read(node["distCoeffs"], dist_coeff); | |
std::cerr << ma << std::endl; | |
std::cerr << mb << std::endl; | |
cv::Mat ma, mb; | |
cvfs["intrinsicMat"] >> ma; | |
cvfs["distCoeffs"] >> mb; // OK | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment