error: (-215) size,width>0 88 size,height>0 in function imshow
时间: 2023-10-18 18:25:20 浏览: 170
opencv显示 rtion failed) size.width>0 && size.height>0 in function ‘cv::imshow’的解决方案vscode
这个错误通常是因为在调用`cv2.imshow`函数时传入的图像变量的宽度或高度为零。这可能是由于截取图像后导致其中一个尺寸变为零的原因。解决这个问题的方法是在传给`cv2.imshow`之前对图像进行检查,确保它们的尺寸都大于零。你可以打印出截取图像的宽度和高度,检查是否有其中一个为零。如果是的话,你可以对图像进行处理,确保尺寸不为零,然后再传给`cv2.imshow`函数。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [OpenCV调用摄像头错误error: (-215) size.width>0 && size.height>0 in function cv::imshow的解决](https://blog.csdn.net/jjjjjjjjzzzz/article/details/127259206)[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_1"}}] [.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_1"}}] [.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_36262908/article/details/124775759)[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_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文