40
#ifndef __OPENCV_BGSEGM_HPP__
41
#define __OPENCV_BGSEGM_HPP__
43
#include "opencv2/video.hpp"
62
class
CV_EXPORTS_W BackgroundSubtractorMOG :
public
BackgroundSubtractor
65
CV_WRAP
virtual
int
getHistory()
const
= 0;
66
CV_WRAP
virtual
void
setHistory(
int
nframes) = 0;
68
CV_WRAP
virtual
int
getNMixtures()
const
= 0;
69
CV_WRAP
virtual
void
setNMixtures(
int
nmix) = 0;
71
CV_WRAP
virtual
double
getBackgroundRatio()
const
= 0;
72
CV_WRAP
virtual
void
setBackgroundRatio(
double
backgroundRatio) = 0;
74
CV_WRAP
virtual
double
getNoiseSigma()
const
= 0;
75
CV_WRAP
virtual
void
setNoiseSigma(
double
noiseSigma) = 0;
86CV_EXPORTS_W Ptr<BackgroundSubtractorMOG>
87
createBackgroundSubtractorMOG(
int
history=200,
int
nmixtures=5,
88
double
backgroundRatio=0.7,
double
noiseSigma=0);
99
class
CV_EXPORTS_W BackgroundSubtractorGMG :
public
BackgroundSubtractor
104
CV_WRAP
virtual
int
getMaxFeatures()
const
= 0;
107
CV_WRAP
virtual
void
setMaxFeatures(
int
maxFeatures) = 0;
114
CV_WRAP
virtual
double
getDefaultLearningRate()
const
= 0;
117
CV_WRAP
virtual
void
setDefaultLearningRate(
double
lr) = 0;
121
CV_WRAP
virtual
int
getNumFrames()
const
= 0;
124
CV_WRAP
virtual
void
setNumFrames(
int
nframes) = 0;
130
CV_WRAP
virtual
int
getQuantizationLevels()
const
= 0;
133
CV_WRAP
virtual
void
setQuantizationLevels(
int
nlevels) = 0;
137
CV_WRAP
virtual
double
getBackgroundPrior()
const
= 0;
140
CV_WRAP
virtual
void
setBackgroundPrior(
double
bgprior) = 0;
144
CV_WRAP
virtual
int
getSmoothingRadius()
const
= 0;
147
CV_WRAP
virtual
void
setSmoothingRadius(
int
radius) = 0;
153
CV_WRAP
virtual
double
getDecisionThreshold()
const
= 0;
156
CV_WRAP
virtual
void
setDecisionThreshold(
double
thresh) = 0;
160
CV_WRAP
virtual
bool
getUpdateBackgroundModel()
const
= 0;
163
CV_WRAP
virtual
void
setUpdateBackgroundModel(
bool
update) = 0;
167
CV_WRAP
virtual
double
getMinVal()
const
= 0;
170
CV_WRAP
virtual
void
setMinVal(
double
val) = 0;
174
CV_WRAP
virtual
double
getMaxVal()
const
= 0;
177
CV_WRAP
virtual
void
setMaxVal(
double
val) = 0;
185CV_EXPORTS_W Ptr<BackgroundSubtractorGMG> createBackgroundSubtractorGMG(
int
initializationFrames=120,
186
double
decisionThreshold=0.8);
195
class
CV_EXPORTS_W BackgroundSubtractorCNT :
public
BackgroundSubtractor
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;
204
CV_WRAP virtual
int
getMinPixelStability() const = 0;
207
CV_WRAP virtual
void
setMinPixelStability(
int
value) = 0;
211
CV_WRAP virtual
int
getMaxPixelStability() const = 0;
214
CV_WRAP virtual
void
setMaxPixelStability(
int
value) = 0;
218
CV_WRAP virtual
bool
getUseHistory() const = 0;
221
CV_WRAP virtual
void
setUseHistory(
bool
value) = 0;
225
CV_WRAP virtual
bool
getIsParallel() const = 0;
228
CV_WRAP virtual
void
setIsParallel(
bool
value) = 0;
239CV_EXPORTS_W Ptr<BackgroundSubtractorCNT>
240createBackgroundSubtractorCNT(
int
minPixelStability = 15,
241
bool
useHistory = true,
242
int
maxPixelStability = 15*60,
243
bool
isParallel = true);
245enum LSBPCameraMotionCompensation {
246
LSBP_CAMERA_MOTION_COMPENSATION_NONE = 0,
247
LSBP_CAMERA_MOTION_COMPENSATION_LK
254
class
CV_EXPORTS_W BackgroundSubtractorGSOC :
public
BackgroundSubtractor
258
CV_WRAP
virtual
void
apply(InputArray image, OutputArray fgmask,
double
learningRate=-1) CV_OVERRIDE = 0;
260
CV_WRAP virtual
void
getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE = 0;
265class CV_EXPORTS_W BackgroundSubtractorLSBP : public BackgroundSubtractor
269
CV_WRAP
virtual
void
apply(InputArray image, OutputArray fgmask,
double
learningRate=-1) CV_OVERRIDE = 0;
271
CV_WRAP virtual
void
getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE = 0;
276class CV_EXPORTS_W BackgroundSubtractorLSBPDesc
279
static
void
calcLocalSVDValues(OutputArray localSVDValues,
const
Mat& frame);
281
static
void
computeFromLocalSVDValues(OutputArray desc,
const
Mat& localSVDValues,
const
Point2i* LSBPSamplePoints);
283
static
void
compute(OutputArray desc,
const
Mat& frame,
const
Point2i* LSBPSamplePoints);
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);
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);
329
class
CV_EXPORTS_W SyntheticSequenceGenerator :
public
Algorithm
332
const
double
amplitude;
333
const
double
wavelength;
334
const
double
wavespeed;
335
const
double
objspeed;
353
CV_WRAP SyntheticSequenceGenerator(InputArray background, InputArray
object,
double
amplitude,
double
wavelength,
double
wavespeed,
double
objspeed);
360
CV_WRAP
void
getNextFrame(OutputArray frame, OutputArray gtMask);
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);
"black box" representation of the file storage associated with a file on disk.
Definition:
aruco.hpp:75