简体   繁体   中英

OpenCV: Reading a YAML file into a CvMat structure

Using OpenCV, saving a CvMat structure into a YAML file on the disk is easy with

CvMat* my_matrix = cvCreateMat( row_no, col_no, CV_32FC1 ); 
cvSave("filename.yml", my_matrix);

However, I couldn't find an easy way to read the saved files back from the disk. Is there function in OpenCV that can handle this and create a CvMat structure from a YAML file?

CvMat* my_matrix;
my_matrix = (CvMat*)cvLoad("filename.yml");

seems to do the trick!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM