Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How do I load an OpenCV generated yaml file in python?

It appears that OpenCV is writing yaml 1.0 but PyYaml only wants to read yaml 1.1 (http://pyyaml.org/#Whatimplementationshouldyouuse and http://stackoverflow.com/questions/12058510/xml-or-yml-parsing-in-opencv-with-python). Do I just need a script to reformat the yaml so it doesn't generate errors like expected alphabetic or numeric character, but found ':' on the first line %YAML:1.0, or is there a better way to go about loading the files?

I've tried cv2.cv.load(filename) but it generates and error about not finding xml tags (opencv 2.4.6 and whatever python-opencv bindings are provided in Ubuntu 13.10).