@@ -0,0 +1,666 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0Aimport cv2%0Aimport numpy as np%0A%0Acamera = cv2.VideoCapture(0)%0Agray = None%0Awhile True:%0A    ret, frame = camera.read()%0A    if ret is False:%0A        print(%22Camera open failed%22)%0A        break%0A    newgray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)%0A    display_img = newgray%0A    if gray is not None:%0A        #display_img =cv2.absdiff(newgray, gray)%0A        %22%22%22%0A        diff two picture, movement will be detected%0A        %22%22%22%0A        display_img =np.where(newgray %3E gray, newgray - gray, gray - newgray)%0A%0A    gray = newgray%0A    cv2.imshow('hello', display_img)%0A%0A    if cv2.waitKey(1) == ord('q'):%0A        break%0A%0Acamera.release()%0A

add opencv code, absdiff movement detect