import numpy as np import cv2 img = np.ones((512, 512, 3), np.uint8)*255 # 画椭圆 # 图片 (圆心) (短轴长,长轴长),旋转角度,旋转角度,开口大小角度,(颜色),(线条粗细,-1为实心) cv2.ellipse(img, (255, 100), (65, 65), 125, 0, 290, (0, 0, 255), -1) cv2.circle(img, (255, 100), 30, (255, 255, 255), -1) cv2.ellipse(img, (180, 220), (65, 65), 16, 0, 290, (0, 255,0 ), -1) cv2.circle(img, (180, 220), 30, (255, 255, 255), -1) cv2.ellipse(img, (330, 220), (65, 65), 300, 0, 290, (255, 0,0 ), -1) cv2.circle(img, (330, 220), 30, (255, 255, 255), -1) font = cv2.FONT_HERSHEY_SIMPLEX cv2.putText(img, "OpenCV", (100, 400), font, 3, (0, 0, 0), 15, cv2.LINE_AA) cv2.imshow('study', img) cv2.waitKey(0) cv2.destroyAllWindows()