OpenCV 4.5.3(日本語機械翻訳)
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
49 namespace cv
50{
51
54
60 class CV_EXPORTS_W BackgroundSubtractor : public Algorithm
61{
62 public:
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{
92 public:
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
220CV_EXPORTS_W Ptr<BackgroundSubtractorMOG2>
221 createBackgroundSubtractorMOG2(int history=500, double varThreshold=16,
222 bool detectShadows=true);
223
230{
231 public:
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 type is very similar to InputArray except that it is used for input/output and output function p...
Definition: mat.hpp:295
This is a base class for all more or less complex algorithms in OpenCV
Definition: core.hpp:3091
Base class for background/foreground segmentation. :
Definition: background_segm.hpp:61
K-nearest neighbours - based Background/Foreground Segmentation Algorithm.
Definition: background_segm.hpp:230
Gaussian Mixture-based Background/Foreground Segmentation Algorithm.
Definition: background_segm.hpp:91
CV_EXPORTS_W double threshold(InputArray src, OutputArray dst, double thresh, double maxval, int type)
Applies a fixed-level threshold to each array element.
CV_EXPORTS_W Ptr< BackgroundSubtractorKNN > createBackgroundSubtractorKNN(int history=500, double dist2Threshold=400.0, bool detectShadows=true)
Creates KNN Background Subtractor
CV_EXPORTS_W Ptr< BackgroundSubtractorMOG2 > createBackgroundSubtractorMOG2(int history=500, double varThreshold=16, bool detectShadows=true)
Creates MOG2 Background Subtractor
cv
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: cvstd_wrapper.hpp:74