源代码
import cv2 import numpy as ny img = ny.zeros( ( 3 , 3 )) img=cv2.cvtColor(img,cv2.COLOR_BGR2RGB) print(img)
opencv只支持float32的图像显示和操作,然后float64是numpy的数据类型,opencv中不支持。
改为
import cv2 import numpy as ny img = ny.zeros( ( 3 , 3 ),ny.float32) img=cv2.cvtColor(img,cv2.COLOR_BGR2RGB) print(img)