Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

python code in tutorial "file input and output using xml and yaml files"

Hello, I am new to openCV. I'm following the tutorials "File Input and Output using XML and YAML files " (https://docs.opencv.org/master/dd/d74/tutorial_file_input_output_with_xml_yml.html). I encountered a problem when i execute the python code there. I cannot get the same result as the tutorial,

#

Traceback (most recent call last): File "file_input_output.py", line 156, in <module> main(sys.argv) File "file_input_output.py", line 78, in main s.write('image1.jpg','Awesomeness') cv2.error: OpenCV(4.3.0-pre) /home/ehuman/working_cv/opencv-master/modules/core/src/persistence_yml.cpp:251: error: (-5:Bad argument) Key names may only contain alphanumeric characters [a-zA-Z0-9], '-', '_' and ' ' in function 'writeScalar'

#

It seems that the python binding here doesnot work well, could anybody help me explain the reason?

click to hide/show revision 2
None

updated 2020-04-09 02:45:52 -0600

berak gravatar image

python code in tutorial "file input and output using xml and yaml files"

Hello, I am new to openCV. I'm following the tutorials "File Input and Output using XML and YAML files " (https://docs.opencv.org/master/dd/d74/tutorial_file_input_output_with_xml_yml.html). ".

I encountered a problem when i execute the python code there. I cannot get the same result as the tutorial,

#

########################################################
Traceback (most recent call last):
File "file_input_output.py", line 156, in <module>
main(sys.argv)
File "file_input_output.py", line 78, in main
s.write('image1.jpg','Awesomeness')
cv2.error: OpenCV(4.3.0-pre) /home/ehuman/working_cv/opencv-master/modules/core/src/persistence_yml.cpp:251: error: (-5:Bad argument) Key names may only contain alphanumeric characters [a-zA-Z0-9], '-', '_' and ' ' in function 'writeScalar'

#
'writeScalar' ############################################################

It seems that the python binding here doesnot does not work well, could anybody help me explain the reason?