Raspberry Pi - Camera Module
What is wrong with this motion detection loop?
import cv2
cap = cv2.VideoCapture(0)
while True:
ret, frame1 = cap.read()
ret, frame2 = cap.read()
diff = cv2.absdiff(frame1, frame2)
if diff.any():
print("Motion detected")