Python opencv 图像宽高参数

  • windows系统显示的顺序是 尺寸 = 宽 * 高
  • img.shape的顺序是 高 宽 通道数
img = cv2.imread("0.jpg")
imgInfo = img.shape
height = imgInfo[0]
width = imgInfo[1]
# height: 480
# width: 720
  • (高 宽)
Circle = np.zeros((height, width, 3), dtype="uint8")
cv2.circle(Circle, (150 + i*5, 150 + i*5), 150, (255, 255, 255), -1)
cv2.imwrite("1.jpg", Circle) 
  • (宽 高)
cv2.VideoWriter('1.mp4', -1, 1, (width, height))

2019.9.25

你可能感兴趣的:(Python opencv 图像宽高参数)