rate. 0 means that the background model is not updated at all, 1 means that the background model
is completely reinitialized from the last frame.
*/
- CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) = 0;
+ CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) CV_OVERRIDE = 0;
};
/** @brief Creates MOG2 Background Subtractor
static const unsigned char defaultnShadowDetection2 = (unsigned char)127; // value to use in the segmentation mask for shadows, set 0 not to do shadow detection
static const float defaultfTau = 0.5f; // Tau - shadow threshold, see the paper for explanation
-class BackgroundSubtractorKNNImpl : public BackgroundSubtractorKNN
+class BackgroundSubtractorKNNImpl CV_FINAL : public BackgroundSubtractorKNN
{
public:
//! the default constructor
#endif
}
//! the destructor
- ~BackgroundSubtractorKNNImpl() {}
+ ~BackgroundSubtractorKNNImpl() CV_OVERRIDE {}
//! the update operator
- void apply(InputArray image, OutputArray fgmask, double learningRate=-1);
+ void apply(InputArray image, OutputArray fgmask, double learningRate) CV_OVERRIDE;
//! computes a background image which are the mean of all background gaussians
- virtual void getBackgroundImage(OutputArray backgroundImage) const;
+ virtual void getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE;
//! re-initialization method
void initialize(Size _frameSize, int _frameType)
}
}
- virtual int getHistory() const { return history; }
- virtual void setHistory(int _nframes) { history = _nframes; }
+ virtual int getHistory() const CV_OVERRIDE { return history; }
+ virtual void setHistory(int _nframes) CV_OVERRIDE { history = _nframes; }
- virtual int getNSamples() const { return nN; }
- virtual void setNSamples(int _nN) { nN = _nN; }//needs reinitialization!
+ virtual int getNSamples() const CV_OVERRIDE { return nN; }
+ virtual void setNSamples(int _nN) CV_OVERRIDE { nN = _nN; }//needs reinitialization!
- virtual int getkNNSamples() const { return nkNN; }
- virtual void setkNNSamples(int _nkNN) { nkNN = _nkNN; }
+ virtual int getkNNSamples() const CV_OVERRIDE { return nkNN; }
+ virtual void setkNNSamples(int _nkNN) CV_OVERRIDE { nkNN = _nkNN; }
- virtual double getDist2Threshold() const { return fTb; }
- virtual void setDist2Threshold(double _dist2Threshold) { fTb = (float)_dist2Threshold; }
+ virtual double getDist2Threshold() const CV_OVERRIDE { return fTb; }
+ virtual void setDist2Threshold(double _dist2Threshold) CV_OVERRIDE { fTb = (float)_dist2Threshold; }
- virtual bool getDetectShadows() const { return bShadowDetection; }
- virtual void setDetectShadows(bool detectshadows)
+ virtual bool getDetectShadows() const CV_OVERRIDE { return bShadowDetection; }
+ virtual void setDetectShadows(bool detectshadows) CV_OVERRIDE
{
if ((bShadowDetection && detectshadows) || (!bShadowDetection && !detectshadows))
return;
#endif
}
- virtual int getShadowValue() const { return nShadowDetection; }
- virtual void setShadowValue(int value) { nShadowDetection = (uchar)value; }
+ virtual int getShadowValue() const CV_OVERRIDE { return nShadowDetection; }
+ virtual void setShadowValue(int value) CV_OVERRIDE { nShadowDetection = (uchar)value; }
- virtual double getShadowThreshold() const { return fTau; }
- virtual void setShadowThreshold(double value) { fTau = (float)value; }
+ virtual double getShadowThreshold() const CV_OVERRIDE { return fTau; }
+ virtual void setShadowThreshold(double value) CV_OVERRIDE { fTau = (float)value; }
- virtual void write(FileStorage& fs) const
+ virtual void write(FileStorage& fs) const CV_OVERRIDE
{
writeFormat(fs);
fs << "name" << name_
<< "shadowThreshold" << fTau;
}
- virtual void read(const FileNode& fn)
+ virtual void read(const FileNode& fn) CV_OVERRIDE
{
CV_Assert( (String)fn["name"] == name_ );
history = (int)fn["history"];
m_nShadowDetection = _nShadowDetection;
}
- void operator()(const Range& range) const
+ void operator()(const Range& range) const CV_OVERRIDE
{
int y0 = range.start, y1 = range.end;
int ncols = src->cols, nchannels = src->channels();
static const float defaultfTau = 0.5f; // Tau - shadow threshold, see the paper for explanation
-class BackgroundSubtractorMOG2Impl : public BackgroundSubtractorMOG2
+class BackgroundSubtractorMOG2Impl CV_FINAL : public BackgroundSubtractorMOG2
{
public:
//! the default constructor
#endif
}
//! the destructor
- ~BackgroundSubtractorMOG2Impl() {}
+ ~BackgroundSubtractorMOG2Impl() CV_OVERRIDE {}
//! the update operator
- void apply(InputArray image, OutputArray fgmask, double learningRate=-1);
+ void apply(InputArray image, OutputArray fgmask, double learningRate) CV_OVERRIDE;
//! computes a background image which are the mean of all background gaussians
- virtual void getBackgroundImage(OutputArray backgroundImage) const;
+ virtual void getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE;
//! re-initiaization method
void initialize(Size _frameSize, int _frameType)
}
}
- virtual int getHistory() const { return history; }
- virtual void setHistory(int _nframes) { history = _nframes; }
+ virtual int getHistory() const CV_OVERRIDE { return history; }
+ virtual void setHistory(int _nframes) CV_OVERRIDE { history = _nframes; }
- virtual int getNMixtures() const { return nmixtures; }
- virtual void setNMixtures(int nmix) { nmixtures = nmix; }
+ virtual int getNMixtures() const CV_OVERRIDE { return nmixtures; }
+ virtual void setNMixtures(int nmix) CV_OVERRIDE { nmixtures = nmix; }
- virtual double getBackgroundRatio() const { return backgroundRatio; }
- virtual void setBackgroundRatio(double _backgroundRatio) { backgroundRatio = (float)_backgroundRatio; }
+ virtual double getBackgroundRatio() const CV_OVERRIDE { return backgroundRatio; }
+ virtual void setBackgroundRatio(double _backgroundRatio) CV_OVERRIDE { backgroundRatio = (float)_backgroundRatio; }
- virtual double getVarThreshold() const { return varThreshold; }
- virtual void setVarThreshold(double _varThreshold) { varThreshold = _varThreshold; }
+ virtual double getVarThreshold() const CV_OVERRIDE { return varThreshold; }
+ virtual void setVarThreshold(double _varThreshold) CV_OVERRIDE { varThreshold = _varThreshold; }
- virtual double getVarThresholdGen() const { return varThresholdGen; }
- virtual void setVarThresholdGen(double _varThresholdGen) { varThresholdGen = (float)_varThresholdGen; }
+ virtual double getVarThresholdGen() const CV_OVERRIDE { return varThresholdGen; }
+ virtual void setVarThresholdGen(double _varThresholdGen) CV_OVERRIDE { varThresholdGen = (float)_varThresholdGen; }
- virtual double getVarInit() const { return fVarInit; }
- virtual void setVarInit(double varInit) { fVarInit = (float)varInit; }
+ virtual double getVarInit() const CV_OVERRIDE { return fVarInit; }
+ virtual void setVarInit(double varInit) CV_OVERRIDE { fVarInit = (float)varInit; }
- virtual double getVarMin() const { return fVarMin; }
- virtual void setVarMin(double varMin) { fVarMin = (float)varMin; }
+ virtual double getVarMin() const CV_OVERRIDE { return fVarMin; }
+ virtual void setVarMin(double varMin) CV_OVERRIDE { fVarMin = (float)varMin; }
- virtual double getVarMax() const { return fVarMax; }
- virtual void setVarMax(double varMax) { fVarMax = (float)varMax; }
+ virtual double getVarMax() const CV_OVERRIDE { return fVarMax; }
+ virtual void setVarMax(double varMax) CV_OVERRIDE { fVarMax = (float)varMax; }
- virtual double getComplexityReductionThreshold() const { return fCT; }
- virtual void setComplexityReductionThreshold(double ct) { fCT = (float)ct; }
+ virtual double getComplexityReductionThreshold() const CV_OVERRIDE { return fCT; }
+ virtual void setComplexityReductionThreshold(double ct) CV_OVERRIDE { fCT = (float)ct; }
- virtual bool getDetectShadows() const { return bShadowDetection; }
- virtual void setDetectShadows(bool detectshadows)
+ virtual bool getDetectShadows() const CV_OVERRIDE { return bShadowDetection; }
+ virtual void setDetectShadows(bool detectshadows) CV_OVERRIDE
{
if ((bShadowDetection && detectshadows) || (!bShadowDetection && !detectshadows))
return;
#endif
}
- virtual int getShadowValue() const { return nShadowDetection; }
- virtual void setShadowValue(int value) { nShadowDetection = (uchar)value; }
+ virtual int getShadowValue() const CV_OVERRIDE { return nShadowDetection; }
+ virtual void setShadowValue(int value) CV_OVERRIDE { nShadowDetection = (uchar)value; }
- virtual double getShadowThreshold() const { return fTau; }
- virtual void setShadowThreshold(double value) { fTau = (float)value; }
+ virtual double getShadowThreshold() const CV_OVERRIDE { return fTau; }
+ virtual void setShadowThreshold(double value) CV_OVERRIDE { fTau = (float)value; }
- virtual void write(FileStorage& fs) const
+ virtual void write(FileStorage& fs) const CV_OVERRIDE
{
writeFormat(fs);
fs << "name" << name_
<< "shadowThreshold" << fTau;
}
- virtual void read(const FileNode& fn)
+ virtual void read(const FileNode& fn) CV_OVERRIDE
{
CV_Assert( (String)fn["name"] == name_ );
history = (int)fn["history"];
shadowVal = _shadowVal;
}
- void operator()(const Range& range) const
+ void operator()(const Range& range) const CV_OVERRIDE
{
int y0 = range.start, y1 = range.end;
int ncols = src->cols, nchannels = src->channels();
{
}
- virtual Size getWinSize() const {return winSize;}
- virtual void setWinSize(Size winSize_){winSize = winSize_;}
+ virtual Size getWinSize() const CV_OVERRIDE { return winSize;}
+ virtual void setWinSize(Size winSize_) CV_OVERRIDE { winSize = winSize_;}
- virtual int getMaxLevel() const {return maxLevel;}
- virtual void setMaxLevel(int maxLevel_){maxLevel = maxLevel_;}
+ virtual int getMaxLevel() const CV_OVERRIDE { return maxLevel;}
+ virtual void setMaxLevel(int maxLevel_) CV_OVERRIDE { maxLevel = maxLevel_;}
- virtual TermCriteria getTermCriteria() const {return criteria;}
- virtual void setTermCriteria(TermCriteria& crit_){criteria=crit_;}
+ virtual TermCriteria getTermCriteria() const CV_OVERRIDE { return criteria;}
+ virtual void setTermCriteria(TermCriteria& crit_) CV_OVERRIDE { criteria=crit_;}
- virtual int getFlags() const {return flags; }
- virtual void setFlags(int flags_){flags=flags_;}
+ virtual int getFlags() const CV_OVERRIDE { return flags; }
+ virtual void setFlags(int flags_) CV_OVERRIDE { flags=flags_;}
- virtual double getMinEigThreshold() const {return minEigThreshold;}
- virtual void setMinEigThreshold(double minEigThreshold_){minEigThreshold=minEigThreshold_;}
+ virtual double getMinEigThreshold() const CV_OVERRIDE { return minEigThreshold;}
+ virtual void setMinEigThreshold(double minEigThreshold_) CV_OVERRIDE { minEigThreshold=minEigThreshold_;}
virtual void calc(InputArray prevImg, InputArray nextImg,
InputArray prevPts, InputOutputArray nextPts,
OutputArray status,
- OutputArray err = cv::noArray());
+ OutputArray err = cv::noArray()) CV_OVERRIDE;
private:
#ifdef HAVE_OPENCL
Size _winSize, TermCriteria _criteria,
int _level, int _maxLevel, int _flags, float _minEigThreshold );
- void operator()(const Range& range) const;
+ void operator()(const Range& range) const CV_OVERRIDE;
const Mat* prevImg;
const Mat* nextImg;
{
}
- virtual int getNumLevels() const { return numLevels_; }
- virtual void setNumLevels(int numLevels) { numLevels_ = numLevels; }
+ virtual int getNumLevels() const CV_OVERRIDE { return numLevels_; }
+ virtual void setNumLevels(int numLevels) CV_OVERRIDE { numLevels_ = numLevels; }
- virtual double getPyrScale() const { return pyrScale_; }
- virtual void setPyrScale(double pyrScale) { pyrScale_ = pyrScale; }
+ virtual double getPyrScale() const CV_OVERRIDE { return pyrScale_; }
+ virtual void setPyrScale(double pyrScale) CV_OVERRIDE { pyrScale_ = pyrScale; }
- virtual bool getFastPyramids() const { return fastPyramids_; }
- virtual void setFastPyramids(bool fastPyramids) { fastPyramids_ = fastPyramids; }
+ virtual bool getFastPyramids() const CV_OVERRIDE { return fastPyramids_; }
+ virtual void setFastPyramids(bool fastPyramids) CV_OVERRIDE { fastPyramids_ = fastPyramids; }
- virtual int getWinSize() const { return winSize_; }
- virtual void setWinSize(int winSize) { winSize_ = winSize; }
+ virtual int getWinSize() const CV_OVERRIDE { return winSize_; }
+ virtual void setWinSize(int winSize) CV_OVERRIDE { winSize_ = winSize; }
- virtual int getNumIters() const { return numIters_; }
- virtual void setNumIters(int numIters) { numIters_ = numIters; }
+ virtual int getNumIters() const CV_OVERRIDE { return numIters_; }
+ virtual void setNumIters(int numIters) CV_OVERRIDE { numIters_ = numIters; }
- virtual int getPolyN() const { return polyN_; }
- virtual void setPolyN(int polyN) { polyN_ = polyN; }
+ virtual int getPolyN() const CV_OVERRIDE { return polyN_; }
+ virtual void setPolyN(int polyN) CV_OVERRIDE { polyN_ = polyN; }
- virtual double getPolySigma() const { return polySigma_; }
- virtual void setPolySigma(double polySigma) { polySigma_ = polySigma; }
+ virtual double getPolySigma() const CV_OVERRIDE { return polySigma_; }
+ virtual void setPolySigma(double polySigma) CV_OVERRIDE { polySigma_ = polySigma; }
- virtual int getFlags() const { return flags_; }
- virtual void setFlags(int flags) { flags_ = flags; }
+ virtual int getFlags() const CV_OVERRIDE { return flags_; }
+ virtual void setFlags(int flags) CV_OVERRIDE { flags_ = flags; }
- virtual void calc(InputArray I0, InputArray I1, InputOutputArray flow);
+ virtual void calc(InputArray I0, InputArray I1, InputOutputArray flow) CV_OVERRIDE;
private:
int numLevels_;
flowy = curFlowY;
return true;
}
- virtual void collectGarbage(){
+ virtual void collectGarbage() CV_OVERRIDE {
releaseMemory();
}
void releaseMemory()
return true;
}
#else // HAVE_OPENCL
- virtual void collectGarbage(){}
+ virtual void collectGarbage() CV_OVERRIDE {}
#endif
};
}
OpticalFlowDual_TVL1();
- void calc(InputArray I0, InputArray I1, InputOutputArray flow);
- void collectGarbage();
-
- CV_IMPL_PROPERTY(double, Tau, tau)
- CV_IMPL_PROPERTY(double, Lambda, lambda)
- CV_IMPL_PROPERTY(double, Theta, theta)
- CV_IMPL_PROPERTY(double, Gamma, gamma)
- CV_IMPL_PROPERTY(int, ScalesNumber, nscales)
- CV_IMPL_PROPERTY(int, WarpingsNumber, warps)
- CV_IMPL_PROPERTY(double, Epsilon, epsilon)
- CV_IMPL_PROPERTY(int, InnerIterations, innerIterations)
- CV_IMPL_PROPERTY(int, OuterIterations, outerIterations)
- CV_IMPL_PROPERTY(bool, UseInitialFlow, useInitialFlow)
- CV_IMPL_PROPERTY(double, ScaleStep, scaleStep)
- CV_IMPL_PROPERTY(int, MedianFiltering, medianFiltering)
+ void calc(InputArray I0, InputArray I1, InputOutputArray flow) CV_OVERRIDE;
+ void collectGarbage() CV_OVERRIDE;
+
+ inline double getTau() const CV_OVERRIDE { return tau; }
+ inline void setTau(double val) CV_OVERRIDE { tau = val; }
+ inline double getLambda() const CV_OVERRIDE { return lambda; }
+ inline void setLambda(double val) CV_OVERRIDE { lambda = val; }
+ inline double getTheta() const CV_OVERRIDE { return theta; }
+ inline void setTheta(double val) CV_OVERRIDE { theta = val; }
+ inline double getGamma() const CV_OVERRIDE { return gamma; }
+ inline void setGamma(double val) CV_OVERRIDE { gamma = val; }
+ inline int getScalesNumber() const CV_OVERRIDE { return nscales; }
+ inline void setScalesNumber(int val) CV_OVERRIDE { nscales = val; }
+ inline int getWarpingsNumber() const CV_OVERRIDE { return warps; }
+ inline void setWarpingsNumber(int val) CV_OVERRIDE { warps = val; }
+ inline double getEpsilon() const CV_OVERRIDE { return epsilon; }
+ inline void setEpsilon(double val) CV_OVERRIDE { epsilon = val; }
+ inline int getInnerIterations() const CV_OVERRIDE { return innerIterations; }
+ inline void setInnerIterations(int val) CV_OVERRIDE { innerIterations = val; }
+ inline int getOuterIterations() const CV_OVERRIDE { return outerIterations; }
+ inline void setOuterIterations(int val) CV_OVERRIDE { outerIterations = val; }
+ inline bool getUseInitialFlow() const CV_OVERRIDE { return useInitialFlow; }
+ inline void setUseInitialFlow(bool val) CV_OVERRIDE { useInitialFlow = val; }
+ inline double getScaleStep() const CV_OVERRIDE { return scaleStep; }
+ inline void setScaleStep(double val) CV_OVERRIDE { scaleStep = val; }
+ inline int getMedianFiltering() const CV_OVERRIDE { return medianFiltering; }
+ inline void setMedianFiltering(int val) CV_OVERRIDE { medianFiltering = val; }
protected:
double tau;
struct BuildFlowMapBody : ParallelLoopBody
{
- void operator() (const Range& range) const;
+ void operator() (const Range& range) const CV_OVERRIDE;
Mat_<float> u1;
Mat_<float> u2;
struct CenteredGradientBody : ParallelLoopBody
{
- void operator() (const Range& range) const;
+ void operator() (const Range& range) const CV_OVERRIDE;
Mat_<float> src;
mutable Mat_<float> dx;
struct ForwardGradientBody : ParallelLoopBody
{
- void operator() (const Range& range) const;
+ void operator() (const Range& range) const CV_OVERRIDE;
Mat_<float> src;
mutable Mat_<float> dx;
struct DivergenceBody : ParallelLoopBody
{
- void operator() (const Range& range) const;
+ void operator() (const Range& range) const CV_OVERRIDE;
Mat_<float> v1;
Mat_<float> v2;
struct CalcGradRhoBody : ParallelLoopBody
{
- void operator() (const Range& range) const;
+ void operator() (const Range& range) const CV_OVERRIDE;
Mat_<float> I0;
Mat_<float> I1w;
struct EstimateVBody : ParallelLoopBody
{
- void operator() (const Range& range) const;
+ void operator() (const Range& range) const CV_OVERRIDE;
Mat_<float> I1wx;
Mat_<float> I1wy;
struct EstimateDualVariablesBody : ParallelLoopBody
{
- void operator() (const Range& range) const;
+ void operator() (const Range& range) const CV_OVERRIDE;
Mat_<float> u1x;
Mat_<float> u1y;