import numpy as np
import cv2

#create a black image

img = np.zeros((512,512,3), np.uint8)


#line

img = cv2.line(img, (120,100), (250,500), (255,0,0), 5)

#rectangle
img = cv2.rectangle(img, (340,0),(510,128),(0,255,0),-1)

#circle

img = cv2.circle(img, (447,63), 63, (0,0,255), -1)

#polygon

pts = np.array([[10,5],[20,30],[70,20],[50,10]],np.int32)

#RowsX1X2
pts = pts.reshape(-1,1,2)
img = cv2.polylines(img , [pts],True,(0,255,255),5)

#ellipse
img = cv2.ellipse(img,(256,256), (100,50), 30, 0, 270, (255,0,0), -1)

#Text
font = cv2.FONT_HERSHEY_COMPLEX

img = cv2.putText(img, 'My Code Academia', (10,500), font, 1, (255,255,255), 2, cv2.LINE_AA)

cv2.imshow('image', img)
cv2.waitKey(0)&0xFF
cv2.destroyAllWindows()
