Drawing Lines and Rectangle

Sample code for drawing line and rectangle 

import cv2
import numpy as np

canvas = np.zeros((600, 1000, 3), dtype="uint8")

green = (0, 255, 0)
red = (0, 0, 255)
cv2.line(canvas, (10, 10), (100,100), green, 5)
cv2.rectangle(canvas, (200, 200), (500, 500), red, 3)

cv2.rectangle(canvas, (300, 300), (400, 450), green, -1)

cv2.imshow("Black", canvas)

cv2.waitKey(0)
cv2.destroyAllWindows()

Image Output: