Created
December 5, 2019 04:18
-
-
Save mpkuse/de59f1ee691e562d1309126513e38822 to your computer and use it in GitHub Desktop.
OpenCV 3 Read Write FileStorage YAML Example
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
// | |
// OpenCV provides an easy class interface for read and write cv::Mat | |
// can also use these with Eigen by converting eigen mat to cv::Mat using | |
// cv::cv2eigen() and cv::eigen2cv() | |
// Writing to file | |
cv::FileStorage storage("test.yml", cv::FileStorage::WRITE); | |
storage << "img" << img; | |
storage.release(); | |
// Reading from file | |
cv::FileStorage storage("test.yml", cv::FileStorage::READ); | |
storage["img"] >> img; | |
storage.release(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment