1 | initial version |
it's quite a puzzle here, but what happens:
remedy: you need to copy to last_frame before you draw into it, also, it needs a "deep copy", not just an assignment:
binary = cv2.absdiff(last_frame, frame)
binary = cv2.cvtColor(binary, cv2.COLOR_BGR2GRAY)
ret, binary = cv2.threshold(binary,50,255,cv2.THRESH_BINARY)
last_frame = frame.copy()
# now draw into your frame, as you like !
2 | No.2 Revision |
it's quite a puzzle here, but what happens:
remedy: you need to copy to last_frame before you draw into it, also, it needs a "deep copy", not just an assignment:
binary = cv2.absdiff(last_frame, frame)
binary = cv2.cvtColor(binary, cv2.COLOR_BGR2GRAY)
ret, binary = cv2.threshold(binary,50,255,cv2.THRESH_BINARY)
last_frame = frame.copy()
# now draw into your frame, as you like !