From 17dca032c4a62f9147033de10123ee6b1982f283 Mon Sep 17 00:00:00 2001 From: Mr-Dave Date: Fri, 17 Feb 2023 21:12:14 -0700 Subject: [PATCH] Fix threshold_maximum --- src/motion_loop.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/motion_loop.cpp b/src/motion_loop.cpp index 4cff0a8f..a528e883 100644 --- a/src/motion_loop.cpp +++ b/src/motion_loop.cpp @@ -459,6 +459,12 @@ static void mlp_init_firstimage(ctx_dev *cam) } } + if (cam->conf->threshold_maximum > cam->conf->threshold ) { + cam->threshold_maximum = cam->conf->threshold_maximum; + } else { + cam->threshold_maximum = (cam->imgs.height * cam->imgs.width * 3) / 2; + } + } /** Check the image size to determine if modulo 8 and over 64 */ @@ -549,11 +555,6 @@ static void mlp_init_values(ctx_dev *cam) cam->noise = cam->conf->noise_level; cam->threshold = cam->conf->threshold; - if (cam->conf->threshold_maximum > cam->conf->threshold ) { - cam->threshold_maximum = cam->conf->threshold_maximum; - } else { - cam->threshold_maximum = (cam->imgs.height * cam->imgs.width * 3) / 2; - } cam->device_status = STATUS_CLOSED; cam->startup_frames = (cam->conf->framerate * 2) + cam->conf->pre_capture + cam->conf->minimum_motion_frames;