运行报错error: (-215:Assertion failed) !ssize.empty() in function ‘cv::resize‘
时间: 2023-10-10 07:06:44 浏览: 154
在车牌检测识别过程中,遇到报错"error: (-215:Assertion failed) !ssize.empty() in function ‘cv::resize‘"。这个错误是由于在调用cv2.resize函数时,输入图像尺寸为空所引起的。根据引用和引用的内容,可以确定这个错误是由于图像的尺寸大小不合适导致的。为了解决这个问题,可以根据引用中提供的修改后的代码进行调整。在代码中,通过对图像尺寸进行判断,如果图像高度大于36像素,则将图像尺寸调整为(136, 36 * 2),否则将图像尺寸调整为(136, 36)。这样可以确保输入图像的尺寸不为空,避免了报错。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [cpp:3720: error: (-215:Assertion failed) !ssize.empty() in function 'resize' 错误解决](https://blog.csdn.net/WellTung_666/article/details/105551802)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* [error: (-215:Assertion ...ssize.empty() in function ‘cv::resize‘ 或者(ssize.width > 0 && ssize.h](https://blog.csdn.net/m0_70240540/article/details/129665366)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文