Writing Mat to FileStorage: is there a way to format the output?
I'd like to be able to read the output of FileStorage more easily, so is there a way to change the format? Something like, e.g., newlines on rows, tabs on columns.
Why would you like to do that?
I work with a lot of transform matrices, and I'd like to be able to quickly read them. Currently FileStorage puts newlines after a certain amount of characters, it seems like, but this makes it hard to see the rotation component, translation component, etc. I mean, I could just print it out to a file myself, but since I'm using FileStorage anyway,..
I suppose that FileStorage is doing so because OpenCV is for working on images and other type of data, like descriptors or machine learning files; so imagine a yml or xml containing 10 or 20 lines of more than 256 elements... IMHO FileStorage is ok for storing the Mat object, but if you want to see them, then you can read the file and print (
std::cout << mat << std::endl;
) the Mat so you can see it.Thanks! I ended up doing this, but to an ofstream instead.