def _stampText(image, text, line):
font = cv2.FONT_HERSHEY_SIMPLEX
font_scale = 0.55
margin = 5
thickness = 2
color = (255, 255, 255)
size = cv2.getTextSize(text, font, font_scale, thickness)
text_width = size[0][0]
text_height = size[0][1]
line_height = text_height + size[1] + margin
x = image.shape[1] - margin - text_width
y = margin + size[0][1] + line * line_height
cv2.putText(image, text, (x, y), font, font_scale, color, thickness)
评论列表
文章目录