hi all ,
Of offers an easy way to save an ofxMatrix4x4 in a file.
ofFile fileWrite(filename,ofFile::WriteOnly); fileWrite << homographyMat;
this will dump the data of the matrix in a file, as comma and new line separated values.
This is fine, until you want to save anothe variable in the file and want to maintain some sanity when reading the file; ideally I’d like to save a name with each variable. The “FileStorage” class seems to nicely close the above matrix values in square brackets and prepend a variable name too.
Unfortunately that works with cv::Mat only and I have ofxMatrix4x4 for my homography matrix.
I could use the ofxXmlSettings functionality but this will be an overkill for just 2 variables (a matrix and 4 points).
Is there an easy way to save an ofxMatrix4x4 to a file? or must I implement my own toCv(ofxMatrix4x4&) convertor ?