Skip to content

Instantly share code, notes, and snippets.

@qwertyz15
Last active June 26, 2023 06:51
Show Gist options
  • Save qwertyz15/a7250c87db334a23adca13b66465b8ff to your computer and use it in GitHub Desktop.
Save qwertyz15/a7250c87db334a23adca13b66465b8ff to your computer and use it in GitHub Desktop.
python put_text.py
def draw_str(dst, target, s):
x, y = target
cv.putText(dst, s, (x+1, y+1), cv.FONT_HERSHEY_PLAIN, 1.0, (0, 0, 0), thickness = 2, lineType=cv.LINE_AA)
cv.putText(dst, s, (x, y), cv.FONT_HERSHEY_PLAIN, 1.0, (255, 255, 255), lineType=cv.LINE_AA)
draw_str(res, (20, 20), "threaded : " + str(threaded_mode))
draw_str(res, (20, 40), "latency : %.1f ms" % (latency.value*1000))
draw_str(res, (20, 60), "frame interval : %.1f ms" % (frame_interval.value*1000))
draw_str(res, (20, 80), "fps : %.1f" % (1/frame_interval.value))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment