From 953104284a1e7661717c5c3047b429022332a82e Mon Sep 17 00:00:00 2001 From: "Kwabena W. Agyeman" Date: Wed, 22 Nov 2023 17:34:06 -0500 Subject: [PATCH] scripts/examples: Fix triggering in frame differencing examples. --- .../in_memory_advanced_frame_differencing.py | 2 +- .../on_disk_advanced_frame_differencing.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_advanced_frame_differencing.py b/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_advanced_frame_differencing.py index 1994822f2..44edbd4ce 100644 --- a/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_advanced_frame_differencing.py +++ b/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_advanced_frame_differencing.py @@ -44,7 +44,7 @@ while True: img = sensor.snapshot() # Take a picture and return the image. frame_count += 1 - if frame_count > BG_UPDATE_FRAMES: + if frame_count > BG_UPDATE_FRAMES and not triggered: frame_count = 0 # Blend in new frame. We're doing 256-alpha here because we want to # blend the new frame into the background. Not the background into the diff --git a/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_advanced_frame_differencing.py b/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_advanced_frame_differencing.py index 6ce05d64e..10bc75568 100644 --- a/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_advanced_frame_differencing.py +++ b/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_advanced_frame_differencing.py @@ -42,7 +42,7 @@ while True: img = sensor.snapshot() # Take a picture and return the image. frame_count += 1 - if frame_count > BG_UPDATE_FRAMES: + if frame_count > BG_UPDATE_FRAMES and not triggered: frame_count = 0 # Blend in new frame. We're doing 256-alpha here because we want to # blend the new frame into the background. Not the background into the