Open Cv Error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

跟風遠走 提交于 2019-11-26 23:19:53

The error you're seeing is one that happens if None gets passed on cv2.cvtColor.

After

ret, img = cap.read()

it's a good idea to check that img is not None before proceeding. Depending on your input source, cap.read() can fail. One one my laptops, it fails at least once before starting to return valid images.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!