Ask Your Question

Revision history [back]

Problem with imread function

Hello, I start with opencv with python and I do not suceed to load an image with the imread function. I try with the filename, with the path of the image, with \,\,/ in the path but nothing works. I have alwars error like :

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 12-13: truncated \UXXXXXXXX escape

or

Traceback (most recent call last): File "D:\Users\Rémy\Desktop\tipe\rec forme.py", line 7, in <module> gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) cv2.error: OpenCV(3.4.3) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:181: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

Someone can help me please ? Thanks (Sorry for my bad english)