Traceback (most recent call last):
File "/Users/*******/*****.py", line 225, in <module>
cv2.imshow(r_image)
TypeError: Required argument 'mat' (pos 2) not found
这个错误提示意思是:没有找到要求的参数,即代码里的函数缺少必要的参数。
cv2.imshow()
这里面应该有两个参数:一个是图像窗口的名字即title,一个是所展示图片的像素值矩阵。
此外,矩阵的数据类型是np.uint8,浮点数类型会有显示异常情况。
会报错:
TypeError: img is not a numpy array, neither a scalar
解决办法:
转化一下数据类型
image = numpy.array(image)