cv2.error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:971: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'
时间: 2023-08-16 13:11:39 浏览: 1096
opencv-python-4.10.0.84.tar.gz
5星 · 资源好评率100%
回答: 这个错误是由于OpenCV的imshow函数在显示图像时出现了断言错误。具体来说,断言失败的条件是图像的宽度和高度必须大于0。\[1\]类似的错误还有报错1和在运行MODNet时遇到的问题,都是由于无法找到指定扩展名的写入器。\[2\]\[3\]这些错误通常是由于图像文件的格式不受支持或者缺少相应的编解码器所致。要解决这个问题,可以尝试使用支持的图像格式,或者检查是否安装了正确的编解码器。
#### 引用[.reference_title]
- *1* [opencv运行中遇到问题](https://blog.csdn.net/m0_53126906/article/details/126230834)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [多方面解析error D:\a\opencv-python\opencv-python\opencv\modules\imgcodecs\src \loadsave.cpp:692](https://blog.csdn.net/Ke_zs/article/details/128736115)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [成功解决cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\imgcodecs\src\load...](https://blog.csdn.net/qq_52381360/article/details/129168524)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文