报错:cv2.error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function ‘imshow’
查看opencv版本
pip show opencv-python
更改opencv的版本到4.5.1.48
pip install opencv-python==4.5.1.48 -i https://pypi.douban.com/simple
报错:TypeError: imshow() missing required argument ‘mat’ (pos 2)
原因是imshow()缺少一个参数,cv2.imshow()函数需要两个输入,一个是图像窗口的名字即title,一个是所展示图片的像素值矩阵
cv2.imshow(ycrcb_image) #wrong
cv2.imshow(‘ycrcb_image’, ycrcb_image) #true
cv2.imshow()闪退
在后面加上
cv2.waitKey()
文章出处登录后可见!
已经登录?立即刷新