could not find a writer for the specified extension in function 'imwrite_'

cv2.error: OpenCV(3.4.5) /io/opencv/modules/imgcodecs/src/loadsave.cpp:687: error: (-2:Unspecified error) could not find a writer for the specified extension in function 'imwrite_'
 

原文链接:

https://blog.csdn.net/CPZ742954007/article/details/81258413

 

      在opencv学习中,使用cv.imwrite('filename', img)保存照片文件到本地,有时使用失误可能会出现报错,error: (-2) could not find a writer for the specified extension in function cv::imwrite_
     代码里出现这个错误可能是因为‘filename’只写了文件名字,忘记加扩展名,应加上.jpg或.png等照片扩展名。
 

你可能感兴趣的:(python人工智障)