Skip to content
Snippets Groups Projects
Select Git revision
  • 350243bf810f09d2e6114e9454ec5856f3e3b485
  • master default protected
  • beta
  • dev
  • andrewssobral-patch-1
  • update
  • thomas-fork
  • 2.0
  • v3.2.0
  • v3.1.0
  • v3.0
  • bgslib_py27_ocv3_win64
  • bgslib_java_2.0.0
  • bgslib_console_2.0.0
  • bgslib_matlab_win64_2.0.0
  • bgslib_qtgui_2.0.0
  • 2.0.0
  • bgs_console_2.0.0
  • bgs_matlab_win64_2.0.0
  • bgs_qtgui_2.0.0
  • v1.9.2_x86_mfc_gui
  • v1.9.2_x64_java_gui
  • v1.9.2_x86_java_gui
23 results

MixtureOfGaussianV1BGS.h

Blame
  • user avatar
    Holger Friedrich authored
    bgslib now compiles on Linux systems without libcv-dev installed.
    Almost all calls and incudes have been ported to opencv2, some are
    still used via opencv2/legacy/compat.hpp (e.g. cvFillImage).
    Hope I got everything fine also for mingw since I removed two
    mingw related defines.
    I don't have a mingw install to check it against.
    5ed8f779
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    MixtureOfGaussianV1BGS.h 1.17 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/>.
    */
    #pragma once
    
    #include <iostream>
    #include <opencv2/opencv.hpp>
    
    #include <opencv2/video/background_segm.hpp>
    
    #include "IBGS.h"
    
    class MixtureOfGaussianV1BGS : public IBGS
    {
    private:
      bool firstTime;
      cv::BackgroundSubtractorMOG mog;
      cv::Mat img_foreground;
      double alpha;
      bool enableThreshold;
      int threshold;
      bool showOutput;
    
    public:
      MixtureOfGaussianV1BGS();
      ~MixtureOfGaussianV1BGS();
    
      void process(const cv::Mat &img_input, cv::Mat &img_output, cv::Mat &img_bgmodel);
    
    private:
      void saveConfig();
      void loadConfig();
    };