simple_motion_detection.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:IoT-Client 作者: suquark 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号