From 17c136b6bc712e756dd0ed73bc5c6ba895100363 Mon Sep 17 00:00:00 2001 From: Maurice ONeal Date: Thu, 6 Oct 2022 19:41:47 -0400 Subject: [PATCH] v1.4.t9 Motion detection was still not scanning the entire block. potential fix in secDiff(), correcting offsets in the for loops. --- src/common.h | 2 +- src/mo_detect.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common.h b/src/common.h index 3b3b437..1dbdc87 100644 --- a/src/common.h +++ b/src/common.h @@ -37,7 +37,7 @@ using namespace std; using namespace std::filesystem; #define BUF_SZ 10 -#define APP_VER "1.4.t8" +#define APP_VER "1.4.t9" struct shared_t { diff --git a/src/mo_detect.cpp b/src/mo_detect.cpp index 251a93d..1ec2d20 100644 --- a/src/mo_detect.cpp +++ b/src/mo_detect.cpp @@ -31,9 +31,9 @@ void secDiff(const Mat &imgA, const Mat &imgB, int rows, int cols, int rowOffs, { auto pnts = 0; - for (auto y = rowOffs; y < rows; y++) + for (auto y = rowOffs; y < (rowOffs + rows); y++) { - for (auto x = colOffs; x < cols; x++) + for (auto x = colOffs; x < (colOffs + cols); x++) { auto pixA = imgA.at(Point(x, y)); auto pixB = imgB.at(Point(x, y));