OpenCV 4.5.3(日本語機械翻訳)
bgsegm.hpp
1 /*
2 By downloading, copying, installing or using the software you agree to this
3 license. If you do not agree to this license, do not download, install,
4 copy or use the software.
5
6
7 License Agreement
8 For Open Source Computer Vision Library
9 (3-clause BSD License)
10
11 Copyright (C) 2013, OpenCV Foundation, all rights reserved.
12 Third party copyrights are property of their respective owners.
13
14 Redistribution and use in source and binary forms, with or without modification,
15 are permitted provided that the following conditions are met:
16
17 * Redistributions of source code must retain the above copyright notice,
18 this list of conditions and the following disclaimer.
19
20 * Redistributions in binary form must reproduce the above copyright notice,
21 this list of conditions and the following disclaimer in the documentation
22 and/or other materials provided with the distribution.
23
24 * Neither the names of the copyright holders nor the names of the contributors
25 may be used to endorse or promote products derived from this software
26 without specific prior written permission.
27
28 This software is provided by the copyright holders and contributors "as is" and
29 any express or implied warranties, including, but not limited to, the implied
30 warranties of merchantability and fitness for a particular purpose are
31 disclaimed. In no event shall copyright holders or contributors be liable for
32 any direct, indirect, incidental, special, exemplary, or consequential damages
33 (including, but not limited to, procurement of substitute goods or services;
34 loss of use, data, or profits; or business interruption) however caused
35 and on any theory of liability, whether in contract, strict liability,
36 or tort (including negligence or otherwise) arising in any way out of
37 the use of this software, even if advised of the possibility of such damage.
38 */
39
40 #ifndef __OPENCV_BGSEGM_HPP__
41 #define __OPENCV_BGSEGM_HPP__
42
43 #include "opencv2/video.hpp"
44
45 #ifdef __cplusplus
46
50 namespace cv
51{
52 namespace bgsegm
53{
54
57
62 class CV_EXPORTS_W BackgroundSubtractorMOG : public BackgroundSubtractor
63{
64 public:
65 CV_WRAP virtual int getHistory() const = 0;
66 CV_WRAP virtual void setHistory(int nframes) = 0;
67
68 CV_WRAP virtual int getNMixtures() const = 0;
69 CV_WRAP virtual void setNMixtures(int nmix) = 0;
70
71 CV_WRAP virtual double getBackgroundRatio() const = 0;
72 CV_WRAP virtual void setBackgroundRatio(double backgroundRatio) = 0;
73
74 CV_WRAP virtual double getNoiseSigma() const = 0;
75 CV_WRAP virtual void setNoiseSigma(double noiseSigma) = 0;
76};
77
86CV_EXPORTS_W Ptr<BackgroundSubtractorMOG>
87 createBackgroundSubtractorMOG(int history=200, int nmixtures=5,
88 double backgroundRatio=0.7, double noiseSigma=0);
89
90
99 class CV_EXPORTS_W BackgroundSubtractorGMG : public BackgroundSubtractor
100{
101 public:
104 CV_WRAP virtual int getMaxFeatures() const = 0;
107 CV_WRAP virtual void setMaxFeatures(int maxFeatures) = 0;
108
114 CV_WRAP virtual double getDefaultLearningRate() const = 0;
117 CV_WRAP virtual void setDefaultLearningRate(double lr) = 0;
118
121 CV_WRAP virtual int getNumFrames() const = 0;
124 CV_WRAP virtual void setNumFrames(int nframes) = 0;
125
130 CV_WRAP virtual int getQuantizationLevels() const = 0;
133 CV_WRAP virtual void setQuantizationLevels(int nlevels) = 0;
134
137 CV_WRAP virtual double getBackgroundPrior() const = 0;
140 CV_WRAP virtual void setBackgroundPrior(double bgprior) = 0;
141
144 CV_WRAP virtual int getSmoothingRadius() const = 0;
147 CV_WRAP virtual void setSmoothingRadius(int radius) = 0;
148
153 CV_WRAP virtual double getDecisionThreshold() const = 0;
156 CV_WRAP virtual void setDecisionThreshold(double thresh) = 0;
157
160 CV_WRAP virtual bool getUpdateBackgroundModel() const = 0;
163 CV_WRAP virtual void setUpdateBackgroundModel(bool update) = 0;
164
167 CV_WRAP virtual double getMinVal() const = 0;
170 CV_WRAP virtual void setMinVal(double val) = 0;
171
174 CV_WRAP virtual double getMaxVal() const = 0;
177 CV_WRAP virtual void setMaxVal(double val) = 0;
178};
179
185CV_EXPORTS_W Ptr<BackgroundSubtractorGMG> createBackgroundSubtractorGMG(int initializationFrames=120,
186 double decisionThreshold=0.8);
187
195 class CV_EXPORTS_W BackgroundSubtractorCNT : public BackgroundSubtractor
196{
197 public:
198 // BackgroundSubtractor interface
199 CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) CV_OVERRIDE = 0;
200 CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE = 0;
201
204 CV_WRAP virtual int getMinPixelStability() const = 0;
207 CV_WRAP virtual void setMinPixelStability(int value) = 0;
208
211 CV_WRAP virtual int getMaxPixelStability() const = 0;
214 CV_WRAP virtual void setMaxPixelStability(int value) = 0;
215
218 CV_WRAP virtual bool getUseHistory() const = 0;
221 CV_WRAP virtual void setUseHistory(bool value) = 0;
222
225 CV_WRAP virtual bool getIsParallel() const = 0;
228 CV_WRAP virtual void setIsParallel(bool value) = 0;
229};
230
239CV_EXPORTS_W Ptr<BackgroundSubtractorCNT>
240createBackgroundSubtractorCNT(int minPixelStability = 15,
241 bool useHistory = true,
242 int maxPixelStability = 15*60,
243 bool isParallel = true);
244
245enum LSBPCameraMotionCompensation {
246 LSBP_CAMERA_MOTION_COMPENSATION_NONE = 0,
247 LSBP_CAMERA_MOTION_COMPENSATION_LK
248};
249
254 class CV_EXPORTS_W BackgroundSubtractorGSOC : public BackgroundSubtractor
255{
256 public:
257 // BackgroundSubtractor interface
258 CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) CV_OVERRIDE = 0;
259
260 CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE = 0;
261};
262
265class CV_EXPORTS_W BackgroundSubtractorLSBP : public BackgroundSubtractor
266{
267 public:
268 // BackgroundSubtractor interface
269 CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) CV_OVERRIDE = 0;
270
271 CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE = 0;
272};
273
276class CV_EXPORTS_W BackgroundSubtractorLSBPDesc
277{
278 public:
279 static void calcLocalSVDValues(OutputArray localSVDValues, const Mat& frame);
280
281 static void computeFromLocalSVDValues(OutputArray desc, const Mat& localSVDValues, const Point2i* LSBPSamplePoints);
282
283 static void compute(OutputArray desc, const Mat& frame, const Point2i* LSBPSamplePoints);
284};
285
302CV_EXPORTS_W Ptr<BackgroundSubtractorGSOC> createBackgroundSubtractorGSOC(int mc = LSBP_CAMERA_MOTION_COMPENSATION_NONE, int nSamples = 20, float replaceRate = 0.003f, float propagationRate = 0.01f, int hitsThreshold = 32, float alpha = 0.01f, float beta = 0.0022f, float blinkingSupressionDecay = 0.1f, float blinkingSupressionMultiplier = 0.1f, float noiseRemovalThresholdFacBG = 0.0004f, float noiseRemovalThresholdFacFG = 0.0008f);
303
322CV_EXPORTS_W Ptr<BackgroundSubtractorLSBP> createBackgroundSubtractorLSBP(int mc = LSBP_CAMERA_MOTION_COMPENSATION_NONE, int nSamples = 20, int LSBPRadius = 16, float Tlower = 2.0f, float Tupper = 32.0f, float Tinc = 1.0f, float Tdec = 0.05f, float Rscale = 10.0f, float Rincdec = 0.005f, float noiseRemovalThresholdFacBG = 0.0004f, float noiseRemovalThresholdFacFG = 0.0008f, int LSBPthreshold = 8, int minCount = 2);
323
329 class CV_EXPORTS_W SyntheticSequenceGenerator : public Algorithm
330{
331 private:
332 const double amplitude;
333 const double wavelength;
334 const double wavespeed;
335 const double objspeed;
336 unsigned timeStep;
337 Point2d pos;
338 Point2d dir;
339 Mat background;
340 Mat object;
341 RNG rng;
342
343 public:
353 CV_WRAP SyntheticSequenceGenerator(InputArray background, InputArray object, double amplitude, double wavelength, double wavespeed, double objspeed);
354
360 CV_WRAP void getNextFrame(OutputArray frame, OutputArray gtMask);
361};
362
372CV_EXPORTS_W Ptr<SyntheticSequenceGenerator> createSyntheticSequenceGenerator(InputArray background, InputArray object, double amplitude = 2.0, double wavelength = 20.0, double wavespeed = 0.2, double objspeed = 6.0);
373
375
376}
377}
378
379 #endif
380 #endif
cv
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75