Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit cecde27

Browse files
committed
Fix threshold_maximum
1 parent 90bb157 commit cecde27

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/motion_loop.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,12 @@ static void mlp_init_firstimage(ctx_dev *cam)
459459
}
460460
}
461461

462+
if (cam->conf->threshold_maximum > cam->conf->threshold ) {
463+
cam->threshold_maximum = cam->conf->threshold_maximum;
464+
} else {
465+
cam->threshold_maximum = (cam->imgs.height * cam->imgs.width * 3) / 2;
466+
}
467+
462468
}
463469

464470
/** Check the image size to determine if modulo 8 and over 64 */
@@ -549,11 +555,6 @@ static void mlp_init_values(ctx_dev *cam)
549555
cam->noise = cam->conf->noise_level;
550556

551557
cam->threshold = cam->conf->threshold;
552-
if (cam->conf->threshold_maximum > cam->conf->threshold ) {
553-
cam->threshold_maximum = cam->conf->threshold_maximum;
554-
} else {
555-
cam->threshold_maximum = (cam->imgs.height * cam->imgs.width * 3) / 2;
556-
}
557558
cam->device_status = STATUS_CLOSED;
558559
cam->startup_frames = (cam->conf->framerate * 2) + cam->conf->pre_capture + cam->conf->minimum_motion_frames;
559560

0 commit comments

Comments
 (0)