350: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow'
时间: 2023-10-18 11:27:05 浏览: 204
这个错误是由于在使用cv2.imshow函数时,传入的图像尺寸出现了问题。具体地说,图像的宽度和高度需要大于0才能正确显示。根据引用、和中的报错信息,你可以查看你的代码中是否正确读取了图片,并且确认图片的尺寸是否正确。如果图片的尺寸为0,那么你需要检查图片文件是否存在、路径是否正确,或者尝试使用其他图片进行测试。如果图片的尺寸不为0,那么你可能需要检查其他代码部分,如图像处理过程中是否存在异常,或者其他函数的调用是否正确。请仔细检查你的代码,并确保所有输入参数的正确性,以解决这个错误。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [出现 error: (-215:Assertion failed) size.width>0 && size.height>0 in function ‘cv::imshow‘ 的...](https://blog.csdn.net/weixin_47872288/article/details/126736861)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [opencv bug 处理](https://download.csdn.net/download/rechard_han/10562169)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [error: (-215:Assertion failed) size.width>0 && size.height>0 in function ‘cv::imshow](https://blog.csdn.net/qq_48740719/article/details/130046421)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文