def annotate(self, frame):
text = "Frame rate: %.1f" % self.frameRate
textColor = (0,255,0)
font = cv2.FONT_HERSHEY_SIMPLEX
size = 0.5
thickness = 2
textSize = cv2.getTextSize(text, font, size, thickness)
height = textSize[1]
location = (0,frame.shape[0] - 4*height)
cv2.putText(frame, text, location, font, size, textColor,
thickness=thickness)
text = "Detection rate: %.1f" % self.detectionRate
location = (0,frame.shape[0] - height)
cv2.putText(frame, text, location, font, size, textColor,
thickness=thickness)
评论列表
文章目录