re-formed the stats output and moved it out of the motion detect function. block pixel diff counts will now no longer stop at the threshold at each block. it will now count the entire block and output the results in the stats. the code now also pick the block with the highest pixDiff instead of stopping at the first block with a high pixDiff.
33 lines
1.1 KiB
C
33 lines
1.1 KiB
C
#ifndef MO_DETECT_H
|
|
#define MO_DETECT_H
|
|
|
|
// This file is part of Motion Watch.
|
|
|
|
// Motion Watch is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
|
|
// Motion Watch is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
|
|
#include "common.h"
|
|
|
|
struct sec_t
|
|
{
|
|
int x;
|
|
int y;
|
|
int xSize;
|
|
int ySize;
|
|
int pixDiff;
|
|
};
|
|
|
|
void secDiff(Mat imgA, Mat imgB, int rows, int cols, int rowOffs, int colOffs, vector<sec_t> *results, mutex *secMutex, shared_t *share);
|
|
bool pixDiff(const uchar &pixA, const uchar &pixB, shared_t *share);
|
|
bool imgDiff(Mat prev, Mat next, Rect *block, shared_t *share);
|
|
bool moDetect(const string &buffFile, Rect *block, Mat *img, shared_t *share);
|
|
|
|
#endif // MO_DETECT_H
|