EstervQrCode 2.0.0
Library for qr code manipulation
Loading...
Searching...
No Matches
background_segm.hpp
1/*M///////////////////////////////////////////////////////////////////////////////////////
2//
3// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4//
5// By downloading, copying, installing or using the software you agree to this license.
6// If you do not agree to this license, do not download, install,
7// copy or use the software.
8//
9//
10// License Agreement
11// For Open Source Computer Vision Library
12//
13// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
14// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
15// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
16// Third party copyrights are property of their respective owners.
17//
18// Redistribution and use in source and binary forms, with or without modification,
19// are permitted provided that the following conditions are met:
20//
21// * Redistribution's of source code must retain the above copyright notice,
22// this list of conditions and the following disclaimer.
23//
24// * Redistribution's in binary form must reproduce the above copyright notice,
25// this list of conditions and the following disclaimer in the documentation
26// and/or other materials provided with the distribution.
27//
28// * The name of the copyright holders may not be used to endorse or promote products
29// derived from this software without specific prior written permission.
30//
31// This software is provided by the copyright holders and contributors "as is" and
32// any express or implied warranties, including, but not limited to, the implied
33// warranties of merchantability and fitness for a particular purpose are disclaimed.
34// In no event shall the Intel Corporation or contributors be liable for any direct,
35// indirect, incidental, special, exemplary, or consequential damages
36// (including, but not limited to, procurement of substitute goods or services;
37// loss of use, data, or profits; or business interruption) however caused
38// and on any theory of liability, whether in contract, strict liability,
39// or tort (including negligence or otherwise) arising in any way out of
40// the use of this software, even if advised of the possibility of such damage.
41//
42//M*/
43
44#ifndef OPENCV_BACKGROUND_SEGM_HPP
45#define OPENCV_BACKGROUND_SEGM_HPP
46
47#include "opencv2/core.hpp"
48
49namespace cv
50{
51
54
61{
62public:
72 CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) = 0;
73
81 CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const = 0;
82};
83
84
91{
92public:
95 CV_WRAP virtual int getHistory() const = 0;
98 CV_WRAP virtual void setHistory(int history) = 0;
99
102 CV_WRAP virtual int getNMixtures() const = 0;
107 CV_WRAP virtual void setNMixtures(int nmixtures) = 0;//needs reinitialization!
108
115 CV_WRAP virtual double getBackgroundRatio() const = 0;
118 CV_WRAP virtual void setBackgroundRatio(double ratio) = 0;
119
125 CV_WRAP virtual double getVarThreshold() const = 0;
128 CV_WRAP virtual void setVarThreshold(double varThreshold) = 0;
129
138 CV_WRAP virtual double getVarThresholdGen() const = 0;
141 CV_WRAP virtual void setVarThresholdGen(double varThresholdGen) = 0;
142
145 CV_WRAP virtual double getVarInit() const = 0;
148 CV_WRAP virtual void setVarInit(double varInit) = 0;
149
150 CV_WRAP virtual double getVarMin() const = 0;
151 CV_WRAP virtual void setVarMin(double varMin) = 0;
152
153 CV_WRAP virtual double getVarMax() const = 0;
154 CV_WRAP virtual void setVarMax(double varMax) = 0;
155
162 CV_WRAP virtual double getComplexityReductionThreshold() const = 0;
165 CV_WRAP virtual void setComplexityReductionThreshold(double ct) = 0;
166
172 CV_WRAP virtual bool getDetectShadows() const = 0;
175 CV_WRAP virtual void setDetectShadows(bool detectShadows) = 0;
176
182 CV_WRAP virtual int getShadowValue() const = 0;
185 CV_WRAP virtual void setShadowValue(int value) = 0;
186
194 CV_WRAP virtual double getShadowThreshold() const = 0;
197 CV_WRAP virtual void setShadowThreshold(double threshold) = 0;
198
208 CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) CV_OVERRIDE = 0;
209};
210
221 createBackgroundSubtractorMOG2(int history=500, double varThreshold=16,
222 bool detectShadows=true);
223
230{
231public:
234 CV_WRAP virtual int getHistory() const = 0;
237 CV_WRAP virtual void setHistory(int history) = 0;
238
241 CV_WRAP virtual int getNSamples() const = 0;
246 CV_WRAP virtual void setNSamples(int _nN) = 0;//needs reinitialization!
247
253 CV_WRAP virtual double getDist2Threshold() const = 0;
256 CV_WRAP virtual void setDist2Threshold(double _dist2Threshold) = 0;
257
263 CV_WRAP virtual int getkNNSamples() const = 0;
266 CV_WRAP virtual void setkNNSamples(int _nkNN) = 0;
267
273 CV_WRAP virtual bool getDetectShadows() const = 0;
276 CV_WRAP virtual void setDetectShadows(bool detectShadows) = 0;
277
283 CV_WRAP virtual int getShadowValue() const = 0;
286 CV_WRAP virtual void setShadowValue(int value) = 0;
287
295 CV_WRAP virtual double getShadowThreshold() const = 0;
298 CV_WRAP virtual void setShadowThreshold(double threshold) = 0;
299};
300
310 createBackgroundSubtractorKNN(int history=500, double dist2Threshold=400.0,
311 bool detectShadows=true);
312
314
315} // cv
316
317#endif
This is a base class for all more or less complex algorithms in OpenCV.
Definition core.hpp:3197
K-nearest neighbours - based Background/Foreground Segmentation Algorithm.
Definition background_segm.hpp:230
virtual CV_WRAP int getShadowValue() const =0
Returns the shadow value.
virtual CV_WRAP void setShadowValue(int value)=0
Sets the shadow value.
virtual CV_WRAP int getNSamples() const =0
Returns the number of data samples in the background model.
virtual CV_WRAP double getShadowThreshold() const =0
Returns the shadow threshold.
virtual CV_WRAP void setNSamples(int _nN)=0
Sets the number of data samples in the background model.
virtual CV_WRAP bool getDetectShadows() const =0
Returns the shadow detection flag.
virtual CV_WRAP void setkNNSamples(int _nkNN)=0
Sets the k in the kNN. How many nearest neighbours need to match.
virtual CV_WRAP void setShadowThreshold(double threshold)=0
Sets the shadow threshold.
virtual CV_WRAP void setDist2Threshold(double _dist2Threshold)=0
Sets the threshold on the squared distance.
virtual CV_WRAP double getDist2Threshold() const =0
Returns the threshold on the squared distance between the pixel and the sample.
virtual CV_WRAP int getkNNSamples() const =0
Returns the number of neighbours, the k in the kNN.
virtual CV_WRAP int getHistory() const =0
Returns the number of last frames that affect the background model.
virtual CV_WRAP void setDetectShadows(bool detectShadows)=0
Enables or disables shadow detection.
virtual CV_WRAP void setHistory(int history)=0
Sets the number of last frames that affect the background model.
Gaussian Mixture-based Background/Foreground Segmentation Algorithm.
Definition background_segm.hpp:91
virtual CV_WRAP bool getDetectShadows() const =0
Returns the shadow detection flag.
virtual CV_WRAP void setVarMin(double varMin)=0
virtual CV_WRAP double getVarThresholdGen() const =0
Returns the variance threshold for the pixel-model match used for new mixture component generation.
virtual CV_WRAP void setVarThresholdGen(double varThresholdGen)=0
Sets the variance threshold for the pixel-model match used for new mixture component generation.
virtual CV_WRAP double getVarInit() const =0
Returns the initial variance of each gaussian component.
virtual CV_WRAP double getVarThreshold() const =0
Returns the variance threshold for the pixel-model match.
virtual CV_WRAP void apply(InputArray image, OutputArray fgmask, double learningRate=-1) CV_OVERRIDE=0
Computes a foreground mask.
virtual CV_WRAP double getVarMax() const =0
virtual CV_WRAP double getVarMin() const =0
virtual CV_WRAP double getBackgroundRatio() const =0
Returns the "background ratio" parameter of the algorithm.
virtual CV_WRAP double getShadowThreshold() const =0
Returns the shadow threshold.
virtual CV_WRAP void setHistory(int history)=0
Sets the number of last frames that affect the background model.
virtual CV_WRAP void setDetectShadows(bool detectShadows)=0
Enables or disables shadow detection.
virtual CV_WRAP void setVarInit(double varInit)=0
Sets the initial variance of each gaussian component.
virtual CV_WRAP void setVarMax(double varMax)=0
virtual CV_WRAP double getComplexityReductionThreshold() const =0
Returns the complexity reduction threshold.
virtual CV_WRAP int getShadowValue() const =0
Returns the shadow value.
virtual CV_WRAP void setNMixtures(int nmixtures)=0
Sets the number of gaussian components in the background model.
virtual CV_WRAP int getHistory() const =0
Returns the number of last frames that affect the background model.
virtual CV_WRAP void setBackgroundRatio(double ratio)=0
Sets the "background ratio" parameter of the algorithm.
virtual CV_WRAP void setVarThreshold(double varThreshold)=0
Sets the variance threshold for the pixel-model match.
virtual CV_WRAP int getNMixtures() const =0
Returns the number of gaussian components in the background model.
virtual CV_WRAP void setShadowValue(int value)=0
Sets the shadow value.
virtual CV_WRAP void setShadowThreshold(double threshold)=0
Sets the shadow threshold.
virtual CV_WRAP void setComplexityReductionThreshold(double ct)=0
Sets the complexity reduction threshold.
Base class for background/foreground segmentation. :
Definition background_segm.hpp:61
virtual CV_WRAP void getBackgroundImage(OutputArray backgroundImage) const =0
Computes a background image.
virtual CV_WRAP void apply(InputArray image, OutputArray fgmask, double learningRate=-1)=0
Computes a foreground mask.
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition mat.hpp:296
int CvScalar value
Definition core_c.h:720
#define CV_OVERRIDE
Definition cvdef.h:792
#define CV_EXPORTS_W
Definition cvdef.h:472
#define CV_WRAP
Definition cvdef.h:481
double threshold
Definition imgproc_c.h:712
CV_EXPORTS_W Ptr< BackgroundSubtractorKNN > createBackgroundSubtractorKNN(int history=500, double dist2Threshold=400.0, bool detectShadows=true)
Creates KNN Background Subtractor.
const IplImage * image
Definition videoio_c.h:131
"black box" representation of the file storage associated with a file on disk.
Definition calib3d.hpp:441
Definition cvstd_wrapper.hpp:74