frame_diff.py 文件源码

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

项目:Artificial-Intelligence-with-Python 作者: PacktPublishing 项目源码 文件源码
def frame_diff(prev_frame, cur_frame, next_frame):
    # Difference between the current frame and the next frame
    diff_frames_1 = cv2.absdiff(next_frame, cur_frame)

    # Difference between the current frame and the previous frame
    diff_frames_2 = cv2.absdiff(cur_frame, prev_frame)

    return cv2.bitwise_and(diff_frames_1, diff_frames_2)

# Define a function to get the current frame from the webcam
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号