[opencv][原创]python opencv创建白色图像并画个框

import cv2
import os
import numpy as np

width = 500
height = 500
img = np.ones((width, height, 3), dtype=np.uint8)
img *= 255 # white background
cv2.rectangle(img, (20, 20), (150, 150), (255, 0, 0), 4)
cv2.imshow('result', img)
cv2.waitKey(0)

你可能感兴趣的:(Python,opencv,python,计算机视觉)