only write the first motion frame

This commit is contained in:
blakeblackshear 2019-02-20 17:44:51 -06:00
parent 19323ac957
commit bff1826bf5

View File

@ -539,7 +539,7 @@ def detect_motion(shared_arr, shared_frame_time, frame_lock, frame_ready, motion
with motion_changed: with motion_changed:
motion_changed.notify_all() motion_changed.notify_all()
if debug and motion_frames >= 3: if debug and motion_frames == 3:
cv2.imwrite("/lab/debug/motion-{}-{}-{}.jpg".format(region_x_offset, region_y_offset, datetime.datetime.now().timestamp()), cropped_frame) cv2.imwrite("/lab/debug/motion-{}-{}-{}.jpg".format(region_x_offset, region_y_offset, datetime.datetime.now().timestamp()), cropped_frame)
cv2.imwrite("/lab/debug/avg_delta-{}-{}-{}.jpg".format(region_x_offset, region_y_offset, datetime.datetime.now().timestamp()), avg_delta_image) cv2.imwrite("/lab/debug/avg_delta-{}-{}-{}.jpg".format(region_x_offset, region_y_offset, datetime.datetime.now().timestamp()), avg_delta_image)