font = cv2.FONT_HERSHEY_SIMPLEX
cv2.putText(img, 'Hello World!', (10, 500), font, 1, (255, 255, 255), 2)
cv2.imshow('img', img)
cv2.imwrite('out.jpg', img)
cv2.waitKey(0)
How to write text on a image in windows using python opencv2