‘numpy.ndarray‘ object has no attribute ‘mode‘报错的解决

‘numpy.ndarray’ object has no attribute 'mode’报错的解决

使用ImageEhance.Brightness(img)的时候报错了
原因:读取图片使用了cv2.imread()
实际因该使用PIL.Image读取图片
当然也可以使用Image.fromarray(cv2.cvtColor(img,cv2.BGR2RGB))转化为PIL.Image对象
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_20252251/article/details/107782170
今日推荐