Select Git revision
read_sPlot_TRY_HB13.R
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
FrameProcessor.cpp 23.50 KiB
/*
This file is part of BGSLibrary.
BGSLibrary 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.
BGSLibrary 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.
You should have received a copy of the GNU General Public License
along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
*/
#include "FrameProcessor.h"
#include <iomanip>
namespace bgslibrary
{
FrameProcessor::FrameProcessor() : firstTime(true), frameNumber(0), duration(0), tictoc(""), frameToStop(0)
{
std::cout << "FrameProcessor()" << std::endl;
loadConfig();
saveConfig();
}
FrameProcessor::~FrameProcessor()
{
std::cout << "~FrameProcessor()" << std::endl;
}
void FrameProcessor::init()
{
if (enablePreProcessor)
preProcessor = new PreProcessor;
if (enableFrameDifference)
frameDifference = new FrameDifference;
if (enableStaticFrameDifference)
staticFrameDifference = new StaticFrameDifference;
if (enableWeightedMovingMean)
weightedMovingMean = new WeightedMovingMean;
if (enableWeightedMovingVariance)
weightedMovingVariance = new WeightedMovingVariance;
#if CV_MAJOR_VERSION == 2
if (enableMixtureOfGaussianV1)
mixtureOfGaussianV1 = new MixtureOfGaussianV1;
#endif
if (enableMixtureOfGaussianV2)
mixtureOfGaussianV2 = new MixtureOfGaussianV2;
if (enableAdaptiveBackgroundLearning)
adaptiveBackgroundLearning = new AdaptiveBackgroundLearning;
#if CV_MAJOR_VERSION >= 2 && CV_MINOR_VERSION >= 4 && CV_SUBMINOR_VERSION >= 3
if (enableGMG)
gmg = new GMG;
#endif
#if CV_MAJOR_VERSION == 3
if (enableKNN)
knn = new KNN;