1、画线
代码:
import numpy as np
import cv2
img=np.zeros((512,512,3),np.uint8)
cv2.line(img,(0,0),(511,511),(255,0,0),5)
cv2.imshow('image',img)
cv2.waitKey(0)
zeros-构造全0矩阵;
函数原型:zeros(shape,dtype=None,order='C')
shape:矩阵大小;例如:300*300;
dtype:数据类型;order: