python 显示RGB颜色

python 显示RGB颜色

import cv2
import numpy as np

if __name__ == '__main__':

    data=np.zeros((400,400,3),dtype=np.uint8)

    # data[:]=(104,148,92)
    data[:]=(0,0,255)
    cv2.imshow("aaa1",data)
    data=cv2.cvtColor(data,cv2.COLOR_BGR2RGB)
    cv2.imshow("aaa2",data)
    cv2.waitKey()

你可能感兴趣的:(python基础,python,opencv)