def draw_on_detected(frame, rects, timestamp):
# Draw the bounding box on the frame
for (x, y, w, h) in rects:
cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)
# draw the text and timestamp on the frame
ts = timestamp.strftime("%A %d %B %Y %I:%M:%S%p")
cv2.putText(frame, "Status: Open", (10, 20), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255),
2)
cv2.putText(frame, ts, (10, frame.shape[0] - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.35, (0, 0, 255), 1)
# write the image to temporary file
# t = TempImage()
# print('File saved at' + str(t.path))
# cv2.imwrite(t.path, frame)
# analyze
# pi_surveillance_analyze.analyze(t.path)
评论列表
文章目录