import cv2
import numpy as np
def show(img):
cv2.imshow('aa', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
img = np.zeros((500, 500, 3), np.uint8)
cv2.line(img, (0,0),(500, 500), (255, 0, 0), 2)
pts = np.array([[50, 10],[100, 20],[180,80],[70, 90]],np.int32)
pts.reshape((-2, 1, 2))
cv2.polylines(img, [pts], True, (255, 255, 255))
cv2.rectangle(img, (400, 0), (500, 100), (0,255, 0), 2)
cv2.circle(img, (450, 50), 50, (0, 0, 255), -1)
cv2.ellipse(img, (250, 250), (100, 50), 0, 0, 180, (255, 0 ,0),-1)
cv2.putText(img, 'OpenCV', (0, 450), cv2.FONT_HERSHEY_DUPLEX, 4, (255, 255, 255), 4, cv2.LINE_AA, False)
show(img)