AI智能
改变未来

ubuntu的Traceback :cv2.error: OpenCV(4.1.2)Assertion failed) in function cvtColor


Traceback :cv2.error: OpenCV(4.1.2): (-215:Assertion failed) !_src.empty() in function ‘cvtColor’

运行图/视频处理、目标检测识别的时候,如果报这个类似的错误:
File “darknet_video.py”, line 115, in YOLO()
File “darknet_video.py”, line 97, in YOLO
frame_rgb = cv2.cvtColor(frame_read, cv2.COLOR_BGR2RGB)
cv2.error: OpenCV(4.1.2) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function ‘cvtColor’
原因就是:读取视频的

地址不对


解决方法:

去原程序修改对应的视频存放路径即可

赞(0) 打赏
未经允许不得转载:爱站程序员基地 » ubuntu的Traceback :cv2.error: OpenCV(4.1.2)Assertion failed) in function cvtColor