成功解决cv2.error: OpenCV(4.7.0) D:aopencv-pythonopencv-pythonopencvmodulesimgcodecssrcloadsave.

Posted MangekyoSasuke

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了成功解决cv2.error: OpenCV(4.7.0) D:aopencv-pythonopencv-pythonopencvmodulesimgcodecssrcloadsave.相关的知识,希望对你有一定的参考价值。

在运行MODNet的过程中,输入参数后遇到了以下问题:

error: OpenCV(4.7.0) D:\\a\\opencv-python\\opencv-python\\opencv\\modules\\imgcodecs\\src
\\loadsave.cpp:692: error: (-2:Unspecified error) could not find a writer for the 
specified extension in function 'cv::imwrite_'

导致此报错有两种原因:
一、路径问题
1.路径中不能存在中文
2.路径分隔用”\\“或”/“

二、输出问题
我的参数如下:

output应该写至输出图片名称

运行成功

以上是关于成功解决cv2.error: OpenCV(4.7.0) D:aopencv-pythonopencv-pythonopencvmodulesimgcodecssrcloadsave.的主要内容,如果未能解决你的问题,请参考以下文章

解决cv2.error:OpenCV(4.7.0)D:aopencv-pythonopencv-pythonopencvmoduleshighguisrcwindow.cpp.....

解决“cv2.error: OpenCV(3.4.2) C:projectsopencv-pythonopencvmoduleshighguisrcwindow.cpp:356:...”

cv2.error: OpenCV(4.2.0) /io/opencv/modules/imgproc/src/color.cpp:182: error:

cv2.error: OpenCV(4.5.2) .error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

opencv cv2.imread()报错: error: (-215:Assertion failed) !_src.empty() in function ‘cv::cvtColor‘

cv2.error: C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:325: 错误: (-215) size.widt