opencv报错src.empty() in function cvtColor
opencv
OpenCV: 开源计算机视觉库
项目地址:https://gitcode.com/gh_mirrors/opencv31/opencv

·
error: (-215:Assertion failed) !ssize.empty() in function ‘resize‘
有报错:
cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function ‘cv::cvtColor’
1.问题原因:
(1)图片路径正确,且不含中文,但是图片路径不是全路径
(2)图片路径不对,没有找到图片
(3)图片路径中含有中文,函数报错
2.解决方案:
逐步检查
(1)文件路径是否正确
(2)是否是绝对路径(全路径)
(3)文件名中是否含有中文
(4)全路径中为\\
或/
如果还没有办法解决,更详细的步骤参考!empty() in function ‘cv::CascadeClassifier‘
错误不同,但解决方法类似。




OpenCV: 开源计算机视觉库
最近提交(Master分支:12 天前 )
89e767b0
objdetect: enable setEpsY() for QRDetectMulti 17 小时前
cb659575
stitching: enable loop unrolling in fast.cpp to improve ARM64 performance #27642
### Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- This PR introduces an ARM64-specific performance optimization in the FAST_t function by applying loop unrolling.
- The optimization is guarded with #if defined(_M_ARM64) to ensure it only affects ARM64 builds.
- This optimizations lead to performance improvements in stitching module functions.
**Performance Improvements:**
- This change significantly improved the performance on Windows ARM64 targets.
<img width="935" height="579" alt="image" src="https://github.com/user-attachments/assets/a03833d1-ac9b-408f-916b-243fd6ae2d53" />
19 小时前
更多推荐
所有评论(0)