Created
February 7, 2018 20:26
-
-
Save felipessalvatore/0198ad58239e31fa189ccdc254989cba to your computer and use it in GitHub Desktop.
write on image using cv2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
img = cv2.imread("0.png") | |
font = cv2.FONT_HERSHEY_PLAIN | |
bottomLeftCornerOfText = (15,25) | |
fontScale = 1 | |
fontColor = (255,25,55) | |
lineType = 2 | |
cv2.putText(img,"""up: 0.02""", | |
bottomLeftCornerOfText, | |
font, | |
fontScale, | |
fontColor, | |
lineType) | |
cv2.putText(img,"""down: 0.03""", | |
(15,38), | |
font, | |
fontScale, | |
fontColor, | |
lineType) | |
cv2.putText(img,"""left: 0.03""", | |
(15,52), | |
font, | |
fontScale, | |
fontColor, | |
lineType) | |
cv2.putText(img,"""right: 0.03""", | |
(15,66), | |
font, | |
fontScale, | |
fontColor, | |
lineType) | |
# #Display the image | |
# cv2.imshow("img",img) | |
#Save image | |
cv2.imwrite("out.jpg", img) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment