def add_text(img, text, text_top, image_scale):
"""
Args:
img (numpy array of shape (width, height, 3): input image
text (str): text to add to image
text_top (int): location of top text to add
image_scale (float): image resize scale
Summary:
Add display text to a frame.
Returns:
Next available location of top text (allows for chaining this function)
"""
cv2.putText(
img=img,
text=text,
org=(0, text_top),
fontFace=cv2.FONT_HERSHEY_SIMPLEX,
fontScale=0.15 * image_scale,
color=(255, 255, 255))
return text_top + int(5 * image_scale)
评论列表
文章目录