Saturday, March 9, 2013

Reading and Writing cv::Mat in OpenCV in C++

In C++ api for OpenCV, you often come across writing and reading matrices as text files (analogous to saving .mat files in MATLAB/Octave). This is a simple way of doing it. You could even save multiple matrices in a single .xml/.yaml file. 
Note: You could write matrices using C++ and use Python API (which is very useful for Prototyping as development on Python is faster than C++ and many Machine Learning APIs are available for use).

However, I couldn't find ways to read more than 1 matrix which was written to file and being read using Python API. 

No comments:

Post a Comment