用OpenCV画几何图形. import numpy as np import cv2 # Create a black image img = np.zeros((521,512,3), np.uint8) # Draw a diagonal blue line with thickness of 5 px # 背景数据,直线起点,直线终点,颜色,线条粗细 img = cv2.line(img,(0,0),(511,511),(255,0,0),5) # print(img) # Drawin…