diff --git a/modules/aruco/src/aruco.cpp b/modules/aruco/src/aruco.cpp index 236e9949f..7b29977e2 100644 --- a/modules/aruco/src/aruco.cpp +++ b/modules/aruco/src/aruco.cpp @@ -293,7 +293,7 @@ class DetectInitialCandidatesParallel : public ParallelLoopBody { : grey(_grey), candidatesArrays(_candidatesArrays), contoursArrays(_contoursArrays), params(_params) {} - void operator()(const Range &range) const { + void operator()(const Range &range) const CV_OVERRIDE { const int begin = range.start; const int end = range.end; @@ -547,7 +547,7 @@ class IdentifyCandidatesParallel : public ParallelLoopBody { : grey(_grey), candidates(_candidates), dictionary(_dictionary), idsTmp(_idsTmp), validCandidates(_validCandidates), params(_params) {} - void operator()(const Range &range) const { + void operator()(const Range &range) const CV_OVERRIDE { const int begin = range.start; const int end = range.end; @@ -773,7 +773,7 @@ class MarkerSubpixelParallel : public ParallelLoopBody { const Ptr &_params) : grey(_grey), corners(_corners), params(_params) {} - void operator()(const Range &range) const { + void operator()(const Range &range) const CV_OVERRIDE { const int begin = range.start; const int end = range.end; @@ -946,7 +946,7 @@ class MarkerContourParallel : public ParallelLoopBody { MarkerContourParallel( vector< vector< Point > >& _contours, vector< vector< Point2f > >& _candidates, const Mat& _camMatrix, const Mat& _distCoeff) : contours(_contours), candidates(_candidates), camMatrix(_camMatrix), distCoeff(_distCoeff){} - void operator()(const Range &range) const { + void operator()(const Range &range) const CV_OVERRIDE { for(int i = range.start; i < range.end; i++) { _refineCandidateLines(contours[i], candidates[i], camMatrix, distCoeff); @@ -1179,7 +1179,7 @@ class SinglePoseEstimationParallel : public ParallelLoopBody { : markerObjPoints(_markerObjPoints), corners(_corners), cameraMatrix(_cameraMatrix), distCoeffs(_distCoeffs), rvecs(_rvecs), tvecs(_tvecs) {} - void operator()(const Range &range) const { + void operator()(const Range &range) const CV_OVERRIDE { const int begin = range.start; const int end = range.end; diff --git a/modules/aruco/src/charuco.cpp b/modules/aruco/src/charuco.cpp index 69d362dc2..e2b547704 100644 --- a/modules/aruco/src/charuco.cpp +++ b/modules/aruco/src/charuco.cpp @@ -282,7 +282,7 @@ class CharucoSubpixelParallel : public ParallelLoopBody { : grey(_grey), filteredChessboardImgPoints(_filteredChessboardImgPoints), filteredWinSizes(_filteredWinSizes), params(_params) {} - void operator()(const Range &range) const { + void operator()(const Range &range) const CV_OVERRIDE { const int begin = range.start; const int end = range.end; diff --git a/modules/bgsegm/include/opencv2/bgsegm.hpp b/modules/bgsegm/include/opencv2/bgsegm.hpp index 011592a44..8ace5d9a5 100644 --- a/modules/bgsegm/include/opencv2/bgsegm.hpp +++ b/modules/bgsegm/include/opencv2/bgsegm.hpp @@ -196,8 +196,8 @@ class CV_EXPORTS_W BackgroundSubtractorCNT : public BackgroundSubtractor { public: // BackgroundSubtractor interface - CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) = 0; - CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const = 0; + CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) CV_OVERRIDE = 0; + CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE = 0; /** @brief Returns number of frames with same pixel color to consider stable. */ @@ -255,9 +255,9 @@ class CV_EXPORTS_W BackgroundSubtractorGSOC : public BackgroundSubtractor { public: // BackgroundSubtractor interface - 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; - CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const = 0; + CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE = 0; }; /** @brief Background Subtraction using Local SVD Binary Pattern. More details about the algorithm can be found at @cite LGuo2016 @@ -266,9 +266,9 @@ class CV_EXPORTS_W BackgroundSubtractorLSBP : public BackgroundSubtractor { public: // BackgroundSubtractor interface - 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; - CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const = 0; + CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE = 0; }; /** @brief This is for calculation of the LSBP descriptors. diff --git a/modules/bgsegm/src/bgfg_gaussmix.cpp b/modules/bgsegm/src/bgfg_gaussmix.cpp index 9e9d448da..d6c167689 100644 --- a/modules/bgsegm/src/bgfg_gaussmix.cpp +++ b/modules/bgsegm/src/bgfg_gaussmix.cpp @@ -69,7 +69,7 @@ static const double defaultVarThreshold = 2.5*2.5; static const double defaultNoiseSigma = 30*0.5; static const double defaultInitialWeight = 0.05; -class BackgroundSubtractorMOGImpl : public BackgroundSubtractorMOG +class BackgroundSubtractorMOGImpl CV_FINAL : public BackgroundSubtractorMOG { public: //! the default constructor @@ -102,7 +102,7 @@ public: } //! the update operator - virtual void apply(InputArray image, OutputArray fgmask, double learningRate=0); + virtual void apply(InputArray image, OutputArray fgmask, double learningRate=0) CV_OVERRIDE; //! re-initiaization method virtual void initialize(Size _frameSize, int _frameType) @@ -122,24 +122,24 @@ public: bgmodel = Scalar::all(0); } - virtual void getBackgroundImage(OutputArray) const + virtual void getBackgroundImage(OutputArray) const CV_OVERRIDE { CV_Error( Error::StsNotImplemented, "" ); } - 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 = _backgroundRatio; } + virtual double getBackgroundRatio() const CV_OVERRIDE { return backgroundRatio; } + virtual void setBackgroundRatio(double _backgroundRatio) CV_OVERRIDE { backgroundRatio = _backgroundRatio; } - virtual double getNoiseSigma() const { return noiseSigma; } - virtual void setNoiseSigma(double _noiseSigma) { noiseSigma = _noiseSigma; } + virtual double getNoiseSigma() const CV_OVERRIDE { return noiseSigma; } + virtual void setNoiseSigma(double _noiseSigma) CV_OVERRIDE { noiseSigma = _noiseSigma; } - virtual void write(FileStorage& fs) const + virtual void write(FileStorage& fs) const CV_OVERRIDE { fs << "name" << name_ << "history" << history @@ -148,7 +148,7 @@ public: << "noiseSigma" << noiseSigma; } - virtual void read(const FileNode& fn) + virtual void read(const FileNode& fn) CV_OVERRIDE { CV_Assert( (String)fn["name"] == name_ ); history = (int)fn["history"]; diff --git a/modules/bgsegm/src/bgfg_gmg.cpp b/modules/bgsegm/src/bgfg_gmg.cpp index 5036f1968..353b8718c 100644 --- a/modules/bgsegm/src/bgfg_gmg.cpp +++ b/modules/bgsegm/src/bgfg_gmg.cpp @@ -57,7 +57,7 @@ namespace cv namespace bgsegm { -class BackgroundSubtractorGMGImpl : public BackgroundSubtractorGMG +class BackgroundSubtractorGMGImpl CV_FINAL : public BackgroundSubtractorGMG { public: BackgroundSubtractorGMGImpl() @@ -96,49 +96,49 @@ public: * @param image Input image * @param fgmask Output mask image representing foreground and background pixels */ - virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1.0); + virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1.0) CV_OVERRIDE; /** * Releases all inner buffers. */ void release(); - virtual int getMaxFeatures() const { return maxFeatures; } - virtual void setMaxFeatures(int _maxFeatures) { maxFeatures = _maxFeatures; } + virtual int getMaxFeatures() const CV_OVERRIDE { return maxFeatures; } + virtual void setMaxFeatures(int _maxFeatures) CV_OVERRIDE { maxFeatures = _maxFeatures; } - virtual double getDefaultLearningRate() const { return learningRate; } - virtual void setDefaultLearningRate(double lr) { learningRate = lr; } + virtual double getDefaultLearningRate() const CV_OVERRIDE { return learningRate; } + virtual void setDefaultLearningRate(double lr) CV_OVERRIDE { learningRate = lr; } - virtual int getNumFrames() const { return numInitializationFrames; } - virtual void setNumFrames(int nframes) { numInitializationFrames = nframes; } + virtual int getNumFrames() const CV_OVERRIDE { return numInitializationFrames; } + virtual void setNumFrames(int nframes) CV_OVERRIDE { numInitializationFrames = nframes; } - virtual int getQuantizationLevels() const { return quantizationLevels; } - virtual void setQuantizationLevels(int nlevels) { quantizationLevels = nlevels; } + virtual int getQuantizationLevels() const CV_OVERRIDE { return quantizationLevels; } + virtual void setQuantizationLevels(int nlevels) CV_OVERRIDE { quantizationLevels = nlevels; } - virtual double getBackgroundPrior() const { return backgroundPrior; } - virtual void setBackgroundPrior(double bgprior) { backgroundPrior = bgprior; } + virtual double getBackgroundPrior() const CV_OVERRIDE { return backgroundPrior; } + virtual void setBackgroundPrior(double bgprior) CV_OVERRIDE { backgroundPrior = bgprior; } - virtual int getSmoothingRadius() const { return smoothingRadius; } - virtual void setSmoothingRadius(int radius) { smoothingRadius = radius; } + virtual int getSmoothingRadius() const CV_OVERRIDE { return smoothingRadius; } + virtual void setSmoothingRadius(int radius) CV_OVERRIDE { smoothingRadius = radius; } - virtual double getDecisionThreshold() const { return decisionThreshold; } - virtual void setDecisionThreshold(double thresh) { decisionThreshold = thresh; } + virtual double getDecisionThreshold() const CV_OVERRIDE { return decisionThreshold; } + virtual void setDecisionThreshold(double thresh) CV_OVERRIDE { decisionThreshold = thresh; } - virtual bool getUpdateBackgroundModel() const { return updateBackgroundModel; } - virtual void setUpdateBackgroundModel(bool update) { updateBackgroundModel = update; } + virtual bool getUpdateBackgroundModel() const CV_OVERRIDE { return updateBackgroundModel; } + virtual void setUpdateBackgroundModel(bool update) CV_OVERRIDE { updateBackgroundModel = update; } - virtual double getMinVal() const { return minVal_; } - virtual void setMinVal(double val) { minVal_ = val; } + virtual double getMinVal() const CV_OVERRIDE { return minVal_; } + virtual void setMinVal(double val) CV_OVERRIDE { minVal_ = val; } - virtual double getMaxVal() const { return maxVal_; } - virtual void setMaxVal(double val) { maxVal_ = val; } + virtual double getMaxVal() const CV_OVERRIDE { return maxVal_; } + virtual void setMaxVal(double val) CV_OVERRIDE { maxVal_ = val; } - virtual void getBackgroundImage(OutputArray backgroundImage) const + virtual void getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE { backgroundImage.release(); } - virtual void write(FileStorage& fs) const + virtual void write(FileStorage& fs) const CV_OVERRIDE { fs << "name" << name_ << "maxFeatures" << maxFeatures @@ -152,7 +152,7 @@ public: // we do not save minVal_ & maxVal_, since they depend on the image type. } - virtual void read(const FileNode& fn) + virtual void read(const FileNode& fn) CV_OVERRIDE { CV_Assert( (String)fn["name"] == name_ ); maxFeatures = (int)fn["maxFeatures"]; @@ -323,7 +323,7 @@ public: { } - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; private: Mat frame_; diff --git a/modules/bgsegm/src/bgfg_gsoc.cpp b/modules/bgsegm/src/bgfg_gsoc.cpp index 8b5c76e66..f81eca9c8 100644 --- a/modules/bgsegm/src/bgfg_gsoc.cpp +++ b/modules/bgsegm/src/bgfg_gsoc.cpp @@ -364,7 +364,7 @@ private: public: ParallelLocalSVDValues(const Size& _sz, Mat& _localSVDValues, const Mat& _frameGray) : sz(_sz), localSVDValues(_localSVDValues), frameGray(_frameGray) {}; - void operator()(const Range &range) const { + void operator()(const Range &range) const CV_OVERRIDE { for (int i = range.start; i < range.end; ++i) for (int j = 1; j < sz.width - 1; ++j) { localSVDValues.at(i, j) = localSVD( @@ -387,7 +387,7 @@ private: public: ParallelFromLocalSVDValues(const Size& _sz, Mat& _desc, const Mat& _localSVDValues, const Point2i* _LSBPSamplePoints) : sz(_sz), desc(_desc), localSVDValues(_localSVDValues), LSBPSamplePoints(_LSBPSamplePoints) {}; - void operator()(const Range &range) const { + void operator()(const Range &range) const CV_OVERRIDE { for (int index = range.start; index < range.end; ++index) { const int i = index / sz.width, j = index % sz.width; int& descVal = desc.at(i, j); @@ -455,7 +455,7 @@ void BackgroundSubtractorLSBPDesc::compute(OutputArray desc, const Mat& frame, c computeFromLocalSVDValues(desc, localSVDValues, LSBPSamplePoints); } -class BackgroundSubtractorGSOCImpl : public BackgroundSubtractorGSOC { +class BackgroundSubtractorGSOCImpl CV_FINAL : public BackgroundSubtractorGSOC { private: Ptr backgroundModel; Ptr backgroundModelPrev; @@ -492,14 +492,14 @@ public: float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG); - CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate = -1); + CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate = -1) CV_OVERRIDE; - CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const; + CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE; friend class ParallelGSOC; }; -class BackgroundSubtractorLSBPImpl : public BackgroundSubtractorLSBP { +class BackgroundSubtractorLSBPImpl CV_FINAL : public BackgroundSubtractorLSBP { private: Ptr backgroundModel; Ptr backgroundModelPrev; @@ -540,9 +540,9 @@ public: int minCount ); - CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate = -1); + CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate = -1) CV_OVERRIDE; - CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const; + CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE; friend class ParallelLSBP; }; @@ -561,7 +561,7 @@ public: ParallelGSOC(const Size& _sz, BackgroundSubtractorGSOCImpl* _bgs, const Mat& _frame, double _learningRate, Mat& _fgMask) : sz(_sz), bgs(_bgs), frame(_frame), learningRate(_learningRate), fgMask(_fgMask) {}; - void operator()(const Range &range) const { + void operator()(const Range &range) const CV_OVERRIDE { BackgroundModelGSOC* backgroundModel = bgs->backgroundModel.get(); Mat& distMovingAvg = bgs->distMovingAvg; @@ -621,7 +621,7 @@ public: ParallelLSBP(const Size& _sz, BackgroundSubtractorLSBPImpl* _bgs, const Mat& _frame, double _learningRate, const Mat& _LSBPDesc, Mat& _fgMask) : sz(_sz), bgs(_bgs), frame(_frame), learningRate(_learningRate), LSBPDesc(_LSBPDesc), fgMask(_fgMask) {}; - void operator()(const Range &range) const { + void operator()(const Range &range) const CV_OVERRIDE { BackgroundModelLSBP* backgroundModel = bgs->backgroundModel.get(); Mat& T = bgs->T; Mat& R = bgs->R; diff --git a/modules/bgsegm/src/bgfg_subcnt.cpp b/modules/bgsegm/src/bgfg_subcnt.cpp index 1e2a1a3f6..1638de50e 100644 --- a/modules/bgsegm/src/bgfg_subcnt.cpp +++ b/modules/bgsegm/src/bgfg_subcnt.cpp @@ -50,7 +50,7 @@ namespace cv namespace bgsegm { -class BackgroundSubtractorCNTImpl: public BackgroundSubtractorCNT +class BackgroundSubtractorCNTImpl CV_FINAL : public BackgroundSubtractorCNT { public: @@ -60,20 +60,20 @@ public: bool isParallel); // BackgroundSubtractor interface - virtual void apply(InputArray image, OutputArray fgmask, double learningRate); - virtual void getBackgroundImage(OutputArray backgroundImage) const; + virtual void apply(InputArray image, OutputArray fgmask, double learningRate) CV_OVERRIDE; + virtual void getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE; - int getMinPixelStability() const; - void setMinPixelStability(int value); + int getMinPixelStability() const CV_OVERRIDE; + void setMinPixelStability(int value) CV_OVERRIDE; - int getMaxPixelStability() const; - void setMaxPixelStability(int value); + int getMaxPixelStability() const CV_OVERRIDE; + void setMaxPixelStability(int value) CV_OVERRIDE; - bool getUseHistory() const; - void setUseHistory(bool value); + bool getUseHistory() const CV_OVERRIDE; + void setUseHistory(bool value) CV_OVERRIDE; - bool getIsParallel() const; - void setIsParallel(bool value); + bool getIsParallel() const CV_OVERRIDE; + void setIsParallel(bool value) CV_OVERRIDE; //! the destructor virtual ~BackgroundSubtractorCNTImpl() {} @@ -185,7 +185,7 @@ struct BGSubtractPixel : public CNTFunctor //! the destructor virtual ~BGSubtractPixel() {} - void operator()(Vec4i &vec, uchar currColor, uchar prevColor, uchar &fgMaskPixelRef) + void operator()(Vec4i &vec, uchar currColor, uchar prevColor, uchar &fgMaskPixelRef) CV_OVERRIDE { int &stabilityRef = vec[0]; int &bgImgRef = vec[3]; @@ -248,7 +248,7 @@ struct BGSubtractPixelWithHistory : public CNTFunctor } } - void operator()(Vec4i &vec, uchar currColor, uchar prevColor, uchar &fgMaskPixelRef) + void operator()(Vec4i &vec, uchar currColor, uchar prevColor, uchar &fgMaskPixelRef) CV_OVERRIDE { int &stabilityRef = vec[0]; int &historyColorRef = vec[1]; @@ -316,7 +316,7 @@ public: } // Iterate rows - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { for (int r = range.start; r < range.end; ++r) { diff --git a/modules/bioinspired/include/opencv2/bioinspired/retina.hpp b/modules/bioinspired/include/opencv2/bioinspired/retina.hpp index d76aaba9d..d97a80f6f 100644 --- a/modules/bioinspired/include/opencv2/bioinspired/retina.hpp +++ b/modules/bioinspired/include/opencv2/bioinspired/retina.hpp @@ -146,7 +146,7 @@ enum { @endcode */ - struct RetinaParameters{ + struct RetinaParameters{ //! Outer Plexiform Layer (OPL) and Inner Plexiform Layer Parvocellular (IplParvo) parameters struct OPLandIplParvoParameters{ OPLandIplParvoParameters():colorMode(true), @@ -208,7 +208,7 @@ class CV_EXPORTS_W Retina : public Algorithm { public: - + /** @brief Retreive retina input buffer size @return the retina input buffer size */ @@ -260,7 +260,7 @@ public: CV_WRAP virtual void write( String fs ) const=0; /** @overload */ - virtual void write( FileStorage& fs ) const=0; + virtual void write( FileStorage& fs ) const CV_OVERRIDE = 0; /** @brief Setup the OPL and IPL parvo channels (see biologocal model) diff --git a/modules/bioinspired/include/opencv2/bioinspired/transientareassegmentationmodule.hpp b/modules/bioinspired/include/opencv2/bioinspired/transientareassegmentationmodule.hpp index 5d3c358bd..115269e29 100755 --- a/modules/bioinspired/include/opencv2/bioinspired/transientareassegmentationmodule.hpp +++ b/modules/bioinspired/include/opencv2/bioinspired/transientareassegmentationmodule.hpp @@ -80,7 +80,7 @@ namespace bioinspired /** @brief parameter structure that stores the transient events detector setup parameters */ struct SegmentationParameters{ // CV_EXPORTS_W_MAP to export to python native dictionnaries - // default structure instance construction with default values + // default structure instance construction with default values SegmentationParameters(): thresholdON(100), thresholdOFF(100), @@ -171,7 +171,7 @@ public: /** @brief write xml/yml formated parameters information @param fs : a cv::Filestorage object ready to be filled */ - virtual void write( cv::FileStorage& fs ) const=0; + virtual void write( cv::FileStorage& fs ) const CV_OVERRIDE = 0; /** @brief main processing method, get result using methods getSegmentationPicture() @param inputToSegment : the image to process, it must match the instance buffer size ! diff --git a/modules/bioinspired/src/basicretinafilter.hpp b/modules/bioinspired/src/basicretinafilter.hpp index 6daa49b39..66551dafc 100644 --- a/modules/bioinspired/src/basicretinafilter.hpp +++ b/modules/bioinspired/src/basicretinafilter.hpp @@ -487,7 +487,7 @@ namespace bioinspired #endif } - virtual void operator()( const Range& r ) const { + virtual void operator()( const Range& r ) const CV_OVERRIDE { #ifdef DEBUG_TBB std::cout<<"Parallel_horizontalAnticausalFilter::operator() :" @@ -520,7 +520,7 @@ namespace bioinspired Parallel_horizontalCausalFilter_addInput(const float *bufferToAddAsInputProcess, float *bufferToProcess, const unsigned int idStart, const unsigned int nbCols, const float a, const float tau) :inputFrame(bufferToAddAsInputProcess), outputFrame(bufferToProcess), IDrowStart(idStart), nbColumns(nbCols), filterParam_a(a), filterParam_tau(tau){} - virtual void operator()( const Range& r ) const { + virtual void operator()( const Range& r ) const CV_OVERRIDE { for (int IDrow=r.start; IDrow!=r.end; ++IDrow) { float* outputPTR=outputFrame+(IDrowStart+IDrow)*nbColumns; @@ -545,7 +545,7 @@ namespace bioinspired Parallel_verticalCausalFilter(float *bufferToProcess, const unsigned int nbRws, const unsigned int nbCols, const float a ) :outputFrame(bufferToProcess), nbRows(nbRws), nbColumns(nbCols), filterParam_a(a){} - virtual void operator()( const Range& r ) const { + virtual void operator()( const Range& r ) const CV_OVERRIDE { for (int IDcolumn=r.start; IDcolumn!=r.end; ++IDcolumn) { float result=0; @@ -572,7 +572,7 @@ namespace bioinspired Parallel_verticalAnticausalFilter_multGain(float *bufferToProcess, const unsigned int nbRws, const unsigned int nbCols, const float a, const float gain) :outputFrame(bufferToProcess), nbRows(nbRws), nbColumns(nbCols), filterParam_a(a), filterParam_gain(gain){} - virtual void operator()( const Range& r ) const { + virtual void operator()( const Range& r ) const CV_OVERRIDE { float* offset=outputFrame+nbColumns*nbRows-nbColumns; for (int IDcolumn=r.start; IDcolumn!=r.end; ++IDcolumn) { @@ -600,7 +600,7 @@ namespace bioinspired Parallel_localAdaptation(const float *localLum, const float *inputImg, float *bufferToProcess, const float localLuminanceFact, const float localLuminanceAdd, const float maxInputVal) :localLuminance(localLum), inputFrame(inputImg),outputFrame(bufferToProcess), localLuminanceFactor(localLuminanceFact), localLuminanceAddon(localLuminanceAdd), maxInputValue(maxInputVal) {} - virtual void operator()( const Range& r ) const { + virtual void operator()( const Range& r ) const CV_OVERRIDE { const float *localLuminancePTR=localLuminance+r.start; const float *inputFramePTR=inputFrame+r.start; float *outputFramePTR=outputFrame+r.start; @@ -626,7 +626,7 @@ namespace bioinspired Parallel_horizontalAnticausalFilter_Irregular(float *bufferToProcess, const float *spatialConst, const unsigned int idEnd, const unsigned int nbCols) :outputFrame(bufferToProcess), spatialConstantBuffer(spatialConst), IDrowEnd(idEnd), nbColumns(nbCols){} - virtual void operator()( const Range& r ) const { + virtual void operator()( const Range& r ) const CV_OVERRIDE { for (int IDrow=r.start; IDrow!=r.end; ++IDrow) { @@ -652,7 +652,7 @@ namespace bioinspired Parallel_verticalCausalFilter_Irregular(float *bufferToProcess, const float *spatialConst, const unsigned int nbRws, const unsigned int nbCols) :outputFrame(bufferToProcess), spatialConstantBuffer(spatialConst), nbRows(nbRws), nbColumns(nbCols){} - virtual void operator()( const Range& r ) const { + virtual void operator()( const Range& r ) const CV_OVERRIDE { for (int IDcolumn=r.start; IDcolumn!=r.end; ++IDcolumn) { float result=0; diff --git a/modules/bioinspired/src/magnoretinafilter.hpp b/modules/bioinspired/src/magnoretinafilter.hpp index 96d48ab74..eb8d0c3ff 100644 --- a/modules/bioinspired/src/magnoretinafilter.hpp +++ b/modules/bioinspired/src/magnoretinafilter.hpp @@ -211,7 +211,7 @@ namespace bioinspired Parallel_amacrineCellsComputing(const float *OPL_ON_PTR, const float *OPL_OFF_PTR, float *previousInput_ON_PTR, float *previousInput_OFF_PTR, float *amacrinCellsTempOutput_ON_PTR, float *amacrinCellsTempOutput_OFF_PTR, float temporalCoefficientVal) :OPL_ON(OPL_ON_PTR), OPL_OFF(OPL_OFF_PTR), previousInput_ON(previousInput_ON_PTR), previousInput_OFF(previousInput_OFF_PTR), amacrinCellsTempOutput_ON(amacrinCellsTempOutput_ON_PTR), amacrinCellsTempOutput_OFF(amacrinCellsTempOutput_OFF_PTR), temporalCoefficient(temporalCoefficientVal) {} - virtual void operator()( const Range& r ) const { + virtual void operator()( const Range& r ) const CV_OVERRIDE { const float *OPL_ON_PTR=OPL_ON+r.start; const float *OPL_OFF_PTR=OPL_OFF+r.start; float *previousInput_ON_PTR= previousInput_ON+r.start; diff --git a/modules/bioinspired/src/parvoretinafilter.hpp b/modules/bioinspired/src/parvoretinafilter.hpp index 4fa8e8be9..5f7fff127 100644 --- a/modules/bioinspired/src/parvoretinafilter.hpp +++ b/modules/bioinspired/src/parvoretinafilter.hpp @@ -234,7 +234,7 @@ private: Parallel_OPL_OnOffWaysComputing(float *photoreceptorsOutput_PTR, float *horizontalCellsOutput_PTR, float *bipolarCellsON_PTR, float *bipolarCellsOFF_PTR, float *parvocellularOutputON_PTR, float *parvocellularOutputOFF_PTR) :photoreceptorsOutput(photoreceptorsOutput_PTR), horizontalCellsOutput(horizontalCellsOutput_PTR), bipolarCellsON(bipolarCellsON_PTR), bipolarCellsOFF(bipolarCellsOFF_PTR), parvocellularOutputON(parvocellularOutputON_PTR), parvocellularOutputOFF(parvocellularOutputOFF_PTR) {} - virtual void operator()( const Range& r ) const { + virtual void operator()( const Range& r ) const CV_OVERRIDE { // compute bipolar cells response equal to photoreceptors minus horizontal cells response // and copy the result on parvo cellular outputs... keeping time before their local contrast adaptation for final result float *photoreceptorsOutput_PTR= photoreceptorsOutput+r.start; diff --git a/modules/bioinspired/src/retina.cpp b/modules/bioinspired/src/retina.cpp index 9724b1632..f856683bc 100644 --- a/modules/bioinspired/src/retina.cpp +++ b/modules/bioinspired/src/retina.cpp @@ -80,7 +80,7 @@ namespace cv namespace bioinspired { -class RetinaImpl : public Retina +class RetinaImpl CV_FINAL : public Retina { public: /** @@ -100,16 +100,16 @@ public: */ RetinaImpl(const Size inputSize, const bool colorMode, int colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const float reductionFactor=1.0f, const float samplingStrenght=10.0f); - virtual ~RetinaImpl(); + virtual ~RetinaImpl() CV_OVERRIDE; /** * retreive retina input buffer size */ - Size getInputSize(); + Size getInputSize() CV_OVERRIDE; /** * retreive retina output buffer size */ - Size getOutputSize(); + Size getOutputSize() CV_OVERRIDE; /** * try to open an XML retina parameters file to adjust current retina instance setup @@ -118,7 +118,7 @@ public: * @param retinaParameterFile : the parameters filename * @param applyDefaultSetupOnFailure : set to true if an error must be thrown on error */ - void setup(String retinaParameterFile="", const bool applyDefaultSetupOnFailure=true); + void setup(String retinaParameterFile="", const bool applyDefaultSetupOnFailure=true) CV_OVERRIDE; /** @@ -128,7 +128,7 @@ public: * @param fs : the open Filestorage which contains retina parameters * @param applyDefaultSetupOnFailure : set to true if an error must be thrown on error */ - void setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailure=true); + void setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailure=true) CV_OVERRIDE; /** * try to open an XML retina parameters file to adjust current retina instance setup @@ -137,31 +137,31 @@ public: * @param newParameters : a parameters structures updated with the new target configuration * @param applyDefaultSetupOnFailure : set to true if an error must be thrown on error */ - void setup(RetinaParameters newParameters); + void setup(RetinaParameters newParameters) CV_OVERRIDE; /** * @return the current parameters setup */ - struct RetinaParameters getParameters(); + struct RetinaParameters getParameters() CV_OVERRIDE; /** * parameters setup display method * @return a string which contains formatted parameters information */ - const String printSetup(); + const String printSetup() CV_OVERRIDE; /** * write xml/yml formated parameters information * @rparam fs : the filename of the xml file that will be open and writen with formatted parameters information */ - virtual void write( String fs ) const; + virtual void write( String fs ) const CV_OVERRIDE; /** * write xml/yml formated parameters information * @param fs : a cv::Filestorage object ready to be filled */ - virtual void write( FileStorage& fs ) const; + virtual void write( FileStorage& fs ) const CV_OVERRIDE; /** * setup the OPL and IPL parvo channels (see biologocal model) @@ -178,7 +178,7 @@ public: * @param HcellsSpatialConstant: the spatial constant of the first order low pass filter of the horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels, typical value is 5 pixel, this value is also used for local contrast computing when computing the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular channel model) * @param ganglionCellsSensitivity: the compression strengh of the ganglion cells local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 230 */ - void setupOPLandIPLParvoChannel(const bool colorMode=true, const bool normaliseOutput = true, const float photoreceptorsLocalAdaptationSensitivity=0.7f, const float photoreceptorsTemporalConstant=0.5f, const float photoreceptorsSpatialConstant=0.53f, const float horizontalCellsGain=0.f, const float HcellsTemporalConstant=1.f, const float HcellsSpatialConstant=7.f, const float ganglionCellsSensitivity=0.7f); + void setupOPLandIPLParvoChannel(const bool colorMode=true, const bool normaliseOutput = true, const float photoreceptorsLocalAdaptationSensitivity=0.7f, const float photoreceptorsTemporalConstant=0.5f, const float photoreceptorsSpatialConstant=0.53f, const float horizontalCellsGain=0.f, const float HcellsTemporalConstant=1.f, const float HcellsSpatialConstant=7.f, const float ganglionCellsSensitivity=0.7f) CV_OVERRIDE; /** * set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel @@ -192,13 +192,13 @@ public: * @param localAdaptintegration_tau: specifies the temporal constant of the low pas filter involved in the computation of the local "motion mean" for the local adaptation computation * @param localAdaptintegration_k: specifies the spatial constant of the low pas filter involved in the computation of the local "motion mean" for the local adaptation computation */ - void setupIPLMagnoChannel(const bool normaliseOutput = true, const float parasolCells_beta=0.f, const float parasolCells_tau=0.f, const float parasolCells_k=7.f, const float amacrinCellsTemporalCutFrequency=1.2f, const float V0CompressionParameter=0.95f, const float localAdaptintegration_tau=0.f, const float localAdaptintegration_k=7.f); + void setupIPLMagnoChannel(const bool normaliseOutput = true, const float parasolCells_beta=0.f, const float parasolCells_tau=0.f, const float parasolCells_k=7.f, const float amacrinCellsTemporalCutFrequency=1.2f, const float V0CompressionParameter=0.95f, const float localAdaptintegration_tau=0.f, const float localAdaptintegration_k=7.f) CV_OVERRIDE; /** * method which allows retina to be applied on an input image, after run, encapsulated retina module is ready to deliver its outputs using dedicated acccessors, see getParvo and getMagno methods * @param inputImage : the input cv::Mat image to be processed, can be gray level or BGR coded in any format (from 8bit to 16bits) */ - void run(InputArray inputImage); + void run(InputArray inputImage) CV_OVERRIDE; /** * method that applies a luminance correction (initially High Dynamic Range (HDR) tone mapping) using only the 2 local adaptation stages of the retina parvo channel : photoreceptors level and ganlion cells level. Spatio temporal filtering is applied but limited to temporal smoothing and eventually high frequencies attenuation. This is a lighter method than the one available using the regular run method. It is then faster but it does not include complete temporal filtering nor retina spectral whitening. This is an adptation of the original still image HDR tone mapping algorithm of David Alleyson, Sabine Susstruck and Laurence Meylan's work, please cite: @@ -206,35 +206,35 @@ public: @param inputImage the input image to process RGB or gray levels @param outputToneMappedImage the output tone mapped image */ - void applyFastToneMapping(InputArray inputImage, OutputArray outputToneMappedImage); + void applyFastToneMapping(InputArray inputImage, OutputArray outputToneMappedImage) CV_OVERRIDE; /** * accessor of the details channel of the retina (models foveal vision) * @param retinaOutput_parvo : the output buffer (reallocated if necessary), this output is rescaled for standard 8bits image processing use in OpenCV */ - void getParvo(OutputArray retinaOutput_parvo); + void getParvo(OutputArray retinaOutput_parvo) CV_OVERRIDE; /** * accessor of the details channel of the retina (models foveal vision) * @param retinaOutput_parvo : a cv::Mat header filled with the internal parvo buffer of the retina module. This output is the original retina filter model output, without any quantification or rescaling */ - void getParvoRAW(OutputArray retinaOutput_parvo); + void getParvoRAW(OutputArray retinaOutput_parvo) CV_OVERRIDE; /** * accessor of the motion channel of the retina (models peripheral vision) * @param retinaOutput_magno : the output buffer (reallocated if necessary), this output is rescaled for standard 8bits image processing use in OpenCV */ - void getMagno(OutputArray retinaOutput_magno); + void getMagno(OutputArray retinaOutput_magno) CV_OVERRIDE; /** * accessor of the motion channel of the retina (models peripheral vision) * @param retinaOutput_magno : a cv::Mat header filled with the internal retina magno buffer of the retina module. This output is the original retina filter model output, without any quantification or rescaling */ - void getMagnoRAW(OutputArray retinaOutput_magno); + void getMagnoRAW(OutputArray retinaOutput_magno) CV_OVERRIDE; // original API level data accessors : get buffers addresses from a Mat header, similar to getParvoRAW and getMagnoRAW... - const Mat getMagnoRAW() const; - const Mat getParvoRAW() const; + const Mat getMagnoRAW() const CV_OVERRIDE; + const Mat getParvoRAW() const CV_OVERRIDE; /** * activate color saturation as the final step of the color demultiplexing process @@ -242,24 +242,24 @@ public: * @param saturateColors: boolean that activates color saturation (if true) or desactivate (if false) * @param colorSaturationValue: the saturation factor */ - void setColorSaturation(const bool saturateColors=true, const float colorSaturationValue=4.0f); + void setColorSaturation(const bool saturateColors=true, const float colorSaturationValue=4.0f) CV_OVERRIDE; /** * clear all retina buffers (equivalent to opening the eyes after a long period of eye close ;o) */ - void clearBuffers(); + void clearBuffers() CV_OVERRIDE; /** * Activate/desactivate the Magnocellular pathway processing (motion information extraction), by default, it is activated * @param activate: true if Magnocellular output should be activated, false if not */ - void activateMovingContoursProcessing(const bool activate); + void activateMovingContoursProcessing(const bool activate) CV_OVERRIDE; /** * Activate/desactivate the Parvocellular pathway processing (contours information extraction), by default, it is activated * @param activate: true if Parvocellular (contours information extraction) output should be activated, false if not */ - void activateContoursProcessing(const bool activate); + void activateContoursProcessing(const bool activate) CV_OVERRIDE; private: // Parameteres setup members diff --git a/modules/bioinspired/src/retina_ocl.hpp b/modules/bioinspired/src/retina_ocl.hpp index 3b30e385f..9cade9fe5 100644 --- a/modules/bioinspired/src/retina_ocl.hpp +++ b/modules/bioinspired/src/retina_ocl.hpp @@ -627,44 +627,44 @@ private: void _runGrayToneMapping(const UMat &grayImageInput, UMat &grayImageOutput , const float PhotoreceptorsCompression = 0.6, const float ganglionCellsCompression = 0.6); }; -class RetinaOCLImpl : public Retina +class RetinaOCLImpl CV_FINAL : public Retina { public: RetinaOCLImpl(Size getInputSize); RetinaOCLImpl(Size getInputSize, const bool colorMode, int colorSamplingMethod = RETINA_COLOR_BAYER, const bool useRetinaLogSampling = false, const double reductionFactor = 1.0, const double samplingStrenght = 10.0); - virtual ~RetinaOCLImpl(); + virtual ~RetinaOCLImpl() CV_OVERRIDE; - Size getInputSize(); - Size getOutputSize(); + Size getInputSize() CV_OVERRIDE; + Size getOutputSize() CV_OVERRIDE; - void setup(String retinaParameterFile = "", const bool applyDefaultSetupOnFailure = true); - void setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailure = true); - void setup(RetinaParameters newParameters); + void setup(String retinaParameterFile = "", const bool applyDefaultSetupOnFailure = true) CV_OVERRIDE; + void setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailure = true) CV_OVERRIDE; + void setup(RetinaParameters newParameters) CV_OVERRIDE; - RetinaParameters getParameters(); + RetinaParameters getParameters() CV_OVERRIDE; - const String printSetup(); - virtual void write(String fs) const; - virtual void write(FileStorage& fs) const; + const String printSetup() CV_OVERRIDE; + virtual void write(String fs) const CV_OVERRIDE; + virtual void write(FileStorage& fs) const CV_OVERRIDE; - void setupOPLandIPLParvoChannel(const bool colorMode = true, const bool normaliseOutput = true, const float photoreceptorsLocalAdaptationSensitivity = 0.7, const float photoreceptorsTemporalConstant = 0.5, const float photoreceptorsSpatialConstant = 0.53, const float horizontalCellsGain = 0, const float HcellsTemporalConstant = 1, const float HcellsSpatialConstant = 7, const float ganglionCellsSensitivity = 0.7); - void setupIPLMagnoChannel(const bool normaliseOutput = true, const float parasolCells_beta = 0, const float parasolCells_tau = 0, const float parasolCells_k = 7, const float amacrinCellsTemporalCutFrequency = 1.2, const float V0CompressionParameter = 0.95, const float localAdaptintegration_tau = 0, const float localAdaptintegration_k = 7); + void setupOPLandIPLParvoChannel(const bool colorMode = true, const bool normaliseOutput = true, const float photoreceptorsLocalAdaptationSensitivity = 0.7, const float photoreceptorsTemporalConstant = 0.5, const float photoreceptorsSpatialConstant = 0.53, const float horizontalCellsGain = 0, const float HcellsTemporalConstant = 1, const float HcellsSpatialConstant = 7, const float ganglionCellsSensitivity = 0.7) CV_OVERRIDE; + void setupIPLMagnoChannel(const bool normaliseOutput = true, const float parasolCells_beta = 0, const float parasolCells_tau = 0, const float parasolCells_k = 7, const float amacrinCellsTemporalCutFrequency = 1.2, const float V0CompressionParameter = 0.95, const float localAdaptintegration_tau = 0, const float localAdaptintegration_k = 7) CV_OVERRIDE; - void run(InputArray inputImage); - void getParvo(OutputArray retinaOutput_parvo); - void getMagno(OutputArray retinaOutput_magno); + void run(InputArray inputImage) CV_OVERRIDE; + void getParvo(OutputArray retinaOutput_parvo) CV_OVERRIDE; + void getMagno(OutputArray retinaOutput_magno) CV_OVERRIDE; - void setColorSaturation(const bool saturateColors = true, const float colorSaturationValue = 4.0); - void clearBuffers(); - void activateMovingContoursProcessing(const bool activate); - void activateContoursProcessing(const bool activate); + void setColorSaturation(const bool saturateColors = true, const float colorSaturationValue = 4.0) CV_OVERRIDE; + void clearBuffers() CV_OVERRIDE; + void activateMovingContoursProcessing(const bool activate) CV_OVERRIDE; + void activateContoursProcessing(const bool activate) CV_OVERRIDE; // unimplemented interfaces: - void applyFastToneMapping(InputArray /*inputImage*/, OutputArray /*outputToneMappedImage*/); - void getParvoRAW(OutputArray /*retinaOutput_parvo*/); - void getMagnoRAW(OutputArray /*retinaOutput_magno*/); - const Mat getMagnoRAW() const; - const Mat getParvoRAW() const; + void applyFastToneMapping(InputArray /*inputImage*/, OutputArray /*outputToneMappedImage*/) CV_OVERRIDE; + void getParvoRAW(OutputArray /*retinaOutput_parvo*/) CV_OVERRIDE; + void getMagnoRAW(OutputArray /*retinaOutput_magno*/) CV_OVERRIDE; + const Mat getMagnoRAW() const CV_OVERRIDE; + const Mat getParvoRAW() const CV_OVERRIDE; protected: RetinaParameters _retinaParameters; diff --git a/modules/bioinspired/src/retinacolor.hpp b/modules/bioinspired/src/retinacolor.hpp index 18387fcb0..d2c573237 100644 --- a/modules/bioinspired/src/retinacolor.hpp +++ b/modules/bioinspired/src/retinacolor.hpp @@ -289,7 +289,7 @@ namespace bioinspired Parallel_adaptiveHorizontalCausalFilter_addInput(const float *inputImg, float *bufferToProcess, const float *imageGrad, const unsigned int nbCols) :outputFrame(bufferToProcess), inputFrame(inputImg), imageGradient(imageGrad), nbColumns(nbCols) { } - virtual void operator()( const Range& r ) const + virtual void operator()( const Range& r ) const CV_OVERRIDE { float* outputPTR=outputFrame+r.start*nbColumns; const float* inputPTR=inputFrame+r.start*nbColumns; @@ -317,7 +317,7 @@ namespace bioinspired Parallel_adaptiveVerticalAnticausalFilter_multGain(float *bufferToProcess, const float *imageGrad, const unsigned int nbRws, const unsigned int nbCols, const float gain) :outputFrame(bufferToProcess), imageGradient(imageGrad), nbRows(nbRws), nbColumns(nbCols), filterParam_gain(gain) { } - virtual void operator()( const Range& r ) const { + virtual void operator()( const Range& r ) const CV_OVERRIDE { float* offset=outputFrame+nbColumns*nbRows-nbColumns; const float* gradOffset= imageGradient+nbColumns*nbRows-nbColumns; for (int IDcolumn=r.start; IDcolumn!=r.end; ++IDcolumn) @@ -346,7 +346,7 @@ namespace bioinspired Parallel_computeGradient(const unsigned int nbCols, const unsigned int nbRws, const float *lum, float *imageGrad) :imageGradient(imageGrad), luminance(lum), nbColumns(nbCols), doubleNbColumns(2*nbCols), nbRows(nbRws), nbPixels(nbRws*nbCols) { } - virtual void operator()( const Range& r ) const { + virtual void operator()( const Range& r ) const CV_OVERRIDE { for (int idLine=r.start;idLine!=r.end;++idLine) { for (unsigned int idColumn=2;idColumn create(); }; diff --git a/modules/datasets/include/opencv2/datasets/ar_sports.hpp b/modules/datasets/include/opencv2/datasets/ar_sports.hpp index 7f51405fa..cb24e38e7 100644 --- a/modules/datasets/include/opencv2/datasets/ar_sports.hpp +++ b/modules/datasets/include/opencv2/datasets/ar_sports.hpp @@ -66,7 +66,7 @@ struct AR_sportsObj : public Object class CV_EXPORTS AR_sports : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/fr_adience.hpp b/modules/datasets/include/opencv2/datasets/fr_adience.hpp index c84bce1c2..2df5d8df4 100644 --- a/modules/datasets/include/opencv2/datasets/fr_adience.hpp +++ b/modules/datasets/include/opencv2/datasets/fr_adience.hpp @@ -83,7 +83,7 @@ struct FR_adienceObj : public Object class CV_EXPORTS FR_adience : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); diff --git a/modules/datasets/include/opencv2/datasets/fr_lfw.hpp b/modules/datasets/include/opencv2/datasets/fr_lfw.hpp index 7065da7a6..16d631574 100644 --- a/modules/datasets/include/opencv2/datasets/fr_lfw.hpp +++ b/modules/datasets/include/opencv2/datasets/fr_lfw.hpp @@ -66,7 +66,7 @@ struct FR_lfwObj : public Object class CV_EXPORTS FR_lfw : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/gr_chalearn.hpp b/modules/datasets/include/opencv2/datasets/gr_chalearn.hpp index a8eaa6cc4..6a5c76412 100644 --- a/modules/datasets/include/opencv2/datasets/gr_chalearn.hpp +++ b/modules/datasets/include/opencv2/datasets/gr_chalearn.hpp @@ -83,7 +83,7 @@ struct GR_chalearnObj : public Object class CV_EXPORTS GR_chalearn : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/gr_skig.hpp b/modules/datasets/include/opencv2/datasets/gr_skig.hpp index 9c862243f..35bc6f4f6 100644 --- a/modules/datasets/include/opencv2/datasets/gr_skig.hpp +++ b/modules/datasets/include/opencv2/datasets/gr_skig.hpp @@ -105,7 +105,7 @@ struct GR_skigObj : public Object class CV_EXPORTS GR_skig : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/hpe_humaneva.hpp b/modules/datasets/include/opencv2/datasets/hpe_humaneva.hpp index 5366e0d61..2eba8cfca 100644 --- a/modules/datasets/include/opencv2/datasets/hpe_humaneva.hpp +++ b/modules/datasets/include/opencv2/datasets/hpe_humaneva.hpp @@ -77,7 +77,7 @@ enum datasetType class CV_EXPORTS HPE_humaneva : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(int num=humaneva_1); }; diff --git a/modules/datasets/include/opencv2/datasets/hpe_parse.hpp b/modules/datasets/include/opencv2/datasets/hpe_parse.hpp index 7629e2caf..42294df83 100644 --- a/modules/datasets/include/opencv2/datasets/hpe_parse.hpp +++ b/modules/datasets/include/opencv2/datasets/hpe_parse.hpp @@ -65,7 +65,7 @@ struct HPE_parseObj : public Object class CV_EXPORTS HPE_parse : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/ir_affine.hpp b/modules/datasets/include/opencv2/datasets/ir_affine.hpp index 3b04a4b8a..7cc0c0908 100644 --- a/modules/datasets/include/opencv2/datasets/ir_affine.hpp +++ b/modules/datasets/include/opencv2/datasets/ir_affine.hpp @@ -67,7 +67,7 @@ struct IR_affineObj : public Object class CV_EXPORTS IR_affine : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/ir_robot.hpp b/modules/datasets/include/opencv2/datasets/ir_robot.hpp index 0acfe0aca..446e3be6b 100644 --- a/modules/datasets/include/opencv2/datasets/ir_robot.hpp +++ b/modules/datasets/include/opencv2/datasets/ir_robot.hpp @@ -76,7 +76,7 @@ struct IR_robotObj : public Object class CV_EXPORTS IR_robot : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/is_bsds.hpp b/modules/datasets/include/opencv2/datasets/is_bsds.hpp index 7357a6747..b4a3e6578 100644 --- a/modules/datasets/include/opencv2/datasets/is_bsds.hpp +++ b/modules/datasets/include/opencv2/datasets/is_bsds.hpp @@ -65,7 +65,7 @@ struct IS_bsdsObj : public Object class CV_EXPORTS IS_bsds : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/is_weizmann.hpp b/modules/datasets/include/opencv2/datasets/is_weizmann.hpp index 5daa42097..4f61578a6 100644 --- a/modules/datasets/include/opencv2/datasets/is_weizmann.hpp +++ b/modules/datasets/include/opencv2/datasets/is_weizmann.hpp @@ -68,7 +68,7 @@ struct IS_weizmannObj : public Object class CV_EXPORTS IS_weizmann : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/msm_epfl.hpp b/modules/datasets/include/opencv2/datasets/msm_epfl.hpp index a08fc4bff..54aebde92 100644 --- a/modules/datasets/include/opencv2/datasets/msm_epfl.hpp +++ b/modules/datasets/include/opencv2/datasets/msm_epfl.hpp @@ -77,7 +77,7 @@ struct MSM_epflObj : public Object class CV_EXPORTS MSM_epfl : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/msm_middlebury.hpp b/modules/datasets/include/opencv2/datasets/msm_middlebury.hpp index 2fd67bf1b..9b883e59a 100644 --- a/modules/datasets/include/opencv2/datasets/msm_middlebury.hpp +++ b/modules/datasets/include/opencv2/datasets/msm_middlebury.hpp @@ -68,7 +68,7 @@ struct MSM_middleburyObj : public Object class CV_EXPORTS MSM_middlebury : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/or_imagenet.hpp b/modules/datasets/include/opencv2/datasets/or_imagenet.hpp index 26a8f6355..079165bf9 100644 --- a/modules/datasets/include/opencv2/datasets/or_imagenet.hpp +++ b/modules/datasets/include/opencv2/datasets/or_imagenet.hpp @@ -66,7 +66,7 @@ struct OR_imagenetObj : public Object class CV_EXPORTS OR_imagenet : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/or_mnist.hpp b/modules/datasets/include/opencv2/datasets/or_mnist.hpp index ff6bd609e..ac4d838ed 100644 --- a/modules/datasets/include/opencv2/datasets/or_mnist.hpp +++ b/modules/datasets/include/opencv2/datasets/or_mnist.hpp @@ -66,7 +66,7 @@ struct OR_mnistObj : public Object class CV_EXPORTS OR_mnist : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/or_pascal.hpp b/modules/datasets/include/opencv2/datasets/or_pascal.hpp index bca8e62f4..c5f27af9f 100644 --- a/modules/datasets/include/opencv2/datasets/or_pascal.hpp +++ b/modules/datasets/include/opencv2/datasets/or_pascal.hpp @@ -89,7 +89,7 @@ struct OR_pascalObj : public Object class CV_EXPORTS OR_pascal : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/or_sun.hpp b/modules/datasets/include/opencv2/datasets/or_sun.hpp index 059c0d4c6..7d3d8878a 100644 --- a/modules/datasets/include/opencv2/datasets/or_sun.hpp +++ b/modules/datasets/include/opencv2/datasets/or_sun.hpp @@ -66,7 +66,7 @@ struct OR_sunObj : public Object class CV_EXPORTS OR_sun : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); diff --git a/modules/datasets/include/opencv2/datasets/pd_caltech.hpp b/modules/datasets/include/opencv2/datasets/pd_caltech.hpp index 9ff727809..c8545e2f1 100644 --- a/modules/datasets/include/opencv2/datasets/pd_caltech.hpp +++ b/modules/datasets/include/opencv2/datasets/pd_caltech.hpp @@ -76,7 +76,7 @@ struct PD_caltechObj : public Object class CV_EXPORTS PD_caltech : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/pd_inria.hpp b/modules/datasets/include/opencv2/datasets/pd_inria.hpp index 75865787e..9e1d30b89 100644 --- a/modules/datasets/include/opencv2/datasets/pd_inria.hpp +++ b/modules/datasets/include/opencv2/datasets/pd_inria.hpp @@ -57,7 +57,7 @@ namespace datasets //! @addtogroup datasets_pd //! @{ -enum sampleType +enum sampleType { POS = 0, NEG = 1 @@ -67,7 +67,7 @@ struct PD_inriaObj : public Object { // image file name std::string filename; - + // positive or negative sampleType sType; @@ -83,7 +83,7 @@ struct PD_inriaObj : public Object class CV_EXPORTS PD_inria : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/slam_kitti.hpp b/modules/datasets/include/opencv2/datasets/slam_kitti.hpp index 1b7c408d7..a004b95f4 100644 --- a/modules/datasets/include/opencv2/datasets/slam_kitti.hpp +++ b/modules/datasets/include/opencv2/datasets/slam_kitti.hpp @@ -74,7 +74,7 @@ struct SLAM_kittiObj : public Object class CV_EXPORTS SLAM_kitti : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/slam_tumindoor.hpp b/modules/datasets/include/opencv2/datasets/slam_tumindoor.hpp index 758dd1306..eca07adda 100644 --- a/modules/datasets/include/opencv2/datasets/slam_tumindoor.hpp +++ b/modules/datasets/include/opencv2/datasets/slam_tumindoor.hpp @@ -74,7 +74,7 @@ struct SLAM_tumindoorObj : public Object class CV_EXPORTS SLAM_tumindoor : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/tr_chars.hpp b/modules/datasets/include/opencv2/datasets/tr_chars.hpp index c213bff19..69aab83a2 100644 --- a/modules/datasets/include/opencv2/datasets/tr_chars.hpp +++ b/modules/datasets/include/opencv2/datasets/tr_chars.hpp @@ -66,7 +66,7 @@ struct TR_charsObj : public Object class CV_EXPORTS TR_chars : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/tr_icdar.hpp b/modules/datasets/include/opencv2/datasets/tr_icdar.hpp index abfd7db74..3b43d6974 100644 --- a/modules/datasets/include/opencv2/datasets/tr_icdar.hpp +++ b/modules/datasets/include/opencv2/datasets/tr_icdar.hpp @@ -74,7 +74,7 @@ struct TR_icdarObj : public Object class CV_EXPORTS TR_icdar : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/tr_svt.hpp b/modules/datasets/include/opencv2/datasets/tr_svt.hpp index 6c2d533c0..7b941802e 100644 --- a/modules/datasets/include/opencv2/datasets/tr_svt.hpp +++ b/modules/datasets/include/opencv2/datasets/tr_svt.hpp @@ -73,7 +73,7 @@ struct TR_svtObj : public Object class CV_EXPORTS TR_svt : public Dataset { public: - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; static Ptr create(); }; diff --git a/modules/datasets/include/opencv2/datasets/track_alov.hpp b/modules/datasets/include/opencv2/datasets/track_alov.hpp index 276e2f16b..a3c5da023 100644 --- a/modules/datasets/include/opencv2/datasets/track_alov.hpp +++ b/modules/datasets/include/opencv2/datasets/track_alov.hpp @@ -75,7 +75,7 @@ class CV_EXPORTS TRACK_alov : public Dataset public: static Ptr create(); - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; //Load only frames with annotations (~every 5-th frame) virtual void loadAnnotatedOnly(const std::string &path) = 0; diff --git a/modules/datasets/include/opencv2/datasets/track_vot.hpp b/modules/datasets/include/opencv2/datasets/track_vot.hpp index 6249f0289..a5a9c6fd8 100644 --- a/modules/datasets/include/opencv2/datasets/track_vot.hpp +++ b/modules/datasets/include/opencv2/datasets/track_vot.hpp @@ -70,7 +70,7 @@ class CV_EXPORTS TRACK_vot : public Dataset public: static Ptr create(); - virtual void load(const std::string &path) = 0; + virtual void load(const std::string &path) CV_OVERRIDE = 0; virtual int getDatasetsNum() = 0; diff --git a/modules/datasets/src/ar_hmdb.cpp b/modules/datasets/src/ar_hmdb.cpp index f4b42e33a..68c07132e 100644 --- a/modules/datasets/src/ar_hmdb.cpp +++ b/modules/datasets/src/ar_hmdb.cpp @@ -58,7 +58,7 @@ public: //AR_hmdbImp(const string &path, int number = 0); virtual ~AR_hmdbImp() {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDatasetSplit(const string &path, int number = 0); diff --git a/modules/datasets/src/ar_sports.cpp b/modules/datasets/src/ar_sports.cpp index 11c8062b6..2aad1db5c 100644 --- a/modules/datasets/src/ar_sports.cpp +++ b/modules/datasets/src/ar_sports.cpp @@ -56,7 +56,7 @@ public: //AR_sportsImp(const string &path); virtual ~AR_sportsImp() {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/fr_adience.cpp b/modules/datasets/src/fr_adience.cpp index c828257a0..7517aa4a9 100644 --- a/modules/datasets/src/fr_adience.cpp +++ b/modules/datasets/src/fr_adience.cpp @@ -52,14 +52,14 @@ namespace datasets using namespace std; -class FR_adienceImp : public FR_adience +class FR_adienceImp CV_FINAL : public FR_adience { public: FR_adienceImp() {} //FR_adienceImp(const string &path); virtual ~FR_adienceImp() {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/fr_lfw.cpp b/modules/datasets/src/fr_lfw.cpp index 217e71114..b940af620 100644 --- a/modules/datasets/src/fr_lfw.cpp +++ b/modules/datasets/src/fr_lfw.cpp @@ -51,14 +51,14 @@ namespace datasets using namespace std; -class FR_lfwImp : public FR_lfw +class FR_lfwImp CV_FINAL : public FR_lfw { public: FR_lfwImp() {} //FR_lfwImp(const string &path); virtual ~FR_lfwImp() {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/gr_chalearn.cpp b/modules/datasets/src/gr_chalearn.cpp index a77f22608..abc29a5e6 100644 --- a/modules/datasets/src/gr_chalearn.cpp +++ b/modules/datasets/src/gr_chalearn.cpp @@ -49,14 +49,14 @@ namespace datasets using namespace std; -class GR_chalearnImp : public GR_chalearn +class GR_chalearnImp CV_FINAL : public GR_chalearn { public: GR_chalearnImp() {} //GR_chalearnImp(const string &path); virtual ~GR_chalearnImp() {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/gr_skig.cpp b/modules/datasets/src/gr_skig.cpp index 3bdfd71ed..45c3e1acf 100644 --- a/modules/datasets/src/gr_skig.cpp +++ b/modules/datasets/src/gr_skig.cpp @@ -51,14 +51,14 @@ namespace datasets using namespace std; -class GR_skigImp : public GR_skig +class GR_skigImp CV_FINAL : public GR_skig { public: GR_skigImp() {} //GR_skigImp(const string &path); virtual ~GR_skigImp() {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/hpe_humaneva.cpp b/modules/datasets/src/hpe_humaneva.cpp index 0dfc1a06d..560896500 100644 --- a/modules/datasets/src/hpe_humaneva.cpp +++ b/modules/datasets/src/hpe_humaneva.cpp @@ -51,14 +51,14 @@ namespace datasets using namespace std; -class HPE_humanevaImp : public HPE_humaneva +class HPE_humanevaImp CV_FINAL : public HPE_humaneva { public: HPE_humanevaImp() {} //HPE_humanevaImp(const string &path); virtual ~HPE_humanevaImp() {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); @@ -138,7 +138,7 @@ public: //HPE_humanevaImpII(const string &path); virtual ~HPE_humanevaImpII() {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/hpe_parse.cpp b/modules/datasets/src/hpe_parse.cpp index 270f5b7e8..d0f9c57cc 100644 --- a/modules/datasets/src/hpe_parse.cpp +++ b/modules/datasets/src/hpe_parse.cpp @@ -49,14 +49,14 @@ namespace datasets using namespace std; -class HPE_parseImp : public HPE_parse +class HPE_parseImp CV_FINAL : public HPE_parse { public: HPE_parseImp() {} //HPE_parseImp(const string &path); virtual ~HPE_parseImp() {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/ir_affine.cpp b/modules/datasets/src/ir_affine.cpp index 185ded180..c41398d0c 100644 --- a/modules/datasets/src/ir_affine.cpp +++ b/modules/datasets/src/ir_affine.cpp @@ -49,14 +49,14 @@ namespace datasets using namespace std; -class IR_affineImp : public IR_affine +class IR_affineImp CV_FINAL : public IR_affine { public: IR_affineImp() {} //IR_affineImp(const string &path); - virtual ~IR_affineImp() {} + virtual ~IR_affineImp() CV_OVERRIDE {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/ir_robot.cpp b/modules/datasets/src/ir_robot.cpp index d48aa8134..14d168e68 100644 --- a/modules/datasets/src/ir_robot.cpp +++ b/modules/datasets/src/ir_robot.cpp @@ -49,14 +49,14 @@ namespace datasets using namespace std; -class IR_robotImp : public IR_robot +class IR_robotImp CV_FINAL : public IR_robot { public: IR_robotImp() {} //IR_robotImp(const string &path); virtual ~IR_robotImp() {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/is_bsds.cpp b/modules/datasets/src/is_bsds.cpp index b4ff37796..ea788197e 100644 --- a/modules/datasets/src/is_bsds.cpp +++ b/modules/datasets/src/is_bsds.cpp @@ -49,14 +49,14 @@ namespace datasets using namespace std; -class IS_bsdsImp : public IS_bsds +class IS_bsdsImp CV_FINAL : public IS_bsds { public: IS_bsdsImp() {} //IS_bsdsImp(const string &path); virtual ~IS_bsdsImp() {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/is_weizmann.cpp b/modules/datasets/src/is_weizmann.cpp index 8d09b9468..ed4d4b4d5 100644 --- a/modules/datasets/src/is_weizmann.cpp +++ b/modules/datasets/src/is_weizmann.cpp @@ -49,14 +49,14 @@ namespace datasets using namespace std; -class IS_weizmannImp : public IS_weizmann +class IS_weizmannImp CV_FINAL : public IS_weizmann { public: IS_weizmannImp() {} //IS_weizmannImp(const string &path); virtual ~IS_weizmannImp() {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/msm_epfl.cpp b/modules/datasets/src/msm_epfl.cpp index 36e5b5294..781fe0f4d 100644 --- a/modules/datasets/src/msm_epfl.cpp +++ b/modules/datasets/src/msm_epfl.cpp @@ -49,14 +49,14 @@ namespace datasets using namespace std; -class MSM_epflImp : public MSM_epfl +class MSM_epflImp CV_FINAL : public MSM_epfl { public: MSM_epflImp() {} //MSM_epflImp(const string &path); - virtual ~MSM_epflImp() {} + virtual ~MSM_epflImp() CV_OVERRIDE {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/msm_middlebury.cpp b/modules/datasets/src/msm_middlebury.cpp index 6f6eb52dd..380388afc 100644 --- a/modules/datasets/src/msm_middlebury.cpp +++ b/modules/datasets/src/msm_middlebury.cpp @@ -49,14 +49,14 @@ namespace datasets using namespace std; -class MSM_middleburyImp : public MSM_middlebury +class MSM_middleburyImp CV_FINAL : public MSM_middlebury { public: MSM_middleburyImp() {} //MSM_middleburyImp(const string &path); virtual ~MSM_middleburyImp() {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/or_imagenet.cpp b/modules/datasets/src/or_imagenet.cpp index 371ade1c5..a75e7d318 100644 --- a/modules/datasets/src/or_imagenet.cpp +++ b/modules/datasets/src/or_imagenet.cpp @@ -51,14 +51,14 @@ namespace datasets using namespace std; -class OR_imagenetImp : public OR_imagenet +class OR_imagenetImp CV_FINAL : public OR_imagenet { public: OR_imagenetImp() {} //OR_imagenetImp(const string &path); - virtual ~OR_imagenetImp() {} + virtual ~OR_imagenetImp() CV_OVERRIDE {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/or_mnist.cpp b/modules/datasets/src/or_mnist.cpp index 1e206f306..25c3ab38d 100644 --- a/modules/datasets/src/or_mnist.cpp +++ b/modules/datasets/src/or_mnist.cpp @@ -49,14 +49,14 @@ namespace datasets using namespace std; -class OR_mnistImp : public OR_mnist +class OR_mnistImp CV_FINAL : public OR_mnist { public: OR_mnistImp() {} //OR_mnistImp(const string &path); virtual ~OR_mnistImp() {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/or_pascal.cpp b/modules/datasets/src/or_pascal.cpp index a20fa44bd..e3dade1ec 100644 --- a/modules/datasets/src/or_pascal.cpp +++ b/modules/datasets/src/or_pascal.cpp @@ -41,7 +41,14 @@ #include "opencv2/datasets/or_pascal.hpp" #include "opencv2/datasets/util.hpp" +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" +#endif #include "tinyxml2/tinyxml2.h" +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic pop +#endif #include namespace cv @@ -52,12 +59,12 @@ namespace datasets using namespace std; using namespace tinyxml2; -class OR_pascalImp : public OR_pascal +class OR_pascalImp CV_FINAL : public OR_pascal { public: OR_pascalImp() {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path, const string &nameImageSet, vector< Ptr > &imageSet); diff --git a/modules/datasets/src/or_sun.cpp b/modules/datasets/src/or_sun.cpp index 2413fc05b..7f0e4dc6d 100644 --- a/modules/datasets/src/or_sun.cpp +++ b/modules/datasets/src/or_sun.cpp @@ -51,14 +51,14 @@ namespace datasets using namespace std; -class OR_sunImp : public OR_sun +class OR_sunImp CV_FINAL : public OR_sun { public: OR_sunImp() {} //OR_sunImp(const string &path); - virtual ~OR_sunImp() {} + virtual ~OR_sunImp() CV_OVERRIDE {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/pd_caltech.cpp b/modules/datasets/src/pd_caltech.cpp index b3660b8d6..67fb804e5 100644 --- a/modules/datasets/src/pd_caltech.cpp +++ b/modules/datasets/src/pd_caltech.cpp @@ -49,14 +49,14 @@ namespace datasets using namespace std; -class PD_caltechImp : public PD_caltech +class PD_caltechImp CV_FINAL : public PD_caltech { public: PD_caltechImp() {} //PD_caltechImp(const string &path); - virtual ~PD_caltechImp() {} + virtual ~PD_caltechImp() CV_OVERRIDE {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/pd_inria.cpp b/modules/datasets/src/pd_inria.cpp index 2dd847927..e17c7f52a 100644 --- a/modules/datasets/src/pd_inria.cpp +++ b/modules/datasets/src/pd_inria.cpp @@ -49,14 +49,14 @@ namespace datasets using namespace std; -class PD_inriaImp : public PD_inria +class PD_inriaImp CV_FINAL : public PD_inria { public: PD_inriaImp() {} - - virtual ~PD_inriaImp() {} - virtual void load(const string &path); + virtual ~PD_inriaImp() CV_OVERRIDE {} + + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path, const string nameImageSet, vector< Ptr > &imageSet); @@ -69,7 +69,7 @@ void PD_inriaImp::load(const string &path) // Training set train.push_back(vector< Ptr >()); loadDataset(path, "Train", train.back()); - + // Testing set test.push_back(vector< Ptr >()); loadDataset(path, "Test", test.back()); @@ -106,16 +106,16 @@ void PD_inriaImp::parseAnnotation(const string filename, Ptr< PD_inriaObj > &obj error_message = format("Unable to open file: \n%s\n", filename.c_str()); CV_Error(Error::StsBadArg, error_message); } - + string imageSizeHeader = "Image size (X x Y x C) : "; string imageSizeFmt = imageSizeHeader + "%d x %d x %d"; string objWithGTHeader = "Objects with ground truth : "; string objWithGTFmt = objWithGTHeader + "%d { \"PASperson\" }"; string boundBoxHeader = "Bounding box for object "; string boundBoxFmt = boundBoxHeader + "%*d \"PASperson\" (Xmin, Ymin) - (Xmax, Ymax) : (%d, %d) - (%d, %d)"; - + string line = ""; - + int width = 0; int height = 0; int depth = 0; @@ -138,7 +138,7 @@ void PD_inriaImp::parseAnnotation(const string filename, Ptr< PD_inriaObj > &obj else if (strstr(line.c_str(), objWithGTHeader.c_str())) { sscanf(line.c_str(), objWithGTFmt.c_str(), &numObjects); - + if (numObjects <= 0) break; } @@ -162,16 +162,16 @@ void PD_inriaImp::loadDataset(const string &path, const string nameImageSet, vec string listAnn = path + nameImageSet + "/annotations.lst"; string listPos = path + nameImageSet + "/pos.lst"; string listNeg = path + nameImageSet + "/neg.lst"; - + vector< string > fsAnn; vector< string > fsPos; vector< string > fsNeg; - + // read file names readTextLines(listAnn, fsAnn); readTextLines(listPos, fsPos); readTextLines(listNeg, fsNeg); - + CV_Assert(fsAnn.size() == fsPos.size()); for (unsigned int i = 0; i < fsPos.size(); i++) @@ -180,16 +180,16 @@ void PD_inriaImp::loadDataset(const string &path, const string nameImageSet, vec parseAnnotation(path + fsAnn[i], curr); curr->filename = path + fsPos[i]; curr->sType = POS; - + imageSet.push_back(curr); } - + for (unsigned int i = 0; i < fsNeg.size(); i++) { Ptr curr(new PD_inriaObj); - curr->filename = path + fsNeg[i]; + curr->filename = path + fsNeg[i]; curr->sType = NEG; - + imageSet.push_back(curr); } } diff --git a/modules/datasets/src/slam_kitti.cpp b/modules/datasets/src/slam_kitti.cpp index e1d82555c..f12bc6961 100644 --- a/modules/datasets/src/slam_kitti.cpp +++ b/modules/datasets/src/slam_kitti.cpp @@ -49,14 +49,14 @@ namespace datasets using namespace std; -class SLAM_kittiImp : public SLAM_kitti +class SLAM_kittiImp CV_FINAL : public SLAM_kitti { public: SLAM_kittiImp() {} //SLAM_kittiImp(const string &path); - virtual ~SLAM_kittiImp() {} + virtual ~SLAM_kittiImp() CV_OVERRIDE {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/slam_tumindoor.cpp b/modules/datasets/src/slam_tumindoor.cpp index 8db891658..15c2b285f 100644 --- a/modules/datasets/src/slam_tumindoor.cpp +++ b/modules/datasets/src/slam_tumindoor.cpp @@ -51,14 +51,14 @@ namespace datasets using namespace std; -class SLAM_tumindoorImp : public SLAM_tumindoor +class SLAM_tumindoorImp CV_FINAL : public SLAM_tumindoor { public: SLAM_tumindoorImp() {} //SLAM_tumindoorImp(const string &path); - virtual ~SLAM_tumindoorImp() {} + virtual ~SLAM_tumindoorImp() CV_OVERRIDE {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/tr_chars.cpp b/modules/datasets/src/tr_chars.cpp index 261bf3a6c..6bcc18961 100644 --- a/modules/datasets/src/tr_chars.cpp +++ b/modules/datasets/src/tr_chars.cpp @@ -49,14 +49,14 @@ namespace datasets using namespace std; -class TR_charsImp : public TR_chars +class TR_charsImp CV_FINAL : public TR_chars { public: TR_charsImp() {} //TR_charsImp(const string &path, int number = 0); - virtual ~TR_charsImp() {} + virtual ~TR_charsImp() CV_OVERRIDE {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDatasetSplit(const string &path, int number); diff --git a/modules/datasets/src/tr_icdar.cpp b/modules/datasets/src/tr_icdar.cpp index e0835e9c3..6f4d2eb68 100644 --- a/modules/datasets/src/tr_icdar.cpp +++ b/modules/datasets/src/tr_icdar.cpp @@ -53,14 +53,14 @@ namespace datasets using namespace std; -class TR_icdarImp : public TR_icdar +class TR_icdarImp CV_FINAL : public TR_icdar { public: TR_icdarImp() {} //TR_icdarImp(const string &path); - virtual ~TR_icdarImp() {} + virtual ~TR_icdarImp() CV_OVERRIDE {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/tr_svt.cpp b/modules/datasets/src/tr_svt.cpp index 6d7d5a85a..dbc972369 100644 --- a/modules/datasets/src/tr_svt.cpp +++ b/modules/datasets/src/tr_svt.cpp @@ -42,7 +42,14 @@ #include "opencv2/datasets/tr_svt.hpp" #include "opencv2/datasets/util.hpp" +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" +#endif #include "tinyxml2/tinyxml2.h" +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic pop +#endif namespace cv { @@ -52,14 +59,14 @@ namespace datasets using namespace std; using namespace tinyxml2; -class TR_svtImp : public TR_svt +class TR_svtImp CV_FINAL : public TR_svt { public: TR_svtImp() {} //TR_svtImp(const string &path); - virtual ~TR_svtImp() {} + virtual ~TR_svtImp() CV_OVERRIDE {} - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; private: void loadDataset(const string &path); diff --git a/modules/datasets/src/track_alov.cpp b/modules/datasets/src/track_alov.cpp index 4fee54cb1..2213c0f68 100644 --- a/modules/datasets/src/track_alov.cpp +++ b/modules/datasets/src/track_alov.cpp @@ -52,7 +52,7 @@ namespace cv namespace datasets { -class TRACK_alovImpl : public TRACK_alov +class TRACK_alovImpl CV_FINAL : public TRACK_alov { public: //Constructor @@ -62,24 +62,24 @@ public: frameCounter = 0; } //Destructor - virtual ~TRACK_alovImpl() {} + virtual ~TRACK_alovImpl() CV_OVERRIDE {} //Load Dataset - virtual void load(const string &path); - virtual void loadAnnotatedOnly(const std::string &path); + virtual void load(const string &path) CV_OVERRIDE; + virtual void loadAnnotatedOnly(const std::string &path) CV_OVERRIDE; protected: - virtual int getDatasetsNum(); + virtual int getDatasetsNum() CV_OVERRIDE; - virtual int getDatasetLength(int id); + virtual int getDatasetLength(int id) CV_OVERRIDE; - virtual bool initDataset(int id); + virtual bool initDataset(int id) CV_OVERRIDE; - virtual bool getNextFrame(Mat &frame); - virtual bool getFrame(Mat &frame, int datasetID, int frameID); + virtual bool getNextFrame(Mat &frame) CV_OVERRIDE; + virtual bool getFrame(Mat &frame, int datasetID, int frameID) CV_OVERRIDE; - virtual vector getNextGT(); - virtual vector getGT(int datasetID, int frameID); + virtual vector getNextGT() CV_OVERRIDE; + virtual vector getGT(int datasetID, int frameID) CV_OVERRIDE; void loadDataset(const string &path); void loadDatasetAnnotatedOnly(const string &path); diff --git a/modules/datasets/src/track_vot.cpp b/modules/datasets/src/track_vot.cpp index 907f78fad..2bb6f691e 100644 --- a/modules/datasets/src/track_vot.cpp +++ b/modules/datasets/src/track_vot.cpp @@ -52,7 +52,7 @@ namespace cv namespace datasets { - class TRACK_votImpl : public TRACK_vot + class TRACK_votImpl CV_FINAL : public TRACK_vot { public: //Constructor @@ -62,21 +62,21 @@ namespace cv frameCounter = 0; } //Destructor - virtual ~TRACK_votImpl() {} + virtual ~TRACK_votImpl() CV_OVERRIDE {} //Load Dataset - virtual void load(const string &path); + virtual void load(const string &path) CV_OVERRIDE; protected: - virtual int getDatasetsNum(); + virtual int getDatasetsNum() CV_OVERRIDE; - virtual int getDatasetLength(int id); + virtual int getDatasetLength(int id) CV_OVERRIDE; - virtual bool initDataset(int id); + virtual bool initDataset(int id) CV_OVERRIDE; - virtual bool getNextFrame(Mat &frame); + virtual bool getNextFrame(Mat &frame) CV_OVERRIDE; - virtual vector getGT(); + virtual vector getGT() CV_OVERRIDE; void loadDataset(const string &path); diff --git a/modules/dpm/src/dpm_cascade.hpp b/modules/dpm/src/dpm_cascade.hpp index 26501ed47..704068025 100644 --- a/modules/dpm/src/dpm_cascade.hpp +++ b/modules/dpm/src/dpm_cascade.hpp @@ -141,7 +141,7 @@ class ParalComputeRootPCAScores : public ParallelLoopBody int dim, std::vector< Mat > &scores); // parallel loop body - void operator() (const Range &range) const; + void operator() (const Range &range) const CV_OVERRIDE; ParalComputeRootPCAScores(const ParalComputeRootPCAScores &pComp); diff --git a/modules/dpm/src/dpm_cascade_detector.cpp b/modules/dpm/src/dpm_cascade_detector.cpp index c28713641..d253988ad 100644 --- a/modules/dpm/src/dpm_cascade_detector.cpp +++ b/modules/dpm/src/dpm_cascade_detector.cpp @@ -49,19 +49,19 @@ namespace cv namespace dpm { -class DPMDetectorImpl : public DPMDetector +class DPMDetectorImpl CV_FINAL : public DPMDetector { public: DPMDetectorImpl( const vector& filenames, const vector& classNames=vector() ); - ~DPMDetectorImpl(); + ~DPMDetectorImpl() CV_OVERRIDE; - bool isEmpty() const; + bool isEmpty() const CV_OVERRIDE; - void detect(Mat &image, CV_OUT vector& objects); + void detect(Mat &image, CV_OUT vector& objects) CV_OVERRIDE; - const vector& getClassNames() const; - size_t getClassCount() const; + const vector& getClassNames() const CV_OVERRIDE; + size_t getClassCount() const CV_OVERRIDE; string extractModelName( const string& filename ); private: diff --git a/modules/dpm/src/dpm_feature.hpp b/modules/dpm/src/dpm_feature.hpp index d518e5821..5f0421c74 100644 --- a/modules/dpm/src/dpm_feature.hpp +++ b/modules/dpm/src/dpm_feature.hpp @@ -153,7 +153,7 @@ class ParalComputePyramid : public ParallelLoopBody void initialize(); // parallel loop body - void operator() (const Range &range) const; + void operator() (const Range &range) const CV_OVERRIDE; private: // image to compute feature pyramid diff --git a/modules/dpm/src/dpm_model.hpp b/modules/dpm/src/dpm_model.hpp index dae9c8d08..5a2ae67fb 100644 --- a/modules/dpm/src/dpm_model.hpp +++ b/modules/dpm/src/dpm_model.hpp @@ -130,11 +130,11 @@ class CascadeModel : public Model std::vector< Mat > partPCAFilters; public: CascadeModel() {} - ~CascadeModel() {} + ~CascadeModel() CV_OVERRIDE {} - void initModel(); - bool serialize(const std::string &filename) const; - bool deserialize(const std::string &filename); + void initModel() CV_OVERRIDE; + bool serialize(const std::string &filename) const CV_OVERRIDE; + bool deserialize(const std::string &filename) CV_OVERRIDE; }; } // namespace lsvm diff --git a/modules/face/include/opencv2/face.hpp b/modules/face/include/opencv2/face.hpp index 18c2650a7..87cf4b34e 100644 --- a/modules/face/include/opencv2/face.hpp +++ b/modules/face/include/opencv2/face.hpp @@ -333,13 +333,13 @@ public: Saves this model to a given FileStorage. @param fs The FileStorage to store this FaceRecognizer to. */ - virtual void write(FileStorage& fs) const = 0; + virtual void write(FileStorage& fs) const CV_OVERRIDE = 0; /** @overload */ - virtual void read(const FileNode& fn) = 0; + virtual void read(const FileNode& fn) CV_OVERRIDE = 0; /** @overload */ - virtual bool empty() const = 0; + virtual bool empty() const CV_OVERRIDE = 0; /** @brief Sets string info for the specified model's label. diff --git a/modules/face/include/opencv2/face/facemark.hpp b/modules/face/include/opencv2/face/facemark.hpp index 81357198d..285f2a598 100644 --- a/modules/face/include/opencv2/face/facemark.hpp +++ b/modules/face/include/opencv2/face/facemark.hpp @@ -265,8 +265,8 @@ class CV_EXPORTS_W Facemark : public virtual Algorithm { public: - virtual void read( const FileNode& fn )=0; - virtual void write( FileStorage& fs ) const=0; + virtual void read( const FileNode& fn ) CV_OVERRIDE = 0; + virtual void write( FileStorage& fs ) const CV_OVERRIDE = 0; /** @brief Add one training sample to the trainer. diff --git a/modules/face/include/opencv2/face/facerec.hpp b/modules/face/include/opencv2/face/facerec.hpp index ed21d9cf7..83c070171 100644 --- a/modules/face/include/opencv2/face/facerec.hpp +++ b/modules/face/include/opencv2/face/facerec.hpp @@ -25,18 +25,18 @@ public: /** @copybrief getNumComponents @see getNumComponents */ CV_WRAP void setNumComponents(int val); /** @see setThreshold */ - CV_WRAP double getThreshold() const; + CV_WRAP double getThreshold() const CV_OVERRIDE; /** @copybrief getThreshold @see getThreshold */ - CV_WRAP void setThreshold(double val); + CV_WRAP void setThreshold(double val) CV_OVERRIDE; CV_WRAP std::vector getProjections() const; CV_WRAP cv::Mat getLabels() const; CV_WRAP cv::Mat getEigenValues() const; CV_WRAP cv::Mat getEigenVectors() const; CV_WRAP cv::Mat getMean() const; - virtual void read(const FileNode& fn); - virtual void write(FileStorage& fs) const; - virtual bool empty() const; + virtual void read(const FileNode& fn) CV_OVERRIDE; + virtual void write(FileStorage& fs) const CV_OVERRIDE; + virtual bool empty() const CV_OVERRIDE; using FaceRecognizer::read; using FaceRecognizer::write; @@ -143,9 +143,9 @@ public: /** @copybrief getNeighbors @see getNeighbors */ CV_WRAP virtual void setNeighbors(int val) = 0; /** @see setThreshold */ - CV_WRAP virtual double getThreshold() const = 0; + CV_WRAP virtual double getThreshold() const CV_OVERRIDE = 0; /** @copybrief getThreshold @see getThreshold */ - CV_WRAP virtual void setThreshold(double val) = 0; + CV_WRAP virtual void setThreshold(double val) CV_OVERRIDE = 0; CV_WRAP virtual std::vector getHistograms() const = 0; CV_WRAP virtual cv::Mat getLabels() const = 0; diff --git a/modules/face/include/opencv2/face/predict_collector.hpp b/modules/face/include/opencv2/face/predict_collector.hpp index a9f907d5c..53bf118d9 100644 --- a/modules/face/include/opencv2/face/predict_collector.hpp +++ b/modules/face/include/opencv2/face/predict_collector.hpp @@ -98,9 +98,9 @@ public: */ StandardCollector(double threshold_ = DBL_MAX); /** @brief overloaded interface method */ - void init(size_t size); + void init(size_t size) CV_OVERRIDE; /** @brief overloaded interface method */ - bool collect(int label, double dist); + bool collect(int label, double dist) CV_OVERRIDE; /** @brief Returns label with minimal distance */ CV_WRAP int getMinLabel() const; /** @brief Returns minimal distance value */ diff --git a/modules/face/src/bif.cpp b/modules/face/src/bif.cpp index d35786ddc..8df96cedd 100644 --- a/modules/face/src/bif.cpp +++ b/modules/face/src/bif.cpp @@ -91,18 +91,18 @@ const double kGaborWavelens[kNumBandsMax][2] = { {11.5, 12.7}, {14.1, 15.4}, {16.8, 18.2}, {19.7, 21.2} }; -class BIFImpl : public cv::face::BIF { +class BIFImpl CV_FINAL : public cv::face::BIF { public: BIFImpl(int num_bands, int num_rotations) { initUnits(num_bands, num_rotations); } - virtual int getNumBands() const { return num_bands_; } + virtual int getNumBands() const CV_OVERRIDE { return num_bands_; } - virtual int getNumRotations() const { return num_rotations_; } + virtual int getNumRotations() const CV_OVERRIDE { return num_rotations_; } virtual void compute(cv::InputArray image, - cv::OutputArray features) const; + cv::OutputArray features) const CV_OVERRIDE; private: struct UnitParams { diff --git a/modules/face/src/eigen_faces.cpp b/modules/face/src/eigen_faces.cpp index 49bdae52b..e57012472 100644 --- a/modules/face/src/eigen_faces.cpp +++ b/modules/face/src/eigen_faces.cpp @@ -43,11 +43,11 @@ public: // Computes an Eigenfaces model with images in src and corresponding labels // in labels. - void train(InputArrayOfArrays src, InputArray labels); + void train(InputArrayOfArrays src, InputArray labels) CV_OVERRIDE; // Send all predict results to caller side for custom result handling - void predict(InputArray src, Ptr collector) const; - String getDefaultName() const + void predict(InputArray src, Ptr collector) const CV_OVERRIDE; + String getDefaultName() const CV_OVERRIDE { return "opencv_eigenfaces"; } diff --git a/modules/face/src/face_alignmentimpl.hpp b/modules/face/src/face_alignmentimpl.hpp index 77f416be6..c8ae3ac42 100644 --- a/modules/face/src/face_alignmentimpl.hpp +++ b/modules/face/src/face_alignmentimpl.hpp @@ -70,12 +70,12 @@ class FacemarkKazemiImpl : public FacemarkKazemi{ public: FacemarkKazemiImpl(const FacemarkKazemi::Params& parameters); - void loadModel(String fs); - bool setFaceDetector(FN_FaceDetector f, void* userdata); - bool getFaces(InputArray image, OutputArray faces); - bool fit(InputArray image, InputArray faces, InputOutputArray landmarks ); - void training(String imageList, String groundTruth); - bool training(vector& images, vector< vector >& landmarks,string filename,Size scale,string modelFilename); + void loadModel(String fs) CV_OVERRIDE; + bool setFaceDetector(FN_FaceDetector f, void* userdata) CV_OVERRIDE; + bool getFaces(InputArray image, OutputArray faces) CV_OVERRIDE; + bool fit(InputArray image, InputArray faces, InputOutputArray landmarks) CV_OVERRIDE; + void training(String imageList, String groundTruth) CV_OVERRIDE; + bool training(vector& images, vector< vector >& landmarks,string filename,Size scale,string modelFilename) CV_OVERRIDE; // Destructor for the class. virtual ~FacemarkKazemiImpl(); @@ -171,4 +171,4 @@ protected: }; }//face }//cv -#endif \ No newline at end of file +#endif diff --git a/modules/face/src/facemarkAAM.cpp b/modules/face/src/facemarkAAM.cpp index 0b7bdc458..9d4a9008e 100644 --- a/modules/face/src/facemarkAAM.cpp +++ b/modules/face/src/facemarkAAM.cpp @@ -92,24 +92,24 @@ void FacemarkAAM::Params::write( cv::FileStorage& fs ) const{ class FacemarkAAMImpl : public FacemarkAAM { public: FacemarkAAMImpl( const FacemarkAAM::Params ¶meters = FacemarkAAM::Params() ); - void read( const FileNode& /*fn*/ ); - void write( FileStorage& /*fs*/ ) const; + void read( const FileNode& /*fn*/ ) CV_OVERRIDE; + void write( FileStorage& /*fs*/ ) const CV_OVERRIDE; void saveModel(String fs); - void loadModel(String fs); + void loadModel(String fs) CV_OVERRIDE; - bool setFaceDetector(bool(*f)(InputArray , OutputArray, void * ), void* userData); - bool getFaces(InputArray image, OutputArray faces); + bool setFaceDetector(bool(*f)(InputArray , OutputArray, void * ), void* userData) CV_OVERRIDE; + bool getFaces(InputArray image, OutputArray faces) CV_OVERRIDE; - bool getData(void * items); + bool getData(void * items) CV_OVERRIDE; protected: - bool fit( InputArray image, InputArray faces, InputOutputArray landmarks, void * runtime_params);//!< from many ROIs + bool fit( InputArray image, InputArray faces, InputOutputArray landmarks, void * runtime_params) CV_OVERRIDE;//!< from many ROIs bool fitImpl( const Mat image, std::vector& landmarks,const Mat R,const Point2f T,const float scale, const int sclIdx=0 ); - bool addTrainingSample(InputArray image, InputArray landmarks); - void training(void* parameters); + bool addTrainingSample(InputArray image, InputArray landmarks) CV_OVERRIDE; + void training(void* parameters) CV_OVERRIDE; Mat procrustes(std::vector , std::vector , Mat & , Scalar & , float & ); void calcMeanShape(std::vector > ,std::vector & ); diff --git a/modules/face/src/facemarkLBF.cpp b/modules/face/src/facemarkLBF.cpp index 0f550eeef..96fba0d4f 100644 --- a/modules/face/src/facemarkLBF.cpp +++ b/modules/face/src/facemarkLBF.cpp @@ -102,24 +102,24 @@ class FacemarkLBFImpl : public FacemarkLBF { public: FacemarkLBFImpl( const FacemarkLBF::Params ¶meters = FacemarkLBF::Params() ); - void read( const FileNode& /*fn*/ ); - void write( FileStorage& /*fs*/ ) const; + void read( const FileNode& /*fn*/ ) CV_OVERRIDE; + void write( FileStorage& /*fs*/ ) const CV_OVERRIDE; - void loadModel(String fs); + void loadModel(String fs) CV_OVERRIDE; - bool setFaceDetector(bool(*f)(InputArray , OutputArray, void * extra_params ), void* userData); - bool getFaces(InputArray image, OutputArray faces); - bool getData(void * items); + bool setFaceDetector(bool(*f)(InputArray , OutputArray, void * extra_params ), void* userData) CV_OVERRIDE; + bool getFaces(InputArray image, OutputArray faces) CV_OVERRIDE; + bool getData(void * items) CV_OVERRIDE; Params params; protected: - bool fit( InputArray image, InputArray faces, InputOutputArray landmarks, void * runtime_params );//!< from many ROIs + bool fit( InputArray image, InputArray faces, InputOutputArray landmarks, void * runtime_params ) CV_OVERRIDE;//!< from many ROIs bool fitImpl( const Mat image, std::vector & landmarks );//!< from a face - bool addTrainingSample(InputArray image, InputArray landmarks); - void training(void* parameters); + bool addTrainingSample(InputArray image, InputArray landmarks) CV_OVERRIDE; + void training(void* parameters) CV_OVERRIDE; Rect getBBox(Mat &img, const Mat_ shape); void prepareTrainingData(Mat img, std::vector facePoints, diff --git a/modules/face/src/fisher_faces.cpp b/modules/face/src/fisher_faces.cpp index 61d43cd55..b51f38bde 100644 --- a/modules/face/src/fisher_faces.cpp +++ b/modules/face/src/fisher_faces.cpp @@ -38,11 +38,11 @@ public: // Computes a Fisherfaces model with images in src and corresponding labels // in labels. - void train(InputArrayOfArrays src, InputArray labels); + void train(InputArrayOfArrays src, InputArray labels) CV_OVERRIDE; // Send all predict results to caller side for custom result handling - void predict(InputArray src, Ptr collector) const; - String getDefaultName() const + void predict(InputArray src, Ptr collector) const CV_OVERRIDE; + String getDefaultName() const CV_OVERRIDE { return "opencv_fisherfaces"; } diff --git a/modules/face/src/lbph_faces.cpp b/modules/face/src/lbph_faces.cpp index 6c5cc029f..98038d863 100644 --- a/modules/face/src/lbph_faces.cpp +++ b/modules/face/src/lbph_faces.cpp @@ -81,40 +81,45 @@ public: train(src, labels); } - ~LBPH() { } + ~LBPH() CV_OVERRIDE { } // Computes a LBPH model with images in src and // corresponding labels in labels. - void train(InputArrayOfArrays src, InputArray labels); + void train(InputArrayOfArrays src, InputArray labels) CV_OVERRIDE; // Updates this LBPH model with images in src and // corresponding labels in labels. - void update(InputArrayOfArrays src, InputArray labels); + void update(InputArrayOfArrays src, InputArray labels) CV_OVERRIDE; // Send all predict results to caller side for custom result handling - void predict(InputArray src, Ptr collector) const; + void predict(InputArray src, Ptr collector) const CV_OVERRIDE; // See FaceRecognizer::write. - void read(const FileNode& fn); + void read(const FileNode& fn) CV_OVERRIDE; // See FaceRecognizer::save. - void write(FileStorage& fs) const; + void write(FileStorage& fs) const CV_OVERRIDE; - bool empty() const { + bool empty() const CV_OVERRIDE { return (_labels.empty()); } - String getDefaultName() const + String getDefaultName() const CV_OVERRIDE { return "opencv_lbphfaces"; } - CV_IMPL_PROPERTY(int, GridX, _grid_x) - CV_IMPL_PROPERTY(int, GridY, _grid_y) - CV_IMPL_PROPERTY(int, Radius, _radius) - CV_IMPL_PROPERTY(int, Neighbors, _neighbors) - CV_IMPL_PROPERTY(double, Threshold, _threshold) - CV_IMPL_PROPERTY_RO(std::vector, Histograms, _histograms) - CV_IMPL_PROPERTY_RO(cv::Mat, Labels, _labels) + inline int getGridX() const CV_OVERRIDE { return _grid_x; } + inline void setGridX(int val) CV_OVERRIDE { _grid_x = val; } + inline int getGridY() const CV_OVERRIDE { return _grid_y; } + inline void setGridY(int val) CV_OVERRIDE { _grid_y = val; } + inline int getRadius() const CV_OVERRIDE { return _radius; } + inline void setRadius(int val) CV_OVERRIDE { _radius = val; } + inline int getNeighbors() const CV_OVERRIDE { return _neighbors; } + inline void setNeighbors(int val) CV_OVERRIDE { _neighbors = val; } + inline double getThreshold() const CV_OVERRIDE { return _threshold; } + inline void setThreshold(double val) CV_OVERRIDE { _threshold = val; } + inline std::vector getHistograms() const CV_OVERRIDE { return _histograms; } + inline cv::Mat getLabels() const CV_OVERRIDE { return _labels; } }; diff --git a/modules/face/src/mace.cpp b/modules/face/src/mace.cpp index 109476eaa..5aba170c3 100644 --- a/modules/face/src/mace.cpp +++ b/modules/face/src/mace.cpp @@ -72,7 +72,7 @@ static uint64 crc64( const uchar* data, size_t size, uint64 crc0=0 ) return ~crc; } -struct MACEImpl : MACE { +struct MACEImpl CV_FINAL : MACE { Mat_ maceFilter; // filled from compute() Mat convFilter; // optional random convolution (cancellable) int IMGSIZE; // images will get resized to this @@ -81,7 +81,7 @@ struct MACEImpl : MACE { MACEImpl(int siz) : IMGSIZE(siz), threshold(DBL_MAX) {} - void salt(const String &passphrase) { + void salt(const String &passphrase) CV_OVERRIDE { theRNG().state = ((int64)crc64((uchar*)passphrase.c_str(), passphrase.size())); convFilter.create(IMGSIZE, IMGSIZE, CV_64F); randn(convFilter, 0, 1.0/(IMGSIZE*IMGSIZE)); @@ -257,7 +257,7 @@ struct MACEImpl : MACE { } // MACE interface - void train(InputArrayOfArrays input) { + void train(InputArrayOfArrays input) CV_OVERRIDE { std::vector images, dftImg; input.getMatVector(images); for (size_t i=0; i= threshold; } // cv::Algorithm: - bool empty() const { + bool empty() const CV_OVERRIDE { return maceFilter.empty() || IMGSIZE == 0; } - String getDefaultName () const { + String getDefaultName () const CV_OVERRIDE { return String("MACE"); } - void clear() { + void clear() CV_OVERRIDE { maceFilter.release(); convFilter.release(); } - void write(cv::FileStorage &fs) const { + void write(cv::FileStorage &fs) const CV_OVERRIDE { fs << "mace" << maceFilter; fs << "conv" << convFilter; fs << "threshold" << threshold; } - void read(const cv::FileNode &fn) { + void read(const cv::FileNode &fn) CV_OVERRIDE { fn["mace"] >> maceFilter; fn["conv"] >> convFilter; fn["threshold"] >> threshold; diff --git a/modules/face/src/regtree.cpp b/modules/face/src/regtree.cpp index 9ee01ac2f..6c29b23bf 100644 --- a/modules/face/src/regtree.cpp +++ b/modules/face/src/regtree.cpp @@ -18,7 +18,7 @@ class doSum : public ParallelLoopBody sum(sum_) { } - virtual void operator()( const Range& range) const + virtual void operator()( const Range& range) const CV_OVERRIDE { for (int j = range.start; j < range.end; ++j){ for(unsigned long k=0;k<(*samples)[j].shapeResiduals.size();k++){ @@ -38,7 +38,7 @@ class modifySamples : public ParallelLoopBody temp(temp_) { } - virtual void operator()( const Range& range) const + virtual void operator()( const Range& range) const CV_OVERRIDE { for (int j = range.start; j < range.end; ++j){ for(unsigned long k=0;k<(*samples)[j].shapeResiduals.size();k++){ @@ -62,7 +62,7 @@ class splitSamples : public ParallelLoopBody feats(feats_) { } - virtual void operator()( const Range& range) const + virtual void operator()( const Range& range) const CV_OVERRIDE { for (int i = range.start; i < range.end; ++i){ for(unsigned long j=0;j<*(num_test_splits);j++){ @@ -310,4 +310,4 @@ unsigned long FacemarkKazemiImpl::divideSamples (splitr split,vector& images, vector< vector > return true; } }//cv -}//face \ No newline at end of file +}//face diff --git a/modules/freetype/src/freetype.cpp b/modules/freetype/src/freetype.cpp index c12976198..5e569e076 100644 --- a/modules/freetype/src/freetype.cpp +++ b/modules/freetype/src/freetype.cpp @@ -61,22 +61,22 @@ namespace freetype { using namespace std; -class CV_EXPORTS_W FreeType2Impl : public FreeType2 +class CV_EXPORTS_W FreeType2Impl CV_FINAL : public FreeType2 { public: FreeType2Impl(); ~FreeType2Impl(); - void loadFontData(String fontFileName, int id) ; - void setSplitNumber( int num ); + void loadFontData(String fontFileName, int id) CV_OVERRIDE; + void setSplitNumber( int num ) CV_OVERRIDE; void putText( InputOutputArray img, const String& text, Point org, int fontHeight, Scalar color, int thickness, int line_type, bool bottomLeftOrigin - ); + ) CV_OVERRIDE; Size getTextSize( const String& text, int fontHeight, int thickness, CV_OUT int* baseLine - ); + ) CV_OVERRIDE; private: FT_Library mLibrary; diff --git a/modules/hdf/src/hdf5.cpp b/modules/hdf/src/hdf5.cpp index e60a2c4e5..a24092a4e 100644 --- a/modules/hdf/src/hdf5.cpp +++ b/modules/hdf/src/hdf5.cpp @@ -43,151 +43,151 @@ namespace cv namespace hdf { -class HDF5Impl : public HDF5 +class HDF5Impl CV_FINAL : public HDF5 { public: HDF5Impl( const String& HDF5Filename ); - virtual ~HDF5Impl() { close(); }; + virtual ~HDF5Impl() CV_OVERRIDE { close(); }; // close and release - virtual void close( ); + virtual void close( ) CV_OVERRIDE; /* * h5 generic */ // check if object / link exists - virtual bool hlexists( const String& label ) const; + virtual bool hlexists( const String& label ) const CV_OVERRIDE; - virtual bool atexists(const String& atlabel) const; - virtual void atdelete(const String& atlabel); + virtual bool atexists(const String& atlabel) const CV_OVERRIDE; + virtual void atdelete(const String& atlabel) CV_OVERRIDE; - virtual void atwrite(const int value, const String& atlabel); - virtual void atread(int* value, const String& atlabel); + virtual void atwrite(const int value, const String& atlabel) CV_OVERRIDE; + virtual void atread(int* value, const String& atlabel) CV_OVERRIDE; - virtual void atwrite(const double value, const String& atlabel); - virtual void atread(double* value, const String& atlabel); + virtual void atwrite(const double value, const String& atlabel) CV_OVERRIDE; + virtual void atread(double* value, const String& atlabel) CV_OVERRIDE; - virtual void atwrite(const String& value, const String& atlabel); - virtual void atread(String* value, const String& atlabel); + virtual void atwrite(const String& value, const String& atlabel) CV_OVERRIDE; + virtual void atread(String* value, const String& atlabel) CV_OVERRIDE; - virtual void atwrite(InputArray value, const String& atlabel); - virtual void atread(OutputArray value, const String& atlabel); + virtual void atwrite(InputArray value, const String& atlabel) CV_OVERRIDE; + virtual void atread(OutputArray value, const String& atlabel) CV_OVERRIDE; /* * h5 group */ // create a group - virtual void grcreate( const String& grlabel ); + virtual void grcreate( const String& grlabel ) CV_OVERRIDE; /* * cv::Mat */ // get sizes of dataset - virtual vector dsgetsize( const String& dslabel, int dims_flag = H5_GETDIMS ) const; + virtual vector dsgetsize( const String& dslabel, int dims_flag = H5_GETDIMS ) const CV_OVERRIDE; /* get data type of dataset */ - virtual int dsgettype( const String& dslabel ) const; + virtual int dsgettype( const String& dslabel ) const CV_OVERRIDE; // overload dscreate() #1 - virtual void dscreate( const int rows, const int cols, const int type, const String& dslabel ) const; + virtual void dscreate( const int rows, const int cols, const int type, const String& dslabel ) const CV_OVERRIDE; // overload dscreate() #2 virtual void dscreate( const int rows, const int cols, const int type, const String& dslabel, - const int compresslevel ) const; + const int compresslevel ) const CV_OVERRIDE; // overload dscreate() #3 virtual void dscreate( const int rows, const int cols, const int type, const String& dslabel, - const int compresslevel, const vector& dims_chunks ) const; + const int compresslevel, const vector& dims_chunks ) const CV_OVERRIDE; /* create two dimensional single or mutichannel dataset */ virtual void dscreate( const int rows, const int cols, const int type, const String& dslabel, - const int compresslevel, const int* dims_chunks ) const; + const int compresslevel, const int* dims_chunks ) const CV_OVERRIDE; // overload dscreate() #1 virtual void dscreate( const int n_dims, const int* sizes, const int type, - const String& dslabel ) const; + const String& dslabel ) const CV_OVERRIDE; // overload dscreate() #2 virtual void dscreate( const int n_dims, const int* sizes, const int type, - const String& dslabel, const int compresslevel ) const; + const String& dslabel, const int compresslevel ) const CV_OVERRIDE; // overload dscreate() #3 virtual void dscreate( const vector& sizes, const int type, const String& dslabel, - const int compresslevel = H5_NONE, const vector& dims_chunks = vector() ) const; + const int compresslevel = H5_NONE, const vector& dims_chunks = vector() ) const CV_OVERRIDE; /* create n-dimensional single or mutichannel dataset */ virtual void dscreate( const int n_dims, const int* sizes, const int type, - const String& dslabel, const int compresslevel, const int* dims_chunks ) const; + const String& dslabel, const int compresslevel, const int* dims_chunks ) const CV_OVERRIDE; // overload dswrite() #1 - virtual void dswrite( InputArray Array, const String& dslabel ) const; + virtual void dswrite( InputArray Array, const String& dslabel ) const CV_OVERRIDE; // overload dswrite() #2 - virtual void dswrite( InputArray Array, const String& dslabel, const int* dims_offset ) const; + virtual void dswrite( InputArray Array, const String& dslabel, const int* dims_offset ) const CV_OVERRIDE; // overload dswrite() #3 virtual void dswrite( InputArray Array, const String& dslabel, const vector& dims_offset, - const vector& dims_counts = vector() ) const; + const vector& dims_counts = vector() ) const CV_OVERRIDE; /* write into dataset */ virtual void dswrite( InputArray Array, const String& dslabel, - const int* dims_offset, const int* dims_counts ) const; + const int* dims_offset, const int* dims_counts ) const CV_OVERRIDE; // overload dsinsert() #1 - virtual void dsinsert( InputArray Array, const String& dslabel ) const; + virtual void dsinsert( InputArray Array, const String& dslabel ) const CV_OVERRIDE; // overload dsinsert() #2 - virtual void dsinsert( InputArray Array, const String& dslabel, const int* dims_offset ) const; + virtual void dsinsert( InputArray Array, const String& dslabel, const int* dims_offset ) const CV_OVERRIDE; // overload dsinsert() #3 virtual void dsinsert( InputArray Array, const String& dslabel, - const vector& dims_offset, const vector& dims_counts = vector() ) const; + const vector& dims_offset, const vector& dims_counts = vector() ) const CV_OVERRIDE; /* append / merge into dataset */ virtual void dsinsert( InputArray Array, const String& dslabel, - const int* dims_offset = NULL, const int* dims_counts = NULL ) const; + const int* dims_offset = NULL, const int* dims_counts = NULL ) const CV_OVERRIDE; // overload dsread() #1 - virtual void dsread( OutputArray Array, const String& dslabel ) const; + virtual void dsread( OutputArray Array, const String& dslabel ) const CV_OVERRIDE; // overload dsread() #2 - virtual void dsread( OutputArray Array, const String& dslabel, const int* dims_offset ) const; + virtual void dsread( OutputArray Array, const String& dslabel, const int* dims_offset ) const CV_OVERRIDE; // overload dsread() #3 virtual void dsread( OutputArray Array, const String& dslabel, - const vector& dims_offset, const vector& dims_counts = vector() ) const; + const vector& dims_offset, const vector& dims_counts = vector() ) const CV_OVERRIDE; // read from dataset virtual void dsread( OutputArray Array, const String& dslabel, - const int* dims_offset, const int* dims_counts ) const; + const int* dims_offset, const int* dims_counts ) const CV_OVERRIDE; /* * std::vector */ // get size of keypoints dataset - virtual int kpgetsize( const String& kplabel, int dims_flag = H5_GETDIMS ) const; + virtual int kpgetsize( const String& kplabel, int dims_flag = H5_GETDIMS ) const CV_OVERRIDE; // create KeyPoint structure virtual void kpcreate( const int size, const String& kplabel, - const int compresslevel = H5_NONE, const int chunks = H5_NONE ) const; + const int compresslevel = H5_NONE, const int chunks = H5_NONE ) const CV_OVERRIDE; // write KeyPoint structures virtual void kpwrite( const vector keypoints, const String& kplabel, - const int offset = H5_NONE, const int counts = H5_NONE ) const; + const int offset = H5_NONE, const int counts = H5_NONE ) const CV_OVERRIDE; // append / merge KeyPoint structures virtual void kpinsert( const vector keypoints, const String& kplabel, - const int offset = H5_NONE, const int counts = H5_NONE ) const; + const int offset = H5_NONE, const int counts = H5_NONE ) const CV_OVERRIDE; // read KeyPoint structure virtual void kpread( vector& keypoints, const String& kplabel, - const int offset = H5_NONE, const int counts = H5_NONE ) const; + const int offset = H5_NONE, const int counts = H5_NONE ) const CV_OVERRIDE; private: diff --git a/modules/hfs/src/hfs.cpp b/modules/hfs/src/hfs.cpp index 42949d868..a612a1d23 100644 --- a/modules/hfs/src/hfs.cpp +++ b/modules/hfs/src/hfs.cpp @@ -9,73 +9,73 @@ namespace cv{ namespace hfs{ -class HfsSegmentImpl : public cv::hfs::HfsSegment{ +class HfsSegmentImpl CV_FINAL : public cv::hfs::HfsSegment{ public: - void setSegEgbThresholdI(float c) + void setSegEgbThresholdI(float c) CV_OVERRIDE { core->hfsSettings.egbThresholdI = c; } - float getSegEgbThresholdI() { + float getSegEgbThresholdI() CV_OVERRIDE { return core->hfsSettings.egbThresholdI; } - void setMinRegionSizeI(int n) + void setMinRegionSizeI(int n) CV_OVERRIDE { core->hfsSettings.minRegionSizeI = n; } - int getMinRegionSizeI() + int getMinRegionSizeI() CV_OVERRIDE { return core->hfsSettings.minRegionSizeI; } - void setSegEgbThresholdII(float c) + void setSegEgbThresholdII(float c) CV_OVERRIDE { core->hfsSettings.egbThresholdII = c; } - float getSegEgbThresholdII() { + float getSegEgbThresholdII() CV_OVERRIDE { return core->hfsSettings.egbThresholdII; } - void setMinRegionSizeII(int n) + void setMinRegionSizeII(int n) CV_OVERRIDE { core->hfsSettings.minRegionSizeII = n; } - int getMinRegionSizeII() + int getMinRegionSizeII() CV_OVERRIDE { return core->hfsSettings.minRegionSizeII; } - void setSpatialWeight(float w) + void setSpatialWeight(float w) CV_OVERRIDE { core->hfsSettings.slicSettings.coh_weight = w; core->reconstructEngine(); } - float getSpatialWeight() + float getSpatialWeight() CV_OVERRIDE { return core->hfsSettings.slicSettings.coh_weight; } - void setSlicSpixelSize(int n) + void setSlicSpixelSize(int n) CV_OVERRIDE { core->hfsSettings.slicSettings.spixel_size = n; core->reconstructEngine(); } - int getSlicSpixelSize() + int getSlicSpixelSize() CV_OVERRIDE { return core->hfsSettings.slicSettings.spixel_size; } - void setNumSlicIter(int n) + void setNumSlicIter(int n) CV_OVERRIDE { core->hfsSettings.slicSettings.num_iters = n; core->reconstructEngine(); } - int getNumSlicIter() + int getNumSlicIter() CV_OVERRIDE { return core->hfsSettings.slicSettings.num_iters; } @@ -90,8 +90,8 @@ public: spatialWeight, spixelSize, numIter)); } - Mat performSegmentGpu(InputArray src, bool ifDraw = true); - Mat performSegmentCpu(InputArray src, bool ifDraw = true); + Mat performSegmentGpu(InputArray src, bool ifDraw = true) CV_OVERRIDE; + Mat performSegmentCpu(InputArray src, bool ifDraw = true) CV_OVERRIDE; private: Ptr core; }; diff --git a/modules/img_hash/src/average_hash.cpp b/modules/img_hash/src/average_hash.cpp index 6690952cc..316a2165c 100644 --- a/modules/img_hash/src/average_hash.cpp +++ b/modules/img_hash/src/average_hash.cpp @@ -10,7 +10,7 @@ using namespace img_hash; namespace { -class AverageHashImpl : public ImgHashBase::ImgHashImpl +class AverageHashImpl CV_FINAL : public ImgHashBase::ImgHashImpl { private: cv::Mat bitsImg; @@ -19,7 +19,7 @@ private: public: - virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) + virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) CV_OVERRIDE { cv::Mat const input = inputArr.getMat(); CV_Assert(input.type() == CV_8UC4 || @@ -59,7 +59,7 @@ public: } } - virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const + virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const CV_OVERRIDE { return norm(hashOne, hashTwo, NORM_HAMMING); } diff --git a/modules/img_hash/src/block_mean_hash.cpp b/modules/img_hash/src/block_mean_hash.cpp index 768ae7382..15d4fd3c1 100644 --- a/modules/img_hash/src/block_mean_hash.cpp +++ b/modules/img_hash/src/block_mean_hash.cpp @@ -22,7 +22,7 @@ enum colSize = imgWidth - blockWidth }; -class BlockMeanHashImpl : public ImgHashBase::ImgHashImpl +class BlockMeanHashImpl CV_FINAL : public ImgHashBase::ImgHashImpl { public: BlockMeanHashImpl(int mode) @@ -30,9 +30,9 @@ public: setMode(mode); } - ~BlockMeanHashImpl() {} + ~BlockMeanHashImpl() CV_OVERRIDE {} - virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) + virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) CV_OVERRIDE { cv::Mat const input = inputArr.getMat(); CV_Assert(input.type() == CV_8UC4 || @@ -81,7 +81,7 @@ public: createHash(hash); } - virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const + virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const CV_OVERRIDE { return norm(hashOne, hashTwo, NORM_HAMMING); } diff --git a/modules/img_hash/src/color_moment_hash.cpp b/modules/img_hash/src/color_moment_hash.cpp index 006f40efd..90f2972cc 100644 --- a/modules/img_hash/src/color_moment_hash.cpp +++ b/modules/img_hash/src/color_moment_hash.cpp @@ -10,12 +10,12 @@ using namespace std; namespace { -class ColorMomentHashImpl : public ImgHashBase::ImgHashImpl +class ColorMomentHashImpl CV_FINAL : public ImgHashBase::ImgHashImpl { public: - ~ColorMomentHashImpl() {} + ~ColorMomentHashImpl() CV_OVERRIDE {} - virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) + virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) CV_OVERRIDE { cv::Mat const input = inputArr.getMat(); CV_Assert(input.type() == CV_8UC4 || @@ -51,7 +51,7 @@ public: computeMoments(hash.ptr(0) + 21); } - virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const + virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const CV_OVERRIDE { return norm(hashOne, hashTwo, NORM_L2) * 10000; } diff --git a/modules/img_hash/src/marr_hildreth_hash.cpp b/modules/img_hash/src/marr_hildreth_hash.cpp index 54a6e85be..2feeb0e78 100644 --- a/modules/img_hash/src/marr_hildreth_hash.cpp +++ b/modules/img_hash/src/marr_hildreth_hash.cpp @@ -86,7 +86,7 @@ void createHash(cv::Mat const &blocks, cv::Mat &hash) } } -class MarrHildrethHashImpl : public ImgHashBase::ImgHashImpl +class MarrHildrethHashImpl CV_FINAL : public ImgHashBase::ImgHashImpl { public: @@ -96,9 +96,9 @@ public: blocks.create(31,31, CV_32F); } - ~MarrHildrethHashImpl() { } + ~MarrHildrethHashImpl() CV_OVERRIDE { } - virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) + virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) CV_OVERRIDE { cv::Mat const input = inputArr.getMat(); CV_Assert(input.type() == CV_8UC4 || @@ -131,7 +131,7 @@ public: createHash(blocks, hash); } - virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const + virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const CV_OVERRIDE { return norm(hashOne, hashTwo, NORM_HAMMING); } diff --git a/modules/img_hash/src/phash.cpp b/modules/img_hash/src/phash.cpp index fd672d971..03eefa97b 100644 --- a/modules/img_hash/src/phash.cpp +++ b/modules/img_hash/src/phash.cpp @@ -10,10 +10,10 @@ using namespace std; namespace { -class PHashImpl : public ImgHashBase::ImgHashImpl +class PHashImpl CV_FINAL : public ImgHashBase::ImgHashImpl { public: - virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) + virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) CV_OVERRIDE { cv::Mat const input = inputArr.getMat(); CV_Assert(input.type() == CV_8UC4 || @@ -58,7 +58,7 @@ public: } } - virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const + virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const CV_OVERRIDE { return norm(hashOne, hashTwo, NORM_HAMMING); } diff --git a/modules/img_hash/src/radial_variance_hash.cpp b/modules/img_hash/src/radial_variance_hash.cpp index 1265abc31..b2eaef2ec 100644 --- a/modules/img_hash/src/radial_variance_hash.cpp +++ b/modules/img_hash/src/radial_variance_hash.cpp @@ -26,7 +26,7 @@ inline int createOffSet(int length) return static_cast(std::floor(center + roundingFactor(center))); } -class RadialVarianceHashImpl : public ImgHashBase::ImgHashImpl +class RadialVarianceHashImpl CV_FINAL : public ImgHashBase::ImgHashImpl { public: cv::Mat blurImg_; @@ -42,9 +42,9 @@ public: { } - ~RadialVarianceHashImpl() {} + ~RadialVarianceHashImpl() CV_OVERRIDE {} - virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) + virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) CV_OVERRIDE { cv::Mat const input = inputArr.getMat(); CV_Assert(input.type() == CV_8UC4 || @@ -72,7 +72,7 @@ public: hashCalculate(hash); } - virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const + virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const CV_OVERRIDE { cv::Mat const hashOneF = hashOne.getMat(); cv::Mat const hashTwoF = hashTwo.getMat(); diff --git a/modules/line_descriptor/include/opencv2/line_descriptor/descriptor.hpp b/modules/line_descriptor/include/opencv2/line_descriptor/descriptor.hpp index e8d3050ac..fa8f9ee25 100644 --- a/modules/line_descriptor/include/opencv2/line_descriptor/descriptor.hpp +++ b/modules/line_descriptor/include/opencv2/line_descriptor/descriptor.hpp @@ -253,13 +253,13 @@ class CV_EXPORTS BinaryDescriptor : public Algorithm @param fn source FileNode file */ - virtual void read( const cv::FileNode& fn ); + virtual void read( const cv::FileNode& fn ) CV_OVERRIDE; /** @brief Store parameters to a FileStorage object @param fs output FileStorage file */ - virtual void write( cv::FileStorage& fs ) const; + virtual void write( cv::FileStorage& fs ) const CV_OVERRIDE; /** @brief Requires line detection @@ -1076,7 +1076,7 @@ static Ptr createBinaryDescriptorMatcher(); /** @brief Clear dataset and internal data */ -void clear(); +void clear() CV_OVERRIDE; /** @brief Constructor. diff --git a/modules/optflow/include/opencv2/optflow/pcaflow.hpp b/modules/optflow/include/opencv2/optflow/pcaflow.hpp index 6645363b2..78946f69d 100644 --- a/modules/optflow/include/opencv2/optflow/pcaflow.hpp +++ b/modules/optflow/include/opencv2/optflow/pcaflow.hpp @@ -117,8 +117,8 @@ public: float _sparseRate = 0.024, float _retainedCornersFraction = 0.2, float _occlusionsThreshold = 0.0003, float _dampingFactor = 0.00002, float _claheClip = 14 ); - void calc( InputArray I0, InputArray I1, InputOutputArray flow ); - void collectGarbage(); + void calc( InputArray I0, InputArray I1, InputOutputArray flow ) CV_OVERRIDE; + void collectGarbage() CV_OVERRIDE; private: void findSparseFeatures( UMat &from, UMat &to, std::vector &features, diff --git a/modules/optflow/include/opencv2/optflow/sparse_matching_gpc.hpp b/modules/optflow/include/opencv2/optflow/sparse_matching_gpc.hpp index d75d65fd4..9458ffb32 100644 --- a/modules/optflow/include/opencv2/optflow/sparse_matching_gpc.hpp +++ b/modules/optflow/include/opencv2/optflow/sparse_matching_gpc.hpp @@ -182,9 +182,9 @@ private: public: void train( GPCTrainingSamples &samples, const GPCTrainingParams params = GPCTrainingParams() ); - void write( FileStorage &fs ) const; + void write( FileStorage &fs ) const CV_OVERRIDE; - void read( const FileNode &fn ); + void read( const FileNode &fn ) CV_OVERRIDE; unsigned findLeafForPatch( const GPCPatchDescriptor &descr ) const; @@ -227,7 +227,7 @@ private: ParallelTrailsFilling( const GPCForest *_forest, const std::vector< GPCPatchDescriptor > *_descr, std::vector< Trail > *_trails ) : forest( _forest ), descr( _descr ), trails( _trails ){}; - void operator()( const Range &range ) const + void operator()( const Range &range ) const CV_OVERRIDE { for ( int t = range.start; t < range.end; ++t ) for ( size_t i = 0; i < descr->size(); ++i ) @@ -272,7 +272,7 @@ public: } } - void write( FileStorage &fs ) const + void write( FileStorage &fs ) const CV_OVERRIDE { fs << "ntrees" << T << "trees" << "["; @@ -285,7 +285,7 @@ public: fs << "]"; } - void read( const FileNode &fn ) + void read( const FileNode &fn ) CV_OVERRIDE { CV_Assert( T <= (int)fn["ntrees"] ); FileNodeIterator it = fn["trees"].begin(); diff --git a/modules/optflow/src/deepflow.cpp b/modules/optflow/src/deepflow.cpp index 61b510111..92423fa32 100644 --- a/modules/optflow/src/deepflow.cpp +++ b/modules/optflow/src/deepflow.cpp @@ -52,8 +52,8 @@ class OpticalFlowDeepFlow: public DenseOpticalFlow public: OpticalFlowDeepFlow(); - void calc( InputArray I0, InputArray I1, InputOutputArray flow ); - void collectGarbage(); + void calc( InputArray I0, InputArray I1, InputOutputArray flow ) CV_OVERRIDE; + void collectGarbage() CV_OVERRIDE; protected: float sigma; // Gaussian smoothing parameter diff --git a/modules/optflow/src/dis_flow.cpp b/modules/optflow/src/dis_flow.cpp index 5b7f82c93..fd05077a7 100644 --- a/modules/optflow/src/dis_flow.cpp +++ b/modules/optflow/src/dis_flow.cpp @@ -52,13 +52,13 @@ namespace cv namespace optflow { -class DISOpticalFlowImpl : public DISOpticalFlow +class DISOpticalFlowImpl CV_FINAL : public DISOpticalFlow { public: DISOpticalFlowImpl(); - void calc(InputArray I0, InputArray I1, InputOutputArray flow); - void collectGarbage(); + void calc(InputArray I0, InputArray I1, InputOutputArray flow) CV_OVERRIDE; + void collectGarbage() CV_OVERRIDE; protected: //!< algorithm parameters int finest_scale, coarsest_scale; @@ -78,27 +78,27 @@ class DISOpticalFlowImpl : public DISOpticalFlow int ws, hs; //!< sparse flow buffer width and height on the current scale public: - int getFinestScale() const { return finest_scale; } - void setFinestScale(int val) { finest_scale = val; } - int getPatchSize() const { return patch_size; } - void setPatchSize(int val) { patch_size = val; } - int getPatchStride() const { return patch_stride; } - void setPatchStride(int val) { patch_stride = val; } - int getGradientDescentIterations() const { return grad_descent_iter; } - void setGradientDescentIterations(int val) { grad_descent_iter = val; } - int getVariationalRefinementIterations() const { return variational_refinement_iter; } - void setVariationalRefinementIterations(int val) { variational_refinement_iter = val; } - float getVariationalRefinementAlpha() const { return variational_refinement_alpha; } - void setVariationalRefinementAlpha(float val) { variational_refinement_alpha = val; } - float getVariationalRefinementDelta() const { return variational_refinement_delta; } - void setVariationalRefinementDelta(float val) { variational_refinement_delta = val; } - float getVariationalRefinementGamma() const { return variational_refinement_gamma; } - void setVariationalRefinementGamma(float val) { variational_refinement_gamma = val; } - - bool getUseMeanNormalization() const { return use_mean_normalization; } - void setUseMeanNormalization(bool val) { use_mean_normalization = val; } - bool getUseSpatialPropagation() const { return use_spatial_propagation; } - void setUseSpatialPropagation(bool val) { use_spatial_propagation = val; } + int getFinestScale() const CV_OVERRIDE { return finest_scale; } + void setFinestScale(int val) CV_OVERRIDE { finest_scale = val; } + int getPatchSize() const CV_OVERRIDE { return patch_size; } + void setPatchSize(int val) CV_OVERRIDE { patch_size = val; } + int getPatchStride() const CV_OVERRIDE { return patch_stride; } + void setPatchStride(int val) CV_OVERRIDE { patch_stride = val; } + int getGradientDescentIterations() const CV_OVERRIDE { return grad_descent_iter; } + void setGradientDescentIterations(int val) CV_OVERRIDE { grad_descent_iter = val; } + int getVariationalRefinementIterations() const CV_OVERRIDE { return variational_refinement_iter; } + void setVariationalRefinementIterations(int val) CV_OVERRIDE { variational_refinement_iter = val; } + float getVariationalRefinementAlpha() const CV_OVERRIDE { return variational_refinement_alpha; } + void setVariationalRefinementAlpha(float val) CV_OVERRIDE { variational_refinement_alpha = val; } + float getVariationalRefinementDelta() const CV_OVERRIDE { return variational_refinement_delta; } + void setVariationalRefinementDelta(float val) CV_OVERRIDE { variational_refinement_delta = val; } + float getVariationalRefinementGamma() const CV_OVERRIDE { return variational_refinement_gamma; } + void setVariationalRefinementGamma(float val) CV_OVERRIDE { variational_refinement_gamma = val; } + + bool getUseMeanNormalization() const CV_OVERRIDE { return use_mean_normalization; } + void setUseMeanNormalization(bool val) CV_OVERRIDE { use_mean_normalization = val; } + bool getUseSpatialPropagation() const CV_OVERRIDE { return use_spatial_propagation; } + void setUseSpatialPropagation(bool val) CV_OVERRIDE { use_spatial_propagation = val; } protected: //!< internal buffers vector > I0s; //!< Gaussian pyramid for the current frame @@ -153,7 +153,7 @@ class DISOpticalFlowImpl : public DISOpticalFlow PatchInverseSearch_ParBody(DISOpticalFlowImpl &_dis, int _nstripes, int _hs, Mat &dst_Sx, Mat &dst_Sy, Mat &src_Ux, Mat &src_Uy, Mat &_I0, Mat &_I1, Mat &_I0x, Mat &_I0y, int _num_iter, int _pyr_level); - void operator()(const Range &range) const; + void operator()(const Range &range) const CV_OVERRIDE; }; struct Densification_ParBody : public ParallelLoopBody @@ -165,7 +165,7 @@ class DISOpticalFlowImpl : public DISOpticalFlow Densification_ParBody(DISOpticalFlowImpl &_dis, int _nstripes, int _h, Mat &dst_Ux, Mat &dst_Uy, Mat &src_Sx, Mat &src_Sy, Mat &_I0, Mat &_I1); - void operator()(const Range &range) const; + void operator()(const Range &range) const CV_OVERRIDE; }; #ifdef HAVE_OPENCL diff --git a/modules/optflow/src/interfaces.cpp b/modules/optflow/src/interfaces.cpp index 4d9a1cea8..2f657584d 100644 --- a/modules/optflow/src/interfaces.cpp +++ b/modules/optflow/src/interfaces.cpp @@ -53,8 +53,8 @@ class OpticalFlowSimpleFlow : public DenseOpticalFlow { public: OpticalFlowSimpleFlow(); - void calc(InputArray I0, InputArray I1, InputOutputArray flow); - void collectGarbage(); + void calc(InputArray I0, InputArray I1, InputOutputArray flow) CV_OVERRIDE; + void collectGarbage() CV_OVERRIDE; protected: int layers; @@ -125,8 +125,8 @@ class OpticalFlowFarneback : public DenseOpticalFlow { public: OpticalFlowFarneback(); - void calc(InputArray I0, InputArray I1, InputOutputArray flow); - void collectGarbage(); + void calc(InputArray I0, InputArray I1, InputOutputArray flow) CV_OVERRIDE; + void collectGarbage() CV_OVERRIDE; protected: int numLevels; double pyrScale; @@ -181,8 +181,8 @@ class OpticalFlowSparseToDense : public DenseOpticalFlow { public: OpticalFlowSparseToDense(int _grid_step, int _k, float _sigma, bool _use_post_proc, float _fgs_lambda, float _fgs_sigma); - void calc(InputArray I0, InputArray I1, InputOutputArray flow); - void collectGarbage(); + void calc(InputArray I0, InputArray I1, InputOutputArray flow) CV_OVERRIDE; + void collectGarbage() CV_OVERRIDE; protected: int grid_step; int k; diff --git a/modules/optflow/src/simpleflow.cpp b/modules/optflow/src/simpleflow.cpp index 337ef0073..5067605dc 100644 --- a/modules/optflow/src/simpleflow.cpp +++ b/modules/optflow/src/simpleflow.cpp @@ -136,7 +136,7 @@ public: CV_DbgAssert(joint.cols == src.cols && confidence.cols == src.cols && src.cols == dst.cols + 2 * radius); } - void operator()(const Range &range) const { + void operator()(const Range &range) const CV_OVERRIDE { const int d = 2*radius +1; for (int i = range.start; i < range.end; i++) { SrcVec* dstRow = dst.ptr(i); @@ -296,7 +296,7 @@ public: CV_DbgAssert(prev.cols == next.cols && next.cols == dst.cols + 2 * radius); } - void operator()(const Range &range) const { + void operator()(const Range &range) const CV_OVERRIDE { int d = 2 * radius + 1; Mat weights(d, d, CV_32F); for (int i = range.start; i < range.end; i++) { diff --git a/modules/optflow/src/sparse_matching_gpc.cpp b/modules/optflow/src/sparse_matching_gpc.cpp index 6c485e160..d7b920d14 100644 --- a/modules/optflow/src/sparse_matching_gpc.cpp +++ b/modules/optflow/src/sparse_matching_gpc.cpp @@ -249,7 +249,7 @@ public: ParallelDCTFiller( const Size &_sz, const Mat *_imgCh, std::vector< GPCPatchDescriptor > *_descr ) : sz( _sz ), imgCh( _imgCh ), descr( _descr ){}; - void operator()( const Range &range ) const + void operator()( const Range &range ) const CV_OVERRIDE { for ( int i = range.start; i < range.end; ++i ) { @@ -312,7 +312,7 @@ public: ParallelWHTFiller( const Size &_sz, const Mat *_imgChInt, std::vector< GPCPatchDescriptor > *_descr ) : sz( _sz ), imgChInt( _imgChInt ), descr( _descr ){}; - void operator()( const Range &range ) const + void operator()( const Range &range ) const CV_OVERRIDE { for ( int i = range.start; i < range.end; ++i ) { diff --git a/modules/optflow/src/variational_refinement.cpp b/modules/optflow/src/variational_refinement.cpp index 6353c09a7..d29ae254d 100644 --- a/modules/optflow/src/variational_refinement.cpp +++ b/modules/optflow/src/variational_refinement.cpp @@ -49,14 +49,14 @@ namespace cv namespace optflow { -class VariationalRefinementImpl : public VariationalRefinement +class VariationalRefinementImpl CV_FINAL : public VariationalRefinement { public: VariationalRefinementImpl(); - void calc(InputArray I0, InputArray I1, InputOutputArray flow); - void calcUV(InputArray I0, InputArray I1, InputOutputArray flow_u, InputOutputArray flow_v); - void collectGarbage(); + void calc(InputArray I0, InputArray I1, InputOutputArray flow) CV_OVERRIDE; + void calcUV(InputArray I0, InputArray I1, InputOutputArray flow_u, InputOutputArray flow_v) CV_OVERRIDE; + void collectGarbage() CV_OVERRIDE; protected: //!< algorithm parameters int fixedPointIterations, sorIterations; @@ -65,18 +65,18 @@ class VariationalRefinementImpl : public VariationalRefinement float zeta, epsilon; public: - int getFixedPointIterations() const { return fixedPointIterations; } - void setFixedPointIterations(int val) { fixedPointIterations = val; } - int getSorIterations() const { return sorIterations; } - void setSorIterations(int val) { sorIterations = val; } - float getOmega() const { return omega; } - void setOmega(float val) { omega = val; } - float getAlpha() const { return alpha; } - void setAlpha(float val) { alpha = val; } - float getDelta() const { return delta; } - void setDelta(float val) { delta = val; } - float getGamma() const { return gamma; } - void setGamma(float val) { gamma = val; } + int getFixedPointIterations() const CV_OVERRIDE { return fixedPointIterations; } + void setFixedPointIterations(int val) CV_OVERRIDE { fixedPointIterations = val; } + int getSorIterations() const CV_OVERRIDE { return sorIterations; } + void setSorIterations(int val) CV_OVERRIDE { sorIterations = val; } + float getOmega() const CV_OVERRIDE { return omega; } + void setOmega(float val) CV_OVERRIDE { omega = val; } + float getAlpha() const CV_OVERRIDE { return alpha; } + void setAlpha(float val) CV_OVERRIDE { alpha = val; } + float getDelta() const CV_OVERRIDE { return delta; } + void setDelta(float val) CV_OVERRIDE { delta = val; } + float getGamma() const CV_OVERRIDE { return gamma; } + void setGamma(float val) CV_OVERRIDE { gamma = val; } protected: //!< internal buffers /* This struct defines a special data layout for Mat_. Original buffer is split into two: one for "red" @@ -129,7 +129,7 @@ class VariationalRefinementImpl : public VariationalRefinement ParallelOp_ParBody(VariationalRefinementImpl &_var, vector _ops, vector &_op1s, vector &_op2s, vector &_op3s); - void operator()(const Range &range) const; + void operator()(const Range &range) const CV_OVERRIDE; }; void gradHorizAndSplitOp(void *src, void *dst, void *dst_split) { @@ -160,7 +160,7 @@ class VariationalRefinementImpl : public VariationalRefinement ComputeDataTerm_ParBody(VariationalRefinementImpl &_var, int _nstripes, int _h, RedBlackBuffer &_dW_u, RedBlackBuffer &_dW_v, bool _red_pass); - void operator()(const Range &range) const; + void operator()(const Range &range) const CV_OVERRIDE; }; struct ComputeSmoothnessTermHorPass_ParBody : public ParallelLoopBody @@ -174,7 +174,7 @@ class VariationalRefinementImpl : public VariationalRefinement ComputeSmoothnessTermHorPass_ParBody(VariationalRefinementImpl &_var, int _nstripes, int _h, RedBlackBuffer &_W_u, RedBlackBuffer &_W_v, RedBlackBuffer &_tempW_u, RedBlackBuffer &_tempW_v, bool _red_pass); - void operator()(const Range &range) const; + void operator()(const Range &range) const CV_OVERRIDE; }; struct ComputeSmoothnessTermVertPass_ParBody : public ParallelLoopBody @@ -187,7 +187,7 @@ class VariationalRefinementImpl : public VariationalRefinement ComputeSmoothnessTermVertPass_ParBody(VariationalRefinementImpl &_var, int _nstripes, int _h, RedBlackBuffer &W_u, RedBlackBuffer &_W_v, bool _red_pass); - void operator()(const Range &range) const; + void operator()(const Range &range) const CV_OVERRIDE; }; struct RedBlackSOR_ParBody : public ParallelLoopBody @@ -200,7 +200,7 @@ class VariationalRefinementImpl : public VariationalRefinement RedBlackSOR_ParBody(VariationalRefinementImpl &_var, int _nstripes, int _h, RedBlackBuffer &_dW_u, RedBlackBuffer &_dW_v, bool _red_pass); - void operator()(const Range &range) const; + void operator()(const Range &range) const CV_OVERRIDE; }; }; diff --git a/modules/phase_unwrapping/src/histogramphaseunwrapping.cpp b/modules/phase_unwrapping/src/histogramphaseunwrapping.cpp index 6551285aa..591deaf8d 100644 --- a/modules/phase_unwrapping/src/histogramphaseunwrapping.cpp +++ b/modules/phase_unwrapping/src/histogramphaseunwrapping.cpp @@ -51,13 +51,13 @@ public: explicit HistogramPhaseUnwrapping_Impl( const HistogramPhaseUnwrapping::Params ¶meters = HistogramPhaseUnwrapping::Params() ); // Destructor - virtual ~HistogramPhaseUnwrapping_Impl(){}; + virtual ~HistogramPhaseUnwrapping_Impl() CV_OVERRIDE {}; // Unwrap phase map void unwrapPhaseMap( InputArray wrappedPhaseMap, OutputArray unwrappedPhaseMap, - InputArray shadowMask = noArray() ); + InputArray shadowMask = noArray() ) CV_OVERRIDE; // Get reliability map computed from the wrapped phase map - void getInverseReliabilityMap( OutputArray reliabilityMap ); + void getInverseReliabilityMap( OutputArray reliabilityMap ) CV_OVERRIDE; private: // Class describing a pixel @@ -780,4 +780,4 @@ Ptr HistogramPhaseUnwrapping::create( const HistogramP } } -} \ No newline at end of file +} diff --git a/modules/plot/src/plot.cpp b/modules/plot/src/plot.cpp index bef9e0f5f..26033f717 100644 --- a/modules/plot/src/plot.cpp +++ b/modules/plot/src/plot.cpp @@ -53,7 +53,7 @@ namespace cv { using namespace std; - class Plot2dImpl : public Plot2d + class Plot2dImpl CV_FINAL : public Plot2d { public: @@ -108,59 +108,59 @@ namespace cv } //set functions - void setMinX(double _plotMinX) + void setMinX(double _plotMinX) CV_OVERRIDE { plotMinX = _plotMinX; plotMinX_plusZero = _plotMinX; } - void setMaxX(double _plotMaxX) + void setMaxX(double _plotMaxX) CV_OVERRIDE { plotMaxX = _plotMaxX; plotMaxX_plusZero = _plotMaxX; } - void setMinY(double _plotMinY) + void setMinY(double _plotMinY) CV_OVERRIDE { plotMinY = _plotMinY; plotMinY_plusZero = _plotMinY; } - void setMaxY(double _plotMaxY) + void setMaxY(double _plotMaxY) CV_OVERRIDE { plotMaxY = _plotMaxY; plotMaxY_plusZero = _plotMaxY; } - void setPlotLineWidth(int _plotLineWidth) + void setPlotLineWidth(int _plotLineWidth) CV_OVERRIDE { plotLineWidth = _plotLineWidth; } - void setInvertOrientation(bool _invertOrientation) + void setInvertOrientation(bool _invertOrientation) CV_OVERRIDE { invertOrientation = _invertOrientation; } - void setNeedPlotLine(bool _needPlotLine) + void setNeedPlotLine(bool _needPlotLine) CV_OVERRIDE { needPlotLine = _needPlotLine; } - void setPlotLineColor(Scalar _plotLineColor) + void setPlotLineColor(Scalar _plotLineColor) CV_OVERRIDE { plotLineColor=_plotLineColor; } - void setPlotBackgroundColor(Scalar _plotBackgroundColor) + void setPlotBackgroundColor(Scalar _plotBackgroundColor) CV_OVERRIDE { plotBackgroundColor=_plotBackgroundColor; } - void setPlotAxisColor(Scalar _plotAxisColor) + void setPlotAxisColor(Scalar _plotAxisColor) CV_OVERRIDE { plotAxisColor=_plotAxisColor; } - void setPlotGridColor(Scalar _plotGridColor) + void setPlotGridColor(Scalar _plotGridColor) CV_OVERRIDE { plotGridColor=_plotGridColor; } - void setPlotTextColor(Scalar _plotTextColor) + void setPlotTextColor(Scalar _plotTextColor) CV_OVERRIDE { plotTextColor=_plotTextColor; } - void setPlotSize(int _plotSizeWidth, int _plotSizeHeight) + void setPlotSize(int _plotSizeWidth, int _plotSizeHeight) CV_OVERRIDE { if(_plotSizeWidth > 400) plotSizeWidth = _plotSizeWidth; @@ -172,28 +172,28 @@ namespace cv else plotSizeHeight = 300; } - void setShowGrid(bool _needShowGrid) + void setShowGrid(bool _needShowGrid) CV_OVERRIDE { needShowGrid = _needShowGrid; } - void setShowText(bool _needShowText) + void setShowText(bool _needShowText) CV_OVERRIDE { needShowText = _needShowText; } - void setGridLinesNumber(int _gridLinesNumber) + void setGridLinesNumber(int _gridLinesNumber) CV_OVERRIDE { if(_gridLinesNumber <= 0) _gridLinesNumber = 1; gridLinesNumber = _gridLinesNumber; } - void setPointIdxToPrint(int _cursorPos) + void setPointIdxToPrint(int _cursorPos) CV_OVERRIDE { if(_cursorPos >= plotDataX.rows || _cursorPos < 0) _cursorPos = plotDataX.rows - 1; cursorPos = _cursorPos; } //render the plotResult to a Mat - void render(OutputArray _plotResult) + void render(OutputArray _plotResult) CV_OVERRIDE { //create the plot result _plotResult.create(plotSizeHeight, plotSizeWidth, CV_8UC3); diff --git a/modules/reg/include/opencv2/reg/mapaffine.hpp b/modules/reg/include/opencv2/reg/mapaffine.hpp index 868b661f2..52ab8d6b7 100644 --- a/modules/reg/include/opencv2/reg/mapaffine.hpp +++ b/modules/reg/include/opencv2/reg/mapaffine.hpp @@ -69,13 +69,13 @@ public: */ ~MapAffine(); - CV_WRAP void inverseWarp(InputArray img1, OutputArray img2) const; + CV_WRAP void inverseWarp(InputArray img1, OutputArray img2) const CV_OVERRIDE; - CV_WRAP cv::Ptr inverseMap() const; + CV_WRAP cv::Ptr inverseMap() const CV_OVERRIDE; - CV_WRAP void compose(cv::Ptr map); + CV_WRAP void compose(cv::Ptr map) CV_OVERRIDE; - CV_WRAP void scale(double factor); + CV_WRAP void scale(double factor) CV_OVERRIDE; /*! * Return linear part of the affine transformation diff --git a/modules/reg/include/opencv2/reg/mappergradaffine.hpp b/modules/reg/include/opencv2/reg/mappergradaffine.hpp index 8b0d7b41f..49b0bc7bc 100644 --- a/modules/reg/include/opencv2/reg/mappergradaffine.hpp +++ b/modules/reg/include/opencv2/reg/mappergradaffine.hpp @@ -55,9 +55,9 @@ public: CV_WRAP MapperGradAffine(); ~MapperGradAffine(void); - CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const; + CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const CV_OVERRIDE; - CV_WRAP cv::Ptr getMap() const; + CV_WRAP cv::Ptr getMap() const CV_OVERRIDE; }; //! @} diff --git a/modules/reg/include/opencv2/reg/mappergradeuclid.hpp b/modules/reg/include/opencv2/reg/mappergradeuclid.hpp index c41a5f7f0..4f6c5c8f1 100644 --- a/modules/reg/include/opencv2/reg/mappergradeuclid.hpp +++ b/modules/reg/include/opencv2/reg/mappergradeuclid.hpp @@ -55,9 +55,9 @@ public: CV_WRAP MapperGradEuclid(); ~MapperGradEuclid(); - CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const; + CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const CV_OVERRIDE; - CV_WRAP cv::Ptr getMap() const; + CV_WRAP cv::Ptr getMap() const CV_OVERRIDE; }; //! @} diff --git a/modules/reg/include/opencv2/reg/mappergradproj.hpp b/modules/reg/include/opencv2/reg/mappergradproj.hpp index 5d83fc4f0..1e01c71bf 100644 --- a/modules/reg/include/opencv2/reg/mappergradproj.hpp +++ b/modules/reg/include/opencv2/reg/mappergradproj.hpp @@ -55,9 +55,9 @@ public: CV_WRAP MapperGradProj(); ~MapperGradProj(); - CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const; + CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const CV_OVERRIDE; - CV_WRAP cv::Ptr getMap() const; + CV_WRAP cv::Ptr getMap() const CV_OVERRIDE; }; //! @} diff --git a/modules/reg/include/opencv2/reg/mappergradshift.hpp b/modules/reg/include/opencv2/reg/mappergradshift.hpp index 3a3642758..cd812d986 100644 --- a/modules/reg/include/opencv2/reg/mappergradshift.hpp +++ b/modules/reg/include/opencv2/reg/mappergradshift.hpp @@ -55,9 +55,9 @@ public: CV_WRAP MapperGradShift(); virtual ~MapperGradShift(); - CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const; + CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const CV_OVERRIDE; - CV_WRAP cv::Ptr getMap() const; + CV_WRAP cv::Ptr getMap() const CV_OVERRIDE; }; //! @} diff --git a/modules/reg/include/opencv2/reg/mappergradsimilar.hpp b/modules/reg/include/opencv2/reg/mappergradsimilar.hpp index 6382180cc..07d64d967 100644 --- a/modules/reg/include/opencv2/reg/mappergradsimilar.hpp +++ b/modules/reg/include/opencv2/reg/mappergradsimilar.hpp @@ -55,9 +55,9 @@ public: CV_WRAP MapperGradSimilar(); ~MapperGradSimilar(); - CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const; + CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const CV_OVERRIDE; - CV_WRAP cv::Ptr getMap() const; + CV_WRAP cv::Ptr getMap() const CV_OVERRIDE; }; //! @} diff --git a/modules/reg/include/opencv2/reg/mapperpyramid.hpp b/modules/reg/include/opencv2/reg/mapperpyramid.hpp index f9fbd0181..6106f49b9 100644 --- a/modules/reg/include/opencv2/reg/mapperpyramid.hpp +++ b/modules/reg/include/opencv2/reg/mapperpyramid.hpp @@ -61,9 +61,9 @@ public: */ CV_WRAP MapperPyramid(Ptr baseMapper); - CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const; + CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const CV_OVERRIDE; - CV_WRAP cv::Ptr getMap() const; + CV_WRAP cv::Ptr getMap() const CV_OVERRIDE; CV_PROP_RW int numLev_; /*!< Number of levels of the pyramid */ CV_PROP_RW int numIterPerScale_; /*!< Number of iterations at a given scale of the pyramid */ diff --git a/modules/reg/include/opencv2/reg/mapprojec.hpp b/modules/reg/include/opencv2/reg/mapprojec.hpp index 5802a74a4..6d1e565e0 100644 --- a/modules/reg/include/opencv2/reg/mapprojec.hpp +++ b/modules/reg/include/opencv2/reg/mapprojec.hpp @@ -69,13 +69,13 @@ public: */ ~MapProjec(); - CV_WRAP void inverseWarp(InputArray img1, OutputArray img2) const; + CV_WRAP void inverseWarp(InputArray img1, OutputArray img2) const CV_OVERRIDE; - CV_WRAP cv::Ptr inverseMap() const; + CV_WRAP cv::Ptr inverseMap() const CV_OVERRIDE; - CV_WRAP void compose(cv::Ptr map); + CV_WRAP void compose(cv::Ptr map) CV_OVERRIDE; - CV_WRAP void scale(double factor); + CV_WRAP void scale(double factor) CV_OVERRIDE; /*! * Returns projection matrix diff --git a/modules/reg/include/opencv2/reg/mapshift.hpp b/modules/reg/include/opencv2/reg/mapshift.hpp index c7119440a..ada954501 100644 --- a/modules/reg/include/opencv2/reg/mapshift.hpp +++ b/modules/reg/include/opencv2/reg/mapshift.hpp @@ -70,13 +70,13 @@ public: */ ~MapShift(); - CV_WRAP void inverseWarp(InputArray img1, OutputArray img2) const; + CV_WRAP void inverseWarp(InputArray img1, OutputArray img2) const CV_OVERRIDE; - CV_WRAP cv::Ptr inverseMap() const; + CV_WRAP cv::Ptr inverseMap() const CV_OVERRIDE; - CV_WRAP void compose(cv::Ptr map); + CV_WRAP void compose(cv::Ptr map) CV_OVERRIDE; - CV_WRAP void scale(double factor); + CV_WRAP void scale(double factor) CV_OVERRIDE; /*! * Return displacement diff --git a/modules/rgbd/include/opencv2/rgbd.hpp b/modules/rgbd/include/opencv2/rgbd.hpp index 83674c042..5d90e983d 100755 --- a/modules/rgbd/include/opencv2/rgbd.hpp +++ b/modules/rgbd/include/opencv2/rgbd.hpp @@ -514,7 +514,7 @@ namespace rgbd CV_WRAP static Ptr create(const Mat& image=Mat(), const Mat& depth=Mat(), const Mat& mask=Mat(), const Mat& normals=Mat(), int ID=-1); CV_WRAP virtual void - release(); + release() CV_OVERRIDE; CV_WRAP void releasePyramids(); @@ -661,13 +661,13 @@ namespace rgbd const std::vector& minGradientMagnitudes = std::vector(), float maxPointsPart = Odometry::DEFAULT_MAX_POINTS_PART(), int transformType = Odometry::RIGID_BODY_MOTION); - CV_WRAP virtual Size prepareFrameCache(Ptr& frame, int cacheType) const; + CV_WRAP virtual Size prepareFrameCache(Ptr& frame, int cacheType) const CV_OVERRIDE; - CV_WRAP cv::Mat getCameraMatrix() const + CV_WRAP cv::Mat getCameraMatrix() const CV_OVERRIDE { return cameraMatrix; } - CV_WRAP void setCameraMatrix(const cv::Mat &val) + CV_WRAP void setCameraMatrix(const cv::Mat &val) CV_OVERRIDE { cameraMatrix = val; } @@ -719,11 +719,11 @@ namespace rgbd { maxPointsPart = val; } - CV_WRAP int getTransformType() const + CV_WRAP int getTransformType() const CV_OVERRIDE { return transformType; } - CV_WRAP void setTransformType(int val) + CV_WRAP void setTransformType(int val) CV_OVERRIDE { transformType = val; } @@ -746,11 +746,11 @@ namespace rgbd protected: virtual void - checkParams() const; + checkParams() const CV_OVERRIDE; virtual bool computeImpl(const Ptr& srcFrame, const Ptr& dstFrame, OutputArray Rt, - const Mat& initRt) const; + const Mat& initRt) const CV_OVERRIDE; // Some params have commented desired type. It's due to AlgorithmInfo::addParams does not support it now. /*float*/ @@ -792,13 +792,13 @@ namespace rgbd float maxDepthDiff = Odometry::DEFAULT_MAX_DEPTH_DIFF(), float maxPointsPart = Odometry::DEFAULT_MAX_POINTS_PART(), const std::vector& iterCounts = std::vector(), int transformType = Odometry::RIGID_BODY_MOTION); - CV_WRAP virtual Size prepareFrameCache(Ptr& frame, int cacheType) const; + CV_WRAP virtual Size prepareFrameCache(Ptr& frame, int cacheType) const CV_OVERRIDE; - CV_WRAP cv::Mat getCameraMatrix() const + CV_WRAP cv::Mat getCameraMatrix() const CV_OVERRIDE { return cameraMatrix; } - CV_WRAP void setCameraMatrix(const cv::Mat &val) + CV_WRAP void setCameraMatrix(const cv::Mat &val) CV_OVERRIDE { cameraMatrix = val; } @@ -842,11 +842,11 @@ namespace rgbd { maxPointsPart = val; } - CV_WRAP int getTransformType() const + CV_WRAP int getTransformType() const CV_OVERRIDE { return transformType; } - CV_WRAP void setTransformType(int val) + CV_WRAP void setTransformType(int val) CV_OVERRIDE { transformType = val; } @@ -873,11 +873,11 @@ namespace rgbd protected: virtual void - checkParams() const; + checkParams() const CV_OVERRIDE; virtual bool computeImpl(const Ptr& srcFrame, const Ptr& dstFrame, OutputArray Rt, - const Mat& initRt) const; + const Mat& initRt) const CV_OVERRIDE; // Some params have commented desired type. It's due to AlgorithmInfo::addParams does not support it now. /*float*/ @@ -926,13 +926,13 @@ namespace rgbd const std::vector& minGradientMagnitudes = std::vector(), int transformType = Odometry::RIGID_BODY_MOTION); - CV_WRAP virtual Size prepareFrameCache(Ptr& frame, int cacheType) const; + CV_WRAP virtual Size prepareFrameCache(Ptr& frame, int cacheType) const CV_OVERRIDE; - CV_WRAP cv::Mat getCameraMatrix() const + CV_WRAP cv::Mat getCameraMatrix() const CV_OVERRIDE { return cameraMatrix; } - CV_WRAP void setCameraMatrix(const cv::Mat &val) + CV_WRAP void setCameraMatrix(const cv::Mat &val) CV_OVERRIDE { cameraMatrix = val; } @@ -984,11 +984,11 @@ namespace rgbd { minGradientMagnitudes = val; } - CV_WRAP int getTransformType() const + CV_WRAP int getTransformType() const CV_OVERRIDE { return transformType; } - CV_WRAP void setTransformType(int val) + CV_WRAP void setTransformType(int val) CV_OVERRIDE { transformType = val; } @@ -1015,11 +1015,11 @@ namespace rgbd protected: virtual void - checkParams() const; + checkParams() const CV_OVERRIDE; virtual bool computeImpl(const Ptr& srcFrame, const Ptr& dstFrame, OutputArray Rt, - const Mat& initRt) const; + const Mat& initRt) const CV_OVERRIDE; // Some params have commented desired type. It's due to AlgorithmInfo::addParams does not support it now. /*float*/ diff --git a/modules/rgbd/include/opencv2/rgbd/linemod.hpp b/modules/rgbd/include/opencv2/rgbd/linemod.hpp index 8d6f2e30c..8e222660f 100644 --- a/modules/rgbd/include/opencv2/rgbd/linemod.hpp +++ b/modules/rgbd/include/opencv2/rgbd/linemod.hpp @@ -218,10 +218,10 @@ public: */ ColorGradient(float weak_threshold, size_t num_features, float strong_threshold); - virtual String name() const; + virtual String name() const CV_OVERRIDE; - virtual void read(const FileNode& fn); - virtual void write(FileStorage& fs) const; + virtual void read(const FileNode& fn) CV_OVERRIDE; + virtual void write(FileStorage& fs) const CV_OVERRIDE; float weak_threshold; size_t num_features; @@ -229,7 +229,7 @@ public: protected: virtual Ptr processImpl(const Mat& src, - const Mat& mask) const; + const Mat& mask) const CV_OVERRIDE; }; /** @@ -256,10 +256,10 @@ public: DepthNormal(int distance_threshold, int difference_threshold, size_t num_features, int extract_threshold); - virtual String name() const; + virtual String name() const CV_OVERRIDE; - virtual void read(const FileNode& fn); - virtual void write(FileStorage& fs) const; + virtual void read(const FileNode& fn) CV_OVERRIDE; + virtual void write(FileStorage& fs) const CV_OVERRIDE; int distance_threshold; int difference_threshold; @@ -268,7 +268,7 @@ public: protected: virtual Ptr processImpl(const Mat& src, - const Mat& mask) const; + const Mat& mask) const CV_OVERRIDE; }; /** diff --git a/modules/rgbd/src/depth_cleaner.cpp b/modules/rgbd/src/depth_cleaner.cpp index 70616e5c0..ca6ba9d55 100644 --- a/modules/rgbd/src/depth_cleaner.cpp +++ b/modules/rgbd/src/depth_cleaner.cpp @@ -93,7 +93,7 @@ namespace rgbd /** Compute cached data */ virtual void - cache() + cache() CV_OVERRIDE { } diff --git a/modules/rgbd/src/linemod.cpp b/modules/rgbd/src/linemod.cpp index f31cbef6a..9d0846b99 100644 --- a/modules/rgbd/src/linemod.cpp +++ b/modules/rgbd/src/linemod.cpp @@ -428,11 +428,11 @@ public: float weak_threshold, size_t num_features, float strong_threshold); - virtual void quantize(Mat& dst) const; + virtual void quantize(Mat& dst) const CV_OVERRIDE; - virtual bool extractTemplate(Template& templ) const; + virtual bool extractTemplate(Template& templ) const CV_OVERRIDE; - virtual void pyrDown(); + virtual void pyrDown() CV_OVERRIDE; protected: /// Recalculate angle and magnitude images @@ -728,11 +728,11 @@ public: int distance_threshold, int difference_threshold, size_t num_features, int extract_threshold); - virtual void quantize(Mat& dst) const; + virtual void quantize(Mat& dst) const CV_OVERRIDE; - virtual bool extractTemplate(Template& templ) const; + virtual bool extractTemplate(Template& templ) const CV_OVERRIDE; - virtual void pyrDown(); + virtual void pyrDown() CV_OVERRIDE; protected: Mat mask; diff --git a/modules/rgbd/src/normal.cpp b/modules/rgbd/src/normal.cpp index 2824a8e44..906c22d12 100644 --- a/modules/rgbd/src/normal.cpp +++ b/modules/rgbd/src/normal.cpp @@ -230,7 +230,7 @@ namespace rgbd /** Compute cached data */ virtual void - cache() + cache() CV_OVERRIDE { // Compute theta and phi according to equation 3 Mat cos_theta, sin_theta, cos_phi, sin_phi; @@ -360,7 +360,7 @@ multiply_by_K_inv(const Matx & K_inv, U a, U b, U c, Vec &res) /** Compute cached data */ virtual void - cache() + cache() CV_OVERRIDE { } @@ -516,7 +516,7 @@ multiply_by_K_inv(const Matx & K_inv, U a, U b, U c, Vec &res) /** Compute cached data */ virtual void - cache() + cache() CV_OVERRIDE { Mat_ cos_theta, sin_theta, cos_phi, sin_phi; computeThetaPhi(rows_, cols_, K_, cos_theta, sin_theta, cos_phi, sin_phi); diff --git a/modules/rgbd/src/plane.cpp b/modules/rgbd/src/plane.cpp index c765c029c..859d044f3 100644 --- a/modules/rgbd/src/plane.cpp +++ b/modules/rgbd/src/plane.cpp @@ -182,7 +182,7 @@ public: * @return */ float - distance(const Vec3f& p_j) const + distance(const Vec3f& p_j) const CV_OVERRIDE { return std::abs(float(p_j.dot(n_) + d_)); } @@ -206,7 +206,7 @@ public: /** The distance is now computed by taking the sensor error into account */ inline float - distance(const Vec3f& p_j) const + distance(const Vec3f& p_j) const CV_OVERRIDE { float cst = p_j.dot(n_) + d_; float err = sensor_error_a_ * p_j[2] * p_j[2] + sensor_error_b_ * p_j[2] + sensor_error_c_; @@ -524,7 +524,7 @@ private: unsigned char plane_index_; /** THe block size as defined in the main algorithm */ int block_size_; - + const InlierFinder & operator = (const InlierFinder &); }; diff --git a/modules/saliency/include/opencv2/saliency/saliencyBaseClasses.hpp b/modules/saliency/include/opencv2/saliency/saliencyBaseClasses.hpp index bbabfeae5..06fb4e23d 100644 --- a/modules/saliency/include/opencv2/saliency/saliencyBaseClasses.hpp +++ b/modules/saliency/include/opencv2/saliency/saliencyBaseClasses.hpp @@ -103,7 +103,7 @@ class CV_EXPORTS_W StaticSaliency : public virtual Saliency */ CV_WRAP bool computeBinaryMap( InputArray _saliencyMap, OutputArray _binaryMap ); protected: - virtual bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap )=0; + virtual bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap ) CV_OVERRIDE = 0; }; @@ -112,7 +112,7 @@ class CV_EXPORTS_W MotionSaliency : public virtual Saliency { protected: - virtual bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap )=0; + virtual bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap ) CV_OVERRIDE = 0; }; @@ -121,7 +121,7 @@ class CV_EXPORTS_W Objectness : public virtual Saliency { protected: - virtual bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap )=0; + virtual bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap ) CV_OVERRIDE = 0; }; diff --git a/modules/saliency/include/opencv2/saliency/saliencySpecializedClasses.hpp b/modules/saliency/include/opencv2/saliency/saliencySpecializedClasses.hpp index 9f8f4a922..c3149bfac 100644 --- a/modules/saliency/include/opencv2/saliency/saliencySpecializedClasses.hpp +++ b/modules/saliency/include/opencv2/saliency/saliencySpecializedClasses.hpp @@ -86,8 +86,8 @@ public: return computeSaliencyImpl( image, saliencyMap ); } - CV_WRAP void read( const FileNode& fn ); - void write( FileStorage& fs ) const; + CV_WRAP void read( const FileNode& fn ) CV_OVERRIDE; + void write( FileStorage& fs ) const CV_OVERRIDE; CV_WRAP int getImageWidth() const { @@ -107,7 +107,7 @@ public: } protected: - bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap ); + bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap ) CV_OVERRIDE; CV_PROP_RW int resImWidth; CV_PROP_RW int resImHeight; @@ -140,7 +140,7 @@ public: virtual ~StaticSaliencyFineGrained(); protected: - bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap ); + bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap ) CV_OVERRIDE; private: void calcIntensityChannel(Mat src, Mat dst); @@ -222,7 +222,7 @@ protected: The saliency map is given by a single *Mat* (one for each frame of an hypothetical video stream). */ - bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap ); + bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap ) CV_OVERRIDE; private: @@ -369,7 +369,7 @@ protected: specialized algorithm, the objectnessBoundingBox is a *vector\*. Each bounding box is represented by a *Vec4i* for (minX, minY, maxX, maxY). */ - bool computeSaliencyImpl( InputArray image, OutputArray objectnessBoundingBox ); + bool computeSaliencyImpl( InputArray image, OutputArray objectnessBoundingBox ) CV_OVERRIDE; private: diff --git a/modules/sfm/include/opencv2/sfm/simple_pipeline.hpp b/modules/sfm/include/opencv2/sfm/simple_pipeline.hpp index d882fa88f..1bd4e17ff 100644 --- a/modules/sfm/include/opencv2/sfm/simple_pipeline.hpp +++ b/modules/sfm/include/opencv2/sfm/simple_pipeline.hpp @@ -196,7 +196,7 @@ public: - Tracks must be as precise as possible. It does not handle outliers and is very sensible to them. */ CV_WRAP - virtual void run(InputArrayOfArrays points2d) = 0; + virtual void run(InputArrayOfArrays points2d) CV_OVERRIDE = 0; /** @brief Calls the pipeline in order to perform Eclidean reconstruction. @param points2d Input vector of vectors of 2d points (the inner vector is per image). @@ -210,7 +210,7 @@ public: */ CV_WRAP virtual void run(InputArrayOfArrays points2d, InputOutputArray K, OutputArray Rs, - OutputArray Ts, OutputArray points3d) = 0; + OutputArray Ts, OutputArray points3d) CV_OVERRIDE = 0; /** @brief Calls the pipeline in order to perform Eclidean reconstruction. @param images a vector of string with the images paths. @@ -219,7 +219,7 @@ public: - The images must be ordered as they were an image sequence. Additionally, each frame should be as close as posible to the previous and posterior. - For now DAISY features are used in order to compute the 2d points tracks and it only works for 3-4 images. */ - virtual void run(const std::vector &images) = 0; + virtual void run(const std::vector &images) CV_OVERRIDE = 0; /** @brief Calls the pipeline in order to perform Eclidean reconstruction. @param images a vector of string with the images paths. @@ -233,30 +233,30 @@ public: - For now DAISY features are used in order to compute the 2d points tracks and it only works for 3-4 images. */ virtual void run(const std::vector &images, InputOutputArray K, OutputArray Rs, - OutputArray Ts, OutputArray points3d) = 0; + OutputArray Ts, OutputArray points3d) CV_OVERRIDE = 0; /** @brief Returns the computed reprojection error. */ CV_WRAP - virtual double getError() const = 0; + virtual double getError() const CV_OVERRIDE = 0; /** @brief Returns the estimated 3d points. @param points3d Output array with estimated 3d points. */ CV_WRAP - virtual void getPoints(OutputArray points3d) = 0; + virtual void getPoints(OutputArray points3d) CV_OVERRIDE = 0; /** @brief Returns the refined camera calibration matrix. */ CV_WRAP - virtual cv::Mat getIntrinsics() const = 0; + virtual cv::Mat getIntrinsics() const CV_OVERRIDE = 0; /** @brief Returns the estimated camera extrinsic parameters. @param Rs Output vector of 3x3 rotations of the camera. @param Ts Output vector of 3x1 translations of the camera. */ CV_WRAP - virtual void getCameras(OutputArray Rs, OutputArray Ts) = 0; + virtual void getCameras(OutputArray Rs, OutputArray Ts) CV_OVERRIDE = 0; /** @brief Setter method for reconstruction options. @param libmv_reconstruction_options struct with reconstruction options such as initial keyframes, @@ -264,7 +264,7 @@ public: */ CV_WRAP virtual void - setReconstructionOptions(const libmv_ReconstructionOptions &libmv_reconstruction_options) = 0; + setReconstructionOptions(const libmv_ReconstructionOptions &libmv_reconstruction_options) CV_OVERRIDE = 0; /** @brief Setter method for camera intrinsic options. @param libmv_camera_intrinsics_options struct with camera intrinsic options such as camera model and @@ -272,7 +272,7 @@ public: */ CV_WRAP virtual void - setCameraIntrinsicOptions(const libmv_CameraIntrinsicsOptions &libmv_camera_intrinsics_options) = 0; + setCameraIntrinsicOptions(const libmv_CameraIntrinsicsOptions &libmv_camera_intrinsics_options) CV_OVERRIDE = 0; /** @brief Creates an instance of the SFMLibmvEuclideanReconstruction class. Initializes Libmv. */ static Ptr diff --git a/modules/sfm/src/libmv_light/CMakeLists.txt b/modules/sfm/src/libmv_light/CMakeLists.txt index 4feead2b5..8da6d728c 100644 --- a/modules/sfm/src/libmv_light/CMakeLists.txt +++ b/modules/sfm/src/libmv_light/CMakeLists.txt @@ -2,4 +2,7 @@ include(CMake/Installation.cmake) set(BUILD_SHARED_LIBS OFF) # Force static libs for 3rdparty dependencies + +ocv_warnings_disable(CMAKE_CXX_FLAGS -Winconsistent-missing-override -Wsuggest-override) + add_subdirectory(libmv) \ No newline at end of file diff --git a/modules/stereo/include/opencv2/stereo/descriptor.hpp b/modules/stereo/include/opencv2/stereo/descriptor.hpp index bdbd7ce75..19928fe49 100644 --- a/modules/stereo/include/opencv2/stereo/descriptor.hpp +++ b/modules/stereo/include/opencv2/stereo/descriptor.hpp @@ -215,7 +215,7 @@ namespace cv kernel_ = kernel; n2_stop = k2Stop; } - void operator()(const cv::Range &r) const { + void operator()(const cv::Range &r) const CV_OVERRIDE { for (int i = r.start; i <= r.end ; i++) { int rWidth = i * stride_; @@ -256,7 +256,7 @@ namespace cv public: MeanKernelIntegralImage(const cv::Mat &image, int window,float scale, int *cost): img((int *)image.data),windowSize(window) ,width(image.cols) ,scalling(scale) , c(cost){}; - void operator()(const cv::Range &r) const{ + void operator()(const cv::Range &r) const CV_OVERRIDE { for (int i = r.start; i <= r.end; i++) { int iw = i * width; @@ -290,7 +290,7 @@ namespace cv im_num = num_images; stride_ = (int)img[0].step; } - void operator()(const cv::Range &r) const { + void operator()(const cv::Range &r) const CV_OVERRIDE { for (int i = r.start; i <= r.end ; i++) { int rWidth = i * stride_; @@ -382,7 +382,7 @@ namespace cv im_num = num_images; stride_ = (int)img[0].step; } - void operator()(const cv::Range &r) const { + void operator()(const cv::Range &r) const CV_OVERRIDE { for (int i = r.start; i <= r.end ; i++) { int distV = i*stride_; diff --git a/modules/stereo/include/opencv2/stereo/matching.hpp b/modules/stereo/include/opencv2/stereo/matching.hpp index 25e8a3c36..361eb1888 100644 --- a/modules/stereo/include/opencv2/stereo/matching.hpp +++ b/modules/stereo/include/opencv2/stereo/matching.hpp @@ -156,7 +156,7 @@ namespace cv public : hammingDistance(const Mat &leftImage, const Mat &rightImage, short *cost, int maxDisp, int kerSize, int *hammingLUT): left((int *)leftImage.data), right((int *)rightImage.data), c(cost), v(maxDisp),kernelSize(kerSize),width(leftImage.cols), MASK(65535), hammLut(hammingLUT){} - void operator()(const cv::Range &r) const { + void operator()(const cv::Range &r) const CV_OVERRIDE { for (int i = r.start; i <= r.end ; i++) { int iw = i * width; @@ -202,7 +202,7 @@ namespace cv height = cost.rows - 1; parSum = (short *)partialSums.data; } - void operator()(const cv::Range &r) const { + void operator()(const cv::Range &r) const CV_OVERRIDE { for (int i = r.start; i <= r.end; i++) { int iwi = (i - 1) * width; @@ -243,7 +243,7 @@ namespace cv scallingFact = scale; confCheck = confidence; } - void operator()(const cv::Range &r) const { + void operator()(const cv::Range &r) const CV_OVERRIDE { for (int i = r.start; i <= r.end ; i++) { int lr; @@ -300,7 +300,7 @@ namespace cv height = originalImage.rows; width = originalImage.cols; } - void operator()(const cv::Range &r) const{ + void operator()(const cv::Range &r) const CV_OVERRIDE { for (int m = r.start; m <= r.end; m++) { for (int n = 4; n < width - 4; ++n) @@ -340,7 +340,7 @@ namespace cv height = originalImage.rows; width = originalImage.cols; } - void operator()(const Range &r) const{ + void operator()(const Range &r) const CV_OVERRIDE { for (int n = r.start; n <= r.end; ++n) { for (int m = 4; m < height - 4; ++m) diff --git a/modules/stereo/src/stereo_binary_bm.cpp b/modules/stereo/src/stereo_binary_bm.cpp index d83c2c43a..79814ca7e 100644 --- a/modules/stereo/src/stereo_binary_bm.cpp +++ b/modules/stereo/src/stereo_binary_bm.cpp @@ -247,7 +247,7 @@ namespace cv state = _state; } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { for (int i = range.start; i < range.end; i++) { @@ -264,7 +264,7 @@ namespace cv StereoBinaryBMParams* state; }; - class StereoBinaryBMImpl : public StereoBinaryBM, public Matching + class StereoBinaryBMImpl CV_FINAL : public StereoBinaryBM, public Matching { public: StereoBinaryBMImpl(): Matching(64) @@ -277,7 +277,7 @@ namespace cv params = StereoBinaryBMParams(_numDisparities, _kernelSize); } - void compute(InputArray leftarr, InputArray rightarr, OutputArray disparr) + void compute(InputArray leftarr, InputArray rightarr, OutputArray disparr) CV_OVERRIDE { int dtype = disparr.fixedType() ? disparr.type() : params.dispType; Size leftsize = leftarr.size(); @@ -415,58 +415,58 @@ namespace cv filterSpeckles(disp0, FILTERED, params.speckleWindowSize, params.speckleRange, slidingSumBuf); } } - int getAgregationWindowSize() const { return params.agregationWindowSize;} - void setAgregationWindowSize(int value = 9) { CV_Assert(value % 2 != 0); params.agregationWindowSize = value;} + int getAgregationWindowSize() const CV_OVERRIDE { return params.agregationWindowSize;} + void setAgregationWindowSize(int value = 9) CV_OVERRIDE { CV_Assert(value % 2 != 0); params.agregationWindowSize = value;} - int getBinaryKernelType() const { return params.kernelType;} - void setBinaryKernelType(int value = CV_MODIFIED_CENSUS_TRANSFORM) { CV_Assert(value < 7); params.kernelType = value; } + int getBinaryKernelType() const CV_OVERRIDE { return params.kernelType;} + void setBinaryKernelType(int value = CV_MODIFIED_CENSUS_TRANSFORM) CV_OVERRIDE { CV_Assert(value < 7); params.kernelType = value; } - int getSpekleRemovalTechnique() const { return params.regionRemoval;} - void setSpekleRemovalTechnique(int factor = CV_SPECKLE_REMOVAL_AVG_ALGORITHM) {CV_Assert(factor < 2); params.regionRemoval = factor; } + int getSpekleRemovalTechnique() const CV_OVERRIDE { return params.regionRemoval;} + void setSpekleRemovalTechnique(int factor = CV_SPECKLE_REMOVAL_AVG_ALGORITHM) CV_OVERRIDE { CV_Assert(factor < 2); params.regionRemoval = factor; } - bool getUsePrefilter() const { return params.usePrefilter;} - void setUsePrefilter(bool value = false) { params.usePrefilter = value;} + bool getUsePrefilter() const CV_OVERRIDE { return params.usePrefilter;} + void setUsePrefilter(bool value = false) CV_OVERRIDE { params.usePrefilter = value;} - int getScalleFactor() const { return params.scalling;} - void setScalleFactor(int factor = 4) {CV_Assert(factor > 0); params.scalling = factor; setScallingFactor(factor);} + int getScalleFactor() const CV_OVERRIDE { return params.scalling;} + void setScalleFactor(int factor = 4) CV_OVERRIDE { CV_Assert(factor > 0); params.scalling = factor; setScallingFactor(factor); } - int getMinDisparity() const { return params.minDisparity; } - void setMinDisparity(int minDisparity) {CV_Assert(minDisparity >= 0); params.minDisparity = minDisparity; } + int getMinDisparity() const CV_OVERRIDE { return params.minDisparity; } + void setMinDisparity(int minDisparity) CV_OVERRIDE { CV_Assert(minDisparity >= 0); params.minDisparity = minDisparity; } - int getNumDisparities() const { return params.numDisparities; } - void setNumDisparities(int numDisparities) {CV_Assert(numDisparities > 0); params.numDisparities = numDisparities; } + int getNumDisparities() const CV_OVERRIDE { return params.numDisparities; } + void setNumDisparities(int numDisparities) CV_OVERRIDE { CV_Assert(numDisparities > 0); params.numDisparities = numDisparities; } - int getBlockSize() const { return params.kernelSize; } - void setBlockSize(int blockSize) {CV_Assert(blockSize % 2 != 0); params.kernelSize = blockSize; } + int getBlockSize() const CV_OVERRIDE { return params.kernelSize; } + void setBlockSize(int blockSize) CV_OVERRIDE { CV_Assert(blockSize % 2 != 0); params.kernelSize = blockSize; } - int getSpeckleWindowSize() const { return params.speckleWindowSize; } - void setSpeckleWindowSize(int speckleWindowSize) {CV_Assert(speckleWindowSize >= 0); params.speckleWindowSize = speckleWindowSize; } + int getSpeckleWindowSize() const CV_OVERRIDE { return params.speckleWindowSize; } + void setSpeckleWindowSize(int speckleWindowSize) CV_OVERRIDE { CV_Assert(speckleWindowSize >= 0); params.speckleWindowSize = speckleWindowSize; } - int getSpeckleRange() const { return params.speckleRange; } - void setSpeckleRange(int speckleRange) {CV_Assert(speckleRange >= 0); params.speckleRange = speckleRange; } + int getSpeckleRange() const CV_OVERRIDE { return params.speckleRange; } + void setSpeckleRange(int speckleRange) CV_OVERRIDE { CV_Assert(speckleRange >= 0); params.speckleRange = speckleRange; } - int getDisp12MaxDiff() const { return params.disp12MaxDiff; } - void setDisp12MaxDiff(int disp12MaxDiff) {CV_Assert(disp12MaxDiff >= 0); params.disp12MaxDiff = disp12MaxDiff; } + int getDisp12MaxDiff() const CV_OVERRIDE { return params.disp12MaxDiff; } + void setDisp12MaxDiff(int disp12MaxDiff) CV_OVERRIDE { CV_Assert(disp12MaxDiff >= 0); params.disp12MaxDiff = disp12MaxDiff; } - int getPreFilterType() const { return params.preFilterType; } - void setPreFilterType(int preFilterType) { CV_Assert(preFilterType >= 0); params.preFilterType = preFilterType; } + int getPreFilterType() const CV_OVERRIDE { return params.preFilterType; } + void setPreFilterType(int preFilterType) CV_OVERRIDE { CV_Assert(preFilterType >= 0); params.preFilterType = preFilterType; } - int getPreFilterSize() const { return params.preFilterSize; } - void setPreFilterSize(int preFilterSize) { CV_Assert(preFilterSize >= 0); params.preFilterSize = preFilterSize; } + int getPreFilterSize() const CV_OVERRIDE { return params.preFilterSize; } + void setPreFilterSize(int preFilterSize) CV_OVERRIDE { CV_Assert(preFilterSize >= 0); params.preFilterSize = preFilterSize; } - int getPreFilterCap() const { return params.preFilterCap; } - void setPreFilterCap(int preFilterCap) {CV_Assert(preFilterCap >= 0); params.preFilterCap = preFilterCap; } + int getPreFilterCap() const CV_OVERRIDE { return params.preFilterCap; } + void setPreFilterCap(int preFilterCap) CV_OVERRIDE { CV_Assert(preFilterCap >= 0); params.preFilterCap = preFilterCap; } - int getTextureThreshold() const { return params.textureThreshold; } - void setTextureThreshold(int textureThreshold) {CV_Assert(textureThreshold >= 0); params.textureThreshold = textureThreshold; } + int getTextureThreshold() const CV_OVERRIDE { return params.textureThreshold; } + void setTextureThreshold(int textureThreshold) CV_OVERRIDE { CV_Assert(textureThreshold >= 0); params.textureThreshold = textureThreshold; } - int getUniquenessRatio() const { return params.uniquenessRatio; } - void setUniquenessRatio(int uniquenessRatio) {CV_Assert(uniquenessRatio >= 0); params.uniquenessRatio = uniquenessRatio; } + int getUniquenessRatio() const CV_OVERRIDE { return params.uniquenessRatio; } + void setUniquenessRatio(int uniquenessRatio) CV_OVERRIDE { CV_Assert(uniquenessRatio >= 0); params.uniquenessRatio = uniquenessRatio; } - int getSmallerBlockSize() const { return 0; } - void setSmallerBlockSize(int) {} + int getSmallerBlockSize() const CV_OVERRIDE { return 0; } + void setSmallerBlockSize(int) CV_OVERRIDE {} - void write(FileStorage& fs) const + void write(FileStorage& fs) const CV_OVERRIDE { fs << "name" << name_ << "minDisparity" << params.minDisparity @@ -482,7 +482,7 @@ namespace cv << "uniquenessRatio" << params.uniquenessRatio; } - void read(const FileNode& fn) + void read(const FileNode& fn) CV_OVERRIDE { FileNode n = fn["name"]; CV_Assert(n.isString() && String(n) == name_); diff --git a/modules/stereo/src/stereo_binary_sgbm.cpp b/modules/stereo/src/stereo_binary_sgbm.cpp index 64590500e..9f4014766 100644 --- a/modules/stereo/src/stereo_binary_sgbm.cpp +++ b/modules/stereo/src/stereo_binary_sgbm.cpp @@ -618,7 +618,7 @@ namespace cv } } } - class StereoBinarySGBMImpl : public StereoBinarySGBM, public Matching + class StereoBinarySGBMImpl CV_FINAL : public StereoBinarySGBM, public Matching { public: StereoBinarySGBMImpl():Matching() @@ -635,7 +635,7 @@ namespace cv _uniquenessRatio, _speckleWindowSize, _speckleRange, _mode ); } - void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr ) + void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr ) CV_OVERRIDE { Mat left = leftarr.getMat(), right = rightarr.getMat(); CV_Assert( left.size() == right.size() && left.type() == right.type() && @@ -717,49 +717,49 @@ namespace cv StereoMatcher::DISP_SCALE * params.speckleRange, buffer); } } - int getSubPixelInterpolationMethod() const { return params.subpixelInterpolationMethod;} - void setSubPixelInterpolationMethod(int value = CV_QUADRATIC_INTERPOLATION) { CV_Assert(value < 2); params.subpixelInterpolationMethod = value;} + int getSubPixelInterpolationMethod() const CV_OVERRIDE { return params.subpixelInterpolationMethod;} + void setSubPixelInterpolationMethod(int value = CV_QUADRATIC_INTERPOLATION) CV_OVERRIDE { CV_Assert(value < 2); params.subpixelInterpolationMethod = value;} - int getBinaryKernelType() const { return params.kernelType;} - void setBinaryKernelType(int value = CV_MODIFIED_CENSUS_TRANSFORM) { CV_Assert(value < 7); params.kernelType = value; } + int getBinaryKernelType() const CV_OVERRIDE { return params.kernelType;} + void setBinaryKernelType(int value = CV_MODIFIED_CENSUS_TRANSFORM) CV_OVERRIDE { CV_Assert(value < 7); params.kernelType = value; } - int getSpekleRemovalTechnique() const { return params.regionRemoval;} - void setSpekleRemovalTechnique(int factor = CV_SPECKLE_REMOVAL_AVG_ALGORITHM) { CV_Assert(factor < 2); params.regionRemoval = factor; } + int getSpekleRemovalTechnique() const CV_OVERRIDE { return params.regionRemoval;} + void setSpekleRemovalTechnique(int factor = CV_SPECKLE_REMOVAL_AVG_ALGORITHM) CV_OVERRIDE { CV_Assert(factor < 2); params.regionRemoval = factor; } - int getMinDisparity() const { return params.minDisparity; } - void setMinDisparity(int minDisparity) {CV_Assert(minDisparity >= 0); params.minDisparity = minDisparity; } + int getMinDisparity() const CV_OVERRIDE { return params.minDisparity; } + void setMinDisparity(int minDisparity) CV_OVERRIDE {CV_Assert(minDisparity >= 0); params.minDisparity = minDisparity; } - int getNumDisparities() const { return params.numDisparities; } - void setNumDisparities(int numDisparities) { CV_Assert(numDisparities > 0); params.numDisparities = numDisparities; } + int getNumDisparities() const CV_OVERRIDE { return params.numDisparities; } + void setNumDisparities(int numDisparities) CV_OVERRIDE { CV_Assert(numDisparities > 0); params.numDisparities = numDisparities; } - int getBlockSize() const { return params.kernelSize; } - void setBlockSize(int blockSize) {CV_Assert(blockSize % 2 != 0); params.kernelSize = blockSize; } + int getBlockSize() const CV_OVERRIDE { return params.kernelSize; } + void setBlockSize(int blockSize) CV_OVERRIDE {CV_Assert(blockSize % 2 != 0); params.kernelSize = blockSize; } - int getSpeckleWindowSize() const { return params.speckleWindowSize; } - void setSpeckleWindowSize(int speckleWindowSize) {CV_Assert(speckleWindowSize >= 0); params.speckleWindowSize = speckleWindowSize; } + int getSpeckleWindowSize() const CV_OVERRIDE { return params.speckleWindowSize; } + void setSpeckleWindowSize(int speckleWindowSize) CV_OVERRIDE {CV_Assert(speckleWindowSize >= 0); params.speckleWindowSize = speckleWindowSize; } - int getSpeckleRange() const { return params.speckleRange; } - void setSpeckleRange(int speckleRange) { CV_Assert(speckleRange >= 0); params.speckleRange = speckleRange; } + int getSpeckleRange() const CV_OVERRIDE { return params.speckleRange; } + void setSpeckleRange(int speckleRange) CV_OVERRIDE { CV_Assert(speckleRange >= 0); params.speckleRange = speckleRange; } - int getDisp12MaxDiff() const { return params.disp12MaxDiff; } - void setDisp12MaxDiff(int disp12MaxDiff) {CV_Assert(disp12MaxDiff > 0); params.disp12MaxDiff = disp12MaxDiff; } + int getDisp12MaxDiff() const CV_OVERRIDE { return params.disp12MaxDiff; } + void setDisp12MaxDiff(int disp12MaxDiff) CV_OVERRIDE {CV_Assert(disp12MaxDiff > 0); params.disp12MaxDiff = disp12MaxDiff; } - int getPreFilterCap() const { return params.preFilterCap; } - void setPreFilterCap(int preFilterCap) { CV_Assert(preFilterCap > 0); params.preFilterCap = preFilterCap; } + int getPreFilterCap() const CV_OVERRIDE { return params.preFilterCap; } + void setPreFilterCap(int preFilterCap) CV_OVERRIDE { CV_Assert(preFilterCap > 0); params.preFilterCap = preFilterCap; } - int getUniquenessRatio() const { return params.uniquenessRatio; } - void setUniquenessRatio(int uniquenessRatio) { CV_Assert(uniquenessRatio >= 0); params.uniquenessRatio = uniquenessRatio; } + int getUniquenessRatio() const CV_OVERRIDE { return params.uniquenessRatio; } + void setUniquenessRatio(int uniquenessRatio) CV_OVERRIDE { CV_Assert(uniquenessRatio >= 0); params.uniquenessRatio = uniquenessRatio; } - int getP1() const { return params.P1; } - void setP1(int P1) { CV_Assert(P1 > 0); params.P1 = P1; } + int getP1() const CV_OVERRIDE { return params.P1; } + void setP1(int P1) CV_OVERRIDE { CV_Assert(P1 > 0); params.P1 = P1; } - int getP2() const { return params.P2; } - void setP2(int P2) {CV_Assert(P2 > 0); CV_Assert(P2 >= 2 * params.P1); params.P2 = P2; } + int getP2() const CV_OVERRIDE { return params.P2; } + void setP2(int P2) CV_OVERRIDE {CV_Assert(P2 > 0); CV_Assert(P2 >= 2 * params.P1); params.P2 = P2; } - int getMode() const { return params.mode; } - void setMode(int mode) { params.mode = mode; } + int getMode() const CV_OVERRIDE { return params.mode; } + void setMode(int mode) CV_OVERRIDE { params.mode = mode; } - void write(FileStorage& fs) const + void write(FileStorage& fs) const CV_OVERRIDE { fs << "name" << name_ << "minDisparity" << params.minDisparity @@ -775,7 +775,7 @@ namespace cv << "mode" << params.mode; } - void read(const FileNode& fn) + void read(const FileNode& fn) CV_OVERRIDE { FileNode n = fn["name"]; CV_Assert( n.isString() && String(n) == name_ ); diff --git a/modules/structured_light/src/graycodepattern.cpp b/modules/structured_light/src/graycodepattern.cpp index 5bd6862cb..a6a8288c3 100644 --- a/modules/structured_light/src/graycodepattern.cpp +++ b/modules/structured_light/src/graycodepattern.cpp @@ -43,36 +43,36 @@ namespace cv { namespace structured_light { -class CV_EXPORTS_W GrayCodePattern_Impl : public GrayCodePattern +class CV_EXPORTS_W GrayCodePattern_Impl CV_FINAL : public GrayCodePattern { public: // Constructor explicit GrayCodePattern_Impl( const GrayCodePattern::Params ¶meters = GrayCodePattern::Params() ); // Destructor - virtual ~GrayCodePattern_Impl(){}; + virtual ~GrayCodePattern_Impl() CV_OVERRIDE {}; // Generates the gray code pattern as a std::vector - bool generate( OutputArrayOfArrays patternImages ); + bool generate( OutputArrayOfArrays patternImages ) CV_OVERRIDE; // Decodes the gray code pattern, computing the disparity map bool decode( const std::vector< std::vector >& patternImages, OutputArray disparityMap, InputArrayOfArrays blackImages = noArray(), - InputArrayOfArrays whiteImages = noArray(), int flags = DECODE_3D_UNDERWORLD ) const; + InputArrayOfArrays whiteImages = noArray(), int flags = DECODE_3D_UNDERWORLD ) const CV_OVERRIDE; // Returns the number of pattern images for the graycode pattern - size_t getNumberOfPatternImages() const; + size_t getNumberOfPatternImages() const CV_OVERRIDE; // Sets the value for black threshold - void setBlackThreshold( size_t val ); + void setBlackThreshold( size_t val ) CV_OVERRIDE; // Sets the value for set the value for white threshold - void setWhiteThreshold( size_t val ); + void setWhiteThreshold( size_t val ) CV_OVERRIDE; // Generates the images needed for shadowMasks computation - void getImagesForShadowMasks( InputOutputArray blackImage, InputOutputArray whiteImage ) const; + void getImagesForShadowMasks( InputOutputArray blackImage, InputOutputArray whiteImage ) const CV_OVERRIDE; // For a (x,y) pixel of the camera returns the corresponding projector pixel - bool getProjPixel(InputArrayOfArrays patternImages, int x, int y, Point &projPix) const; + bool getProjPixel(InputArrayOfArrays patternImages, int x, int y, Point &projPix) const CV_OVERRIDE; private: // Parameters diff --git a/modules/structured_light/src/sinusoidalpattern.cpp b/modules/structured_light/src/sinusoidalpattern.cpp index 22e3f1f16..38820b9bd 100644 --- a/modules/structured_light/src/sinusoidalpattern.cpp +++ b/modules/structured_light/src/sinusoidalpattern.cpp @@ -44,37 +44,37 @@ namespace cv { namespace structured_light { -class CV_EXPORTS_W SinusoidalPatternProfilometry_Impl : public SinusoidalPattern +class CV_EXPORTS_W SinusoidalPatternProfilometry_Impl CV_FINAL : public SinusoidalPattern { public: // Constructor explicit SinusoidalPatternProfilometry_Impl( const SinusoidalPattern::Params ¶meters = SinusoidalPattern::Params() ); // Destructor - virtual ~SinusoidalPatternProfilometry_Impl(){}; + virtual ~SinusoidalPatternProfilometry_Impl() CV_OVERRIDE {}; // Generate sinusoidal patterns - bool generate( OutputArrayOfArrays patternImages ); + bool generate( OutputArrayOfArrays patternImages ) CV_OVERRIDE; bool decode( const std::vector< std::vector >& patternImages, OutputArray disparityMap, InputArrayOfArrays blackImages = noArray(), InputArrayOfArrays whiteImages = - noArray(), int flags = 0 ) const; + noArray(), int flags = 0 ) const CV_OVERRIDE; // Compute a wrapped phase map from the sinusoidal patterns void computePhaseMap( InputArrayOfArrays patternImages, OutputArray wrappedPhaseMap, - OutputArray shadowMask = noArray(), InputArray fundamental = noArray()); + OutputArray shadowMask = noArray(), InputArray fundamental = noArray()) CV_OVERRIDE; // Unwrap the wrapped phase map to retrieve correspondences void unwrapPhaseMap( InputArray wrappedPhaseMap, OutputArray unwrappedPhaseMap, cv::Size camSize, - InputArray shadowMask = noArray() ); + InputArray shadowMask = noArray() ) CV_OVERRIDE; // Find correspondences between the devices void findProCamMatches( InputArray projUnwrappedPhaseMap, InputArray camUnwrappedPhaseMap, - OutputArrayOfArrays matches ); + OutputArrayOfArrays matches ) CV_OVERRIDE; void computeDataModulationTerm( InputArrayOfArrays patternImages, OutputArray dataModulationTerm, - InputArray shadowMask ); + InputArray shadowMask ) CV_OVERRIDE; private: // Compute The Fourier transform of a pattern. Output is complex. Taken from the DFT example in OpenCV diff --git a/modules/text/include/opencv2/text/ocr.hpp b/modules/text/include/opencv2/text/ocr.hpp index c8e0129be..b70b30af7 100644 --- a/modules/text/include/opencv2/text/ocr.hpp +++ b/modules/text/include/opencv2/text/ocr.hpp @@ -134,11 +134,11 @@ public: */ virtual void run(Mat& image, std::string& output_text, std::vector* component_rects=NULL, std::vector* component_texts=NULL, std::vector* component_confidences=NULL, - int component_level=0); + int component_level=0) CV_OVERRIDE; virtual void run(Mat& image, Mat& mask, std::string& output_text, std::vector* component_rects=NULL, std::vector* component_texts=NULL, std::vector* component_confidences=NULL, - int component_level=0); + int component_level=0) CV_OVERRIDE; // aliases for scripting CV_WRAP String run(InputArray image, int min_confidence, int component_level=0); @@ -240,7 +240,7 @@ public: */ virtual void run(Mat& image, std::string& output_text, std::vector* component_rects=NULL, std::vector* component_texts=NULL, std::vector* component_confidences=NULL, - int component_level=0); + int component_level=0) CV_OVERRIDE; /** @brief Recognize text using HMM. @@ -267,7 +267,7 @@ public: */ virtual void run(Mat& image, Mat& mask, std::string& output_text, std::vector* component_rects=NULL, std::vector* component_texts=NULL, std::vector* component_confidences=NULL, - int component_level=0); + int component_level=0) CV_OVERRIDE; // aliases for scripting CV_WRAP String run(InputArray image, int min_confidence, int component_level=0); @@ -453,11 +453,11 @@ public: */ virtual void run(Mat& image, std::string& output_text, std::vector* component_rects=NULL, std::vector* component_texts=NULL, std::vector* component_confidences=NULL, - int component_level=0); + int component_level=0) CV_OVERRIDE; virtual void run(Mat& image, Mat& mask, std::string& output_text, std::vector* component_rects=NULL, std::vector* component_texts=NULL, std::vector* component_confidences=NULL, - int component_level=0); + int component_level=0) CV_OVERRIDE; // aliases for scripting CV_WRAP String run(InputArray image, int min_confidence, int component_level=0); @@ -555,7 +555,7 @@ public: std::vector* component_rects = NULL, std::vector* component_texts = NULL, std::vector* component_confidences = NULL, - int component_level = OCR_LEVEL_WORD) = 0; + int component_level = OCR_LEVEL_WORD) CV_OVERRIDE = 0; /** @brief Recognize text using a segmentation based word-spotting/classifier cnn. @@ -586,7 +586,7 @@ public: std::vector* component_rects = NULL, std::vector* component_texts = NULL, std::vector* component_confidences = NULL, - int component_level = OCR_LEVEL_WORD) = 0; + int component_level = OCR_LEVEL_WORD) CV_OVERRIDE = 0; /** @brief Creates an instance of the OCRHolisticWordRecognizer class. */ diff --git a/modules/text/include/opencv2/text/textDetector.hpp b/modules/text/include/opencv2/text/textDetector.hpp index ad3ff1247..da6533735 100644 --- a/modules/text/include/opencv2/text/textDetector.hpp +++ b/modules/text/include/opencv2/text/textDetector.hpp @@ -48,7 +48,7 @@ public: @param Bbox a vector of Rect that will store the detected word bounding box @param confidence a vector of float that will be updated with the confidence the classifier has for the selected bounding box */ - CV_WRAP virtual void detect(InputArray inputImage, CV_OUT std::vector& Bbox, CV_OUT std::vector& confidence) = 0; + CV_WRAP virtual void detect(InputArray inputImage, CV_OUT std::vector& Bbox, CV_OUT std::vector& confidence) CV_OVERRIDE = 0; /** @brief Creates an instance of the TextDetectorCNN class using the provided parameters. diff --git a/modules/text/samples/webcam_demo.cpp b/modules/text/samples/webcam_demo.cpp index 35a41420d..4fece6b8f 100644 --- a/modules/text/samples/webcam_demo.cpp +++ b/modules/text/samples/webcam_demo.cpp @@ -32,7 +32,7 @@ public: vector >_er_filter1, vector >_er_filter2) : channels(_channels),regions(_regions),er_filter1(_er_filter1),er_filter2(_er_filter2) {} - virtual void operator()( const cv::Range &r ) const + virtual void operator()( const cv::Range &r ) const CV_OVERRIDE { for (int c=r.start; c < r.end; c++) { @@ -63,7 +63,7 @@ public: confidences(_confidences), ocrs(_ocrs) {} - virtual void operator()( const cv::Range &r ) const + virtual void operator()( const cv::Range &r ) const CV_OVERRIDE { for (int c=r.start; c < r.end; c++) { diff --git a/modules/text/src/erfilter.cpp b/modules/text/src/erfilter.cpp index 8bb14de48..7229ecd70 100644 --- a/modules/text/src/erfilter.cpp +++ b/modules/text/src/erfilter.cpp @@ -114,7 +114,7 @@ public: //Constructor ERFilterNM(); //Destructor - ~ERFilterNM() {} + ~ERFilterNM() CV_OVERRIDE {} float minProbability; bool nonMaxSuppression; @@ -122,7 +122,7 @@ public: // the key method. Takes image on input, vector of ERStat is output for the first stage, // input/output - for the second one. - void run( InputArray image, vector& regions ); + void run( InputArray image, vector& regions ) CV_OVERRIDE; protected: int thresholdDelta; @@ -138,14 +138,14 @@ protected: public: // set/get methods to set the algorithm properties, - void setCallback(const Ptr& cb); - void setThresholdDelta(int thresholdDelta); - void setMinArea(float minArea); - void setMaxArea(float maxArea); - void setMinProbability(float minProbability); - void setMinProbabilityDiff(float minProbabilityDiff); - void setNonMaxSuppression(bool nonMaxSuppression); - int getNumRejected(); + void setCallback(const Ptr& cb) CV_OVERRIDE; + void setThresholdDelta(int thresholdDelta) CV_OVERRIDE; + void setMinArea(float minArea) CV_OVERRIDE; + void setMaxArea(float maxArea) CV_OVERRIDE; + void setMinProbability(float minProbability) CV_OVERRIDE; + void setMinProbabilityDiff(float minProbabilityDiff) CV_OVERRIDE; + void setNonMaxSuppression(bool nonMaxSuppression) CV_OVERRIDE; + int getNumRejected() CV_OVERRIDE; private: // pointer to the input/output regions vector @@ -171,32 +171,32 @@ private: // default 1st stage classifier -class CV_EXPORTS ERClassifierNM1 : public ERFilter::Callback +class CV_EXPORTS ERClassifierNM1 CV_FINAL : public ERFilter::Callback { public: //Constructor ERClassifierNM1(const string& filename); // Destructor - ~ERClassifierNM1() {} + ~ERClassifierNM1() CV_OVERRIDE {} // The classifier must return probability measure for the region. - double eval(const ERStat& stat); + double eval(const ERStat& stat) CV_OVERRIDE; private: Ptr boost; }; // default 2nd stage classifier -class CV_EXPORTS ERClassifierNM2 : public ERFilter::Callback +class CV_EXPORTS ERClassifierNM2 CV_FINAL : public ERFilter::Callback { public: //constructor ERClassifierNM2(const string& filename); // Destructor - ~ERClassifierNM2() {} + ~ERClassifierNM2() CV_OVERRIDE {} // The classifier must return probability measure for the region. - double eval(const ERStat& stat); + double eval(const ERStat& stat) CV_OVERRIDE; private: Ptr boost; @@ -1178,16 +1178,16 @@ Ptr loadClassifierNM2(const String& filename) } // dummy classifier -class ERDummyClassifier : public ERFilter::Callback +class ERDummyClassifier CV_FINAL : public ERFilter::Callback { public: //Constructor ERDummyClassifier() {} // Destructor - ~ERDummyClassifier() {} + ~ERDummyClassifier() CV_OVERRIDE {} // The classifier must return probability measure for the region. - double eval(const ERStat& s) {if (s.area ==0) return (double)0.0; return (double)1.0;} + double eval(const ERStat& s) CV_OVERRIDE {if (s.area ==0) return (double)0.0; return (double)1.0;} }; /* Create a dummy classifier that accepts all regions */ diff --git a/modules/text/src/ocr_beamsearch_decoder.cpp b/modules/text/src/ocr_beamsearch_decoder.cpp index 96e0978e4..4b0c43c0f 100644 --- a/modules/text/src/ocr_beamsearch_decoder.cpp +++ b/modules/text/src/ocr_beamsearch_decoder.cpp @@ -155,7 +155,7 @@ bool beam_sort_function ( beamSearch_node a, beamSearch_node b ) } -class OCRBeamSearchDecoderImpl : public OCRBeamSearchDecoder +class OCRBeamSearchDecoderImpl CV_FINAL : public OCRBeamSearchDecoder { public: //Default constructor @@ -186,7 +186,7 @@ public: } } - ~OCRBeamSearchDecoderImpl() + ~OCRBeamSearchDecoderImpl() CV_OVERRIDE { } @@ -196,7 +196,7 @@ public: vector* component_rects, vector* component_texts, vector* component_confidences, - int component_level) + int component_level) CV_OVERRIDE { CV_Assert(mask.type() == CV_8UC1); //nothing to do with a mask here @@ -209,7 +209,7 @@ public: vector* component_rects, vector* component_texts, vector* component_confidences, - int component_level) + int component_level) CV_OVERRIDE { CV_Assert( (src.type() == CV_8UC1) || (src.type() == CV_8UC3) ); @@ -519,15 +519,15 @@ Ptr OCRBeamSearchDecoder::create(const String& _filename, return makePtr(loadOCRBeamSearchClassifierCNN(_filename), _vocabulary, transition_p, emission_p, (decoder_mode)_mode, _beam_size); } -class OCRBeamSearchClassifierCNN : public OCRBeamSearchDecoder::ClassifierCallback +class OCRBeamSearchClassifierCNN CV_FINAL : public OCRBeamSearchDecoder::ClassifierCallback { public: //constructor OCRBeamSearchClassifierCNN(const std::string& filename); // Destructor - ~OCRBeamSearchClassifierCNN() {} + ~OCRBeamSearchClassifierCNN() CV_OVERRIDE {} - void eval( InputArray src, vector< vector >& recognition_probabilities, vector& oversegmentation ); + void eval( InputArray src, vector< vector >& recognition_probabilities, vector& oversegmentation ) CV_OVERRIDE; int getWindowSize() {return window_size;} int getStepSize() {return step_size;} diff --git a/modules/text/src/ocr_hmm_decoder.cpp b/modules/text/src/ocr_hmm_decoder.cpp index 3b958b173..fb4c5a1e8 100644 --- a/modules/text/src/ocr_hmm_decoder.cpp +++ b/modules/text/src/ocr_hmm_decoder.cpp @@ -158,7 +158,7 @@ public: mode = _mode; } - ~OCRHMMDecoderImpl() + ~OCRHMMDecoderImpl() CV_OVERRIDE { } @@ -167,7 +167,7 @@ public: vector* component_rects, vector* component_texts, vector* component_confidences, - int component_level) + int component_level) CV_OVERRIDE { CV_Assert( (image.type() == CV_8UC1) || (image.type() == CV_8UC3) ); @@ -413,7 +413,7 @@ public: vector* component_rects, vector* component_texts, vector* component_confidences, - int component_level) + int component_level) CV_OVERRIDE { CV_Assert( (image.type() == CV_8UC1) || (image.type() == CV_8UC3) ); @@ -694,15 +694,15 @@ Ptr OCRHMMDecoder::create( const String& _filename, return makePtr(loadOCRHMMClassifier(_filename, _classifier), _vocabulary, transition_p, emission_p, (decoder_mode)_mode); } -class OCRHMMClassifierKNN : public OCRHMMDecoder::ClassifierCallback +class OCRHMMClassifierKNN CV_FINAL : public OCRHMMDecoder::ClassifierCallback { public: //constructor OCRHMMClassifierKNN(const std::string& filename); // Destructor - ~OCRHMMClassifierKNN() {} + ~OCRHMMClassifierKNN() CV_OVERRIDE {} - void eval( InputArray mask, vector& out_class, vector& out_confidence ); + void eval( InputArray mask, vector& out_class, vector& out_confidence ) CV_OVERRIDE; private: Ptr knn; }; @@ -956,7 +956,7 @@ public: // Destructor ~OCRHMMClassifierCNN() {} - void eval( InputArray image, vector& out_class, vector& out_confidence ); + void eval( InputArray image, vector& out_class, vector& out_confidence ) CV_OVERRIDE; protected: void normalizeAndZCA(Mat& patches); diff --git a/modules/text/src/ocr_holistic.cpp b/modules/text/src/ocr_holistic.cpp index a48d30a07..4f4e76746 100644 --- a/modules/text/src/ocr_holistic.cpp +++ b/modules/text/src/ocr_holistic.cpp @@ -13,7 +13,7 @@ using namespace std; namespace cv { namespace text { -class OCRHolisticWordRecognizerImpl : public OCRHolisticWordRecognizer +class OCRHolisticWordRecognizerImpl CV_FINAL : public OCRHolisticWordRecognizer { private: dnn::Net net; @@ -34,7 +34,7 @@ public: CV_Assert(getClassCount() == words.size()); } - void run(Mat& image, std::string& output_text, std::vector* component_rects=NULL, std::vector* component_texts=NULL, std::vector* component_confidences=NULL, int component_level=0) + void run(Mat& image, std::string& output_text, std::vector* component_rects=NULL, std::vector* component_texts=NULL, std::vector* component_confidences=NULL, int component_level=0) CV_OVERRIDE { CV_Assert(component_level==OCR_LEVEL_WORD); //Componnents not applicable for word spotting double confidence; @@ -53,7 +53,7 @@ public: } } - void run(Mat& image, Mat& mask, std::string& output_text, std::vector* component_rects=NULL, std::vector* component_texts=NULL, std::vector* component_confidences=NULL, int component_level=0) + void run(Mat& image, Mat& mask, std::string& output_text, std::vector* component_rects=NULL, std::vector* component_texts=NULL, std::vector* component_confidences=NULL, int component_level=0) CV_OVERRIDE { //Mask is ignored because the CNN operates on a full image CV_Assert(mask.cols == image.cols && mask.rows == image.rows); diff --git a/modules/text/src/ocr_tesseract.cpp b/modules/text/src/ocr_tesseract.cpp index 4c1038379..8696f4b79 100644 --- a/modules/text/src/ocr_tesseract.cpp +++ b/modules/text/src/ocr_tesseract.cpp @@ -127,7 +127,7 @@ CV_WRAP String OCRTesseract::run(InputArray image, InputArray mask, int min_conf } -class OCRTesseractImpl : public OCRTesseract +class OCRTesseractImpl CV_FINAL : public OCRTesseract { private: #ifdef HAVE_TESSERACT @@ -172,7 +172,7 @@ public: #endif } - ~OCRTesseractImpl() + ~OCRTesseractImpl() CV_OVERRIDE { #ifdef HAVE_TESSERACT tess.End(); @@ -181,7 +181,7 @@ public: void run(Mat& image, string& output, vector* component_rects=NULL, vector* component_texts=NULL, vector* component_confidences=NULL, - int component_level=0) + int component_level=0) CV_OVERRIDE { CV_Assert( (image.type() == CV_8UC1) || (image.type() == CV_8UC3) ); @@ -249,7 +249,7 @@ public: void run(Mat& image, Mat& mask, string& output, vector* component_rects=NULL, vector* component_texts=NULL, vector* component_confidences=NULL, - int component_level=0) + int component_level=0) CV_OVERRIDE { CV_Assert( mask.type() == CV_8UC1 ); CV_Assert( (image.type() == CV_8UC1) || (image.type() == CV_8UC3) ); @@ -257,7 +257,7 @@ public: run( mask, output, component_rects, component_texts, component_confidences, component_level); } - void setWhiteList(const String& char_whitelist) + void setWhiteList(const String& char_whitelist) CV_OVERRIDE { #ifdef HAVE_TESSERACT tess.SetVariable("tessedit_char_whitelist", char_whitelist.c_str()); diff --git a/modules/text/src/text_detectorCNN.cpp b/modules/text/src/text_detectorCNN.cpp index 84f769b42..b7a8571ad 100644 --- a/modules/text/src/text_detectorCNN.cpp +++ b/modules/text/src/text_detectorCNN.cpp @@ -60,7 +60,7 @@ public: inputChannelCount_ = 3; } - void detect(InputArray inputImage_, std::vector& Bbox, std::vector& confidence) + void detect(InputArray inputImage_, std::vector& Bbox, std::vector& confidence) CV_OVERRIDE { CV_Assert(inputImage_.channels() == inputChannelCount_); Mat inputImage = inputImage_.getMat(); diff --git a/modules/tracking/include/opencv2/tracking/feature.hpp b/modules/tracking/include/opencv2/tracking/feature.hpp index b354d62cc..710a37012 100644 --- a/modules/tracking/include/opencv2/tracking/feature.hpp +++ b/modules/tracking/include/opencv2/tracking/feature.hpp @@ -145,8 +145,8 @@ class CvFeatureParams : public CvParams }; CvFeatureParams(); virtual void init( const CvFeatureParams& fp ); - virtual void write( FileStorage &fs ) const; - virtual bool read( const FileNode &node ); + virtual void write( FileStorage &fs ) const CV_OVERRIDE; + virtual bool read( const FileNode &node ) CV_OVERRIDE; static Ptr create( int featureType ); int maxCatCount; // 0 in case of numerical features int featSize; // 1 in case of simple features (HAAR, LBP) and N_BINS(9)*N_CELLS(4) in case of Dalal's HOG features @@ -201,13 +201,13 @@ class CvHaarFeatureParams : public CvFeatureParams CvHaarFeatureParams(); - virtual void init( const CvFeatureParams& fp ); - virtual void write( FileStorage &fs ) const; - virtual bool read( const FileNode &node ); + virtual void init( const CvFeatureParams& fp ) CV_OVERRIDE; + virtual void write( FileStorage &fs ) const CV_OVERRIDE; + virtual bool read( const FileNode &node ) CV_OVERRIDE; - virtual void printDefaults() const; - virtual void printAttrs() const; - virtual bool scanAttr( const std::string prm, const std::string val ); + virtual void printDefaults() const CV_OVERRIDE; + virtual void printAttrs() const CV_OVERRIDE; + virtual bool scanAttr( const std::string prm, const std::string val ) CV_OVERRIDE; bool isIntegral; }; @@ -251,10 +251,10 @@ class CvHaarEvaluator : public CvFeatureEvaluator }; - virtual void init( const CvFeatureParams *_featureParams, int _maxSampleCount, Size _winSize ); - virtual void setImage( const Mat& img, uchar clsLabel = 0, int idx = 1 ); - virtual float operator()( int featureIdx, int sampleIdx ); - virtual void writeFeatures( FileStorage &fs, const Mat& featureMap ) const; + virtual void init( const CvFeatureParams *_featureParams, int _maxSampleCount, Size _winSize ) CV_OVERRIDE; + virtual void setImage( const Mat& img, uchar clsLabel = 0, int idx = 1 ) CV_OVERRIDE; + virtual float operator()( int featureIdx, int sampleIdx ) CV_OVERRIDE; + virtual void writeFeatures( FileStorage &fs, const Mat& featureMap ) const CV_OVERRIDE; void writeFeature( FileStorage &fs ) const; // for old file format const std::vector& getFeatures() const; inline CvHaarEvaluator::FeatureHaar& getFeatures( int idx ) @@ -263,7 +263,7 @@ class CvHaarEvaluator : public CvFeatureEvaluator } void setWinSize( Size patchSize ); Size setWinSize() const; - virtual void generateFeatures(); + virtual void generateFeatures() CV_OVERRIDE; /** * TODO new method @@ -300,12 +300,12 @@ class CvHOGEvaluator : public CvFeatureEvaluator virtual ~CvHOGEvaluator() { } - virtual void init( const CvFeatureParams *_featureParams, int _maxSampleCount, Size _winSize ); - virtual void setImage( const Mat& img, uchar clsLabel, int idx ); - virtual float operator()( int varIdx, int sampleIdx ); - virtual void writeFeatures( FileStorage &fs, const Mat& featureMap ) const; + virtual void init( const CvFeatureParams *_featureParams, int _maxSampleCount, Size _winSize ) CV_OVERRIDE; + virtual void setImage( const Mat& img, uchar clsLabel, int idx ) CV_OVERRIDE; + virtual float operator()( int varIdx, int sampleIdx ) CV_OVERRIDE; + virtual void writeFeatures( FileStorage &fs, const Mat& featureMap ) const CV_OVERRIDE; protected: - virtual void generateFeatures(); + virtual void generateFeatures() CV_OVERRIDE; virtual void integralHistogram( const Mat &img, std::vector &histogram, Mat &norm, int nbins ) const; class Feature { @@ -364,18 +364,18 @@ struct CvLBPFeatureParams : CvFeatureParams class CvLBPEvaluator : public CvFeatureEvaluator { public: - virtual ~CvLBPEvaluator() + virtual ~CvLBPEvaluator() CV_OVERRIDE { } - virtual void init( const CvFeatureParams *_featureParams, int _maxSampleCount, Size _winSize ); - virtual void setImage( const Mat& img, uchar clsLabel, int idx ); - virtual float operator()( int featureIdx, int sampleIdx ) + virtual void init( const CvFeatureParams *_featureParams, int _maxSampleCount, Size _winSize ) CV_OVERRIDE; + virtual void setImage( const Mat& img, uchar clsLabel, int idx ) CV_OVERRIDE; + virtual float operator()( int featureIdx, int sampleIdx ) CV_OVERRIDE { return (float) features[featureIdx].calc( sum, sampleIdx ); } - virtual void writeFeatures( FileStorage &fs, const Mat& featureMap ) const; + virtual void writeFeatures( FileStorage &fs, const Mat& featureMap ) const CV_OVERRIDE; protected: - virtual void generateFeatures(); + virtual void generateFeatures() CV_OVERRIDE; class Feature { diff --git a/modules/tracking/include/opencv2/tracking/tracker.hpp b/modules/tracking/include/opencv2/tracking/tracker.hpp index 9224aa46d..37545bfee 100644 --- a/modules/tracking/include/opencv2/tracking/tracker.hpp +++ b/modules/tracking/include/opencv2/tracking/tracker.hpp @@ -525,7 +525,7 @@ class CV_EXPORTS_W Tracker : public virtual Algorithm { public: - virtual ~Tracker(); + virtual ~Tracker() CV_OVERRIDE; /** @brief Initialize the tracker with a known bounding box that surrounded the target @param image The initial frame @@ -546,8 +546,8 @@ class CV_EXPORTS_W Tracker : public virtual Algorithm */ CV_WRAP bool update( InputArray image, CV_OUT Rect2d& boundingBox ); - virtual void read( const FileNode& fn )=0; - virtual void write( FileStorage& fs ) const=0; + virtual void read( const FileNode& fn ) CV_OVERRIDE = 0; + virtual void write( FileStorage& fs ) const CV_OVERRIDE = 0; protected: @@ -627,8 +627,8 @@ class CV_EXPORTS TrackerStateEstimatorMILBoosting : public TrackerStateEstimator void setCurrentConfidenceMap( ConfidenceMap& confidenceMap ); protected: - Ptr estimateImpl( const std::vector& confidenceMaps ); - void updateImpl( std::vector& confidenceMaps ); + Ptr estimateImpl( const std::vector& confidenceMaps ) CV_OVERRIDE; + void updateImpl( std::vector& confidenceMaps ) CV_OVERRIDE; private: uint max_idx( const std::vector &v ); @@ -732,8 +732,8 @@ class CV_EXPORTS TrackerStateEstimatorAdaBoosting : public TrackerStateEstimator std::vector computeSwappedClassifier(); protected: - Ptr estimateImpl( const std::vector& confidenceMaps ); - void updateImpl( std::vector& confidenceMaps ); + Ptr estimateImpl( const std::vector& confidenceMaps ) CV_OVERRIDE; + void updateImpl( std::vector& confidenceMaps ) CV_OVERRIDE; Ptr boostClassifier; @@ -760,8 +760,8 @@ class CV_EXPORTS TrackerStateEstimatorSVM : public TrackerStateEstimator ~TrackerStateEstimatorSVM(); protected: - Ptr estimateImpl( const std::vector& confidenceMaps ); - void updateImpl( std::vector& confidenceMaps ); + Ptr estimateImpl( const std::vector& confidenceMaps ) CV_OVERRIDE; + void updateImpl( std::vector& confidenceMaps ) CV_OVERRIDE; }; /************************************ Specific TrackerSamplerAlgorithm Classes ************************************/ @@ -813,7 +813,7 @@ class CV_EXPORTS TrackerSamplerCSC : public TrackerSamplerAlgorithm protected: - bool samplingImpl( const Mat& image, Rect boundingBox, std::vector& sample ); + bool samplingImpl( const Mat& image, Rect boundingBox, std::vector& sample ) CV_OVERRIDE; private: @@ -860,7 +860,7 @@ class CV_EXPORTS TrackerSamplerCS : public TrackerSamplerAlgorithm ~TrackerSamplerCS(); - bool samplingImpl( const Mat& image, Rect boundingBox, std::vector& sample ); + bool samplingImpl( const Mat& image, Rect boundingBox, std::vector& sample ) CV_OVERRIDE; Rect getROI() const; private: Rect getTrackingROI( float searchFactor ); @@ -916,7 +916,7 @@ public: */ TrackerSamplerPF(const Mat& chosenRect,const TrackerSamplerPF::Params ¶meters = TrackerSamplerPF::Params()); protected: - bool samplingImpl( const Mat& image, Rect boundingBox, std::vector& sample ); + bool samplingImpl( const Mat& image, Rect boundingBox, std::vector& sample ) CV_OVERRIDE; private: Params params; Ptr _solver; @@ -939,13 +939,13 @@ class CV_EXPORTS TrackerFeatureFeature2d : public TrackerFeature */ TrackerFeatureFeature2d( String detectorType, String descriptorType ); - ~TrackerFeatureFeature2d(); + ~TrackerFeatureFeature2d() CV_OVERRIDE; - void selection( Mat& response, int npoints ); + void selection( Mat& response, int npoints ) CV_OVERRIDE; protected: - bool computeImpl( const std::vector& images, Mat& response ); + bool computeImpl( const std::vector& images, Mat& response ) CV_OVERRIDE; private: @@ -961,13 +961,13 @@ class CV_EXPORTS TrackerFeatureHOG : public TrackerFeature TrackerFeatureHOG(); - ~TrackerFeatureHOG(); + ~TrackerFeatureHOG() CV_OVERRIDE; - void selection( Mat& response, int npoints ); + void selection( Mat& response, int npoints ) CV_OVERRIDE; protected: - bool computeImpl( const std::vector& images, Mat& response ); + bool computeImpl( const std::vector& images, Mat& response ) CV_OVERRIDE; }; @@ -990,7 +990,7 @@ class CV_EXPORTS TrackerFeatureHAAR : public TrackerFeature */ TrackerFeatureHAAR( const TrackerFeatureHAAR::Params ¶meters = TrackerFeatureHAAR::Params() ); - ~TrackerFeatureHAAR(); + ~TrackerFeatureHAAR() CV_OVERRIDE; /** @brief Compute the features only for the selected indices in the images collection @param selFeatures indices of selected features @@ -1005,7 +1005,7 @@ class CV_EXPORTS TrackerFeatureHAAR : public TrackerFeature @note This method modifies the response parameter */ - void selection( Mat& response, int npoints ); + void selection( Mat& response, int npoints ) CV_OVERRIDE; /** @brief Swap the feature in position source with the feature in position target @param source The source position @@ -1025,7 +1025,7 @@ class CV_EXPORTS TrackerFeatureHAAR : public TrackerFeature CvHaarEvaluator::FeatureHaar& getFeatureAt( int id ); protected: - bool computeImpl( const std::vector& images, Mat& response ); + bool computeImpl( const std::vector& images, Mat& response ) CV_OVERRIDE; private: @@ -1044,11 +1044,11 @@ class CV_EXPORTS TrackerFeatureLBP : public TrackerFeature ~TrackerFeatureLBP(); - void selection( Mat& response, int npoints ); + void selection( Mat& response, int npoints ) CV_OVERRIDE; protected: - bool computeImpl( const std::vector& images, Mat& response ); + bool computeImpl( const std::vector& images, Mat& response ) CV_OVERRIDE; }; @@ -1088,7 +1088,7 @@ class CV_EXPORTS_W TrackerMIL : public Tracker CV_WRAP static Ptr create(); - virtual ~TrackerMIL() {} + virtual ~TrackerMIL() CV_OVERRIDE {} }; /** @brief This is a real-time object tracking based on a novel on-line version of the AdaBoost algorithm. @@ -1125,7 +1125,7 @@ class CV_EXPORTS_W TrackerBoosting : public Tracker CV_WRAP static Ptr create(); - virtual ~TrackerBoosting() {} + virtual ~TrackerBoosting() CV_OVERRIDE {} }; /** @brief Median Flow tracker implementation. @@ -1164,7 +1164,7 @@ class CV_EXPORTS_W TrackerMedianFlow : public Tracker CV_WRAP static Ptr create(); - virtual ~TrackerMedianFlow() {} + virtual ~TrackerMedianFlow() CV_OVERRIDE {} }; /** @brief TLD is a novel tracking framework that explicitly decomposes the long-term tracking task into @@ -1195,7 +1195,7 @@ class CV_EXPORTS_W TrackerTLD : public Tracker CV_WRAP static Ptr create(); - virtual ~TrackerTLD() {} + virtual ~TrackerTLD() CV_OVERRIDE {} }; /** @brief KCF is a novel tracking framework that utilizes properties of circulant matrix to enhance the processing speed. @@ -1261,7 +1261,7 @@ public: CV_WRAP static Ptr create(); - virtual ~TrackerKCF() {} + virtual ~TrackerKCF() CV_OVERRIDE {} }; /** @brief GOTURN (@cite GOTURN) is kind of trackers based on Convolutional Neural Networks (CNN). While taking all advantages of CNN trackers, @@ -1294,7 +1294,7 @@ public: CV_WRAP static Ptr create(); - virtual ~TrackerGOTURN() {} + virtual ~TrackerGOTURN() CV_OVERRIDE {} }; /** @brief the MOSSE tracker @@ -1309,7 +1309,7 @@ class CV_EXPORTS_W TrackerMOSSE : public Tracker */ CV_WRAP static Ptr create(); - virtual ~TrackerMOSSE() {} + virtual ~TrackerMOSSE() CV_OVERRIDE {} }; @@ -1330,7 +1330,7 @@ public: /** * \brief Destructor */ - ~MultiTracker(); + ~MultiTracker() CV_OVERRIDE; /** * \brief Add a new object to be tracked. @@ -1524,7 +1524,7 @@ public: virtual void setInitialMask(const Mat mask) = 0; - virtual ~TrackerCSRT() {} + virtual ~TrackerCSRT() CV_OVERRIDE {} }; } /* namespace cv */ diff --git a/modules/tracking/src/PFSolver.hpp b/modules/tracking/src/PFSolver.hpp index d8ff8288d..520fa5f7e 100644 --- a/modules/tracking/src/PFSolver.hpp +++ b/modules/tracking/src/PFSolver.hpp @@ -22,7 +22,7 @@ namespace cv{ PFSolver(); void getOptParam(OutputArray params)const; int iteration(); - double minimize(InputOutputArray x); + double minimize(InputOutputArray x) CV_OVERRIDE; void setParticlesNum(int num); int getParticlesNum(); @@ -31,10 +31,10 @@ namespace cv{ void getParamsSTD(OutputArray std)const; void setParamsSTD(InputArray std); - Ptr getFunction() const; - void setFunction(const Ptr& f); - TermCriteria getTermCriteria() const; - void setTermCriteria(const TermCriteria& termcrit); + Ptr getFunction() const CV_OVERRIDE; + void setFunction(const Ptr& f) CV_OVERRIDE; + TermCriteria getTermCriteria() const CV_OVERRIDE; + void setTermCriteria(const TermCriteria& termcrit) CV_OVERRIDE; private: Mat_ _std,_particles,_logweight; Ptr _Function; diff --git a/modules/tracking/src/TrackingFunctionPF.hpp b/modules/tracking/src/TrackingFunctionPF.hpp index 3ce4e0ee6..d1e621afa 100644 --- a/modules/tracking/src/TrackingFunctionPF.hpp +++ b/modules/tracking/src/TrackingFunctionPF.hpp @@ -9,9 +9,9 @@ namespace cv{ public: TrackingFunctionPF(const Mat& chosenRect); void update(const Mat& image); - int getDims() const { return 4; } - double calc(const double* x) const; - void correctParams(double* pt)const; + int getDims() const CV_OVERRIDE { return 4; } + double calc(const double* x) const CV_OVERRIDE; + void correctParams(double* pt)const CV_OVERRIDE; private: Mat _image; static inline Rect rectFromRow(const double* row); diff --git a/modules/tracking/src/augmented_unscented_kalman.cpp b/modules/tracking/src/augmented_unscented_kalman.cpp index 0ba8b03ab..85fdfabc4 100644 --- a/modules/tracking/src/augmented_unscented_kalman.cpp +++ b/modules/tracking/src/augmented_unscented_kalman.cpp @@ -140,16 +140,16 @@ class AugmentedUnscentedKalmanFilterImpl: public UnscentedKalmanFilter public: AugmentedUnscentedKalmanFilterImpl(const AugmentedUnscentedKalmanFilterParams& params); - ~AugmentedUnscentedKalmanFilterImpl(); + ~AugmentedUnscentedKalmanFilterImpl() CV_OVERRIDE; - Mat predict(InputArray control); - Mat correct(InputArray measurement); + Mat predict(InputArray control) CV_OVERRIDE; + Mat correct(InputArray measurement) CV_OVERRIDE; - Mat getProcessNoiseCov() const; - Mat getMeasurementNoiseCov() const; - Mat getErrorCov() const; + Mat getProcessNoiseCov() const CV_OVERRIDE; + Mat getMeasurementNoiseCov() const CV_OVERRIDE; + Mat getErrorCov() const CV_OVERRIDE; - Mat getState() const; + Mat getState() const CV_OVERRIDE; }; diff --git a/modules/tracking/src/gtrTracker.cpp b/modules/tracking/src/gtrTracker.cpp index a16075091..8d4442c8b 100644 --- a/modules/tracking/src/gtrTracker.cpp +++ b/modules/tracking/src/gtrTracker.cpp @@ -81,8 +81,8 @@ public: protected: Rect2d boundingBox_; Mat image_; - void modelEstimationImpl(const std::vector&){} - void modelUpdateImpl(){} + void modelEstimationImpl(const std::vector&) CV_OVERRIDE {} + void modelUpdateImpl() CV_OVERRIDE {} }; TrackerGOTURNImpl::TrackerGOTURNImpl(const TrackerGOTURN::Params ¶meters) : diff --git a/modules/tracking/src/gtrTracker.hpp b/modules/tracking/src/gtrTracker.hpp index 21ae3d98e..cd2820da5 100644 --- a/modules/tracking/src/gtrTracker.hpp +++ b/modules/tracking/src/gtrTracker.hpp @@ -64,10 +64,10 @@ class TrackerGOTURNImpl : public TrackerGOTURN { public: TrackerGOTURNImpl(const TrackerGOTURN::Params ¶meters = TrackerGOTURN::Params()); - void read(const FileNode& fn); - void write(FileStorage& fs) const; - bool initImpl(const Mat& image, const Rect2d& boundingBox); - bool updateImpl(const Mat& image, Rect2d& boundingBox); + void read(const FileNode& fn) CV_OVERRIDE; + void write(FileStorage& fs) const CV_OVERRIDE; + bool initImpl(const Mat& image, const Rect2d& boundingBox) CV_OVERRIDE; + bool updateImpl(const Mat& image, Rect2d& boundingBox) CV_OVERRIDE; TrackerGOTURN::Params params; diff --git a/modules/tracking/src/mosseTracker.cpp b/modules/tracking/src/mosseTracker.cpp index 800e643d8..038a8ba1d 100644 --- a/modules/tracking/src/mosseTracker.cpp +++ b/modules/tracking/src/mosseTracker.cpp @@ -20,8 +20,8 @@ namespace tracking { struct DummyModel : TrackerModel { - virtual void modelUpdateImpl(){} - virtual void modelEstimationImpl( const std::vector& ){} + virtual void modelUpdateImpl() CV_OVERRIDE {} + virtual void modelEstimationImpl( const std::vector& ) CV_OVERRIDE {} }; @@ -30,7 +30,7 @@ const double rate=0.2; // learning rate const double psrThreshold=5.7; // no detection, if PSR is smaller than this -struct MosseImpl : TrackerMOSSE +struct MosseImpl CV_FINAL : TrackerMOSSE { protected: @@ -130,7 +130,7 @@ protected: } - virtual bool initImpl( const Mat& image, const Rect2d& boundingBox ) + virtual bool initImpl( const Mat& image, const Rect2d& boundingBox ) CV_OVERRIDE { model = makePtr(); @@ -183,7 +183,7 @@ protected: return true; } - virtual bool updateImpl( const Mat& image, Rect2d& boundingBox ) + virtual bool updateImpl( const Mat& image, Rect2d& boundingBox ) CV_OVERRIDE { if (H.empty()) // not initialized return false; @@ -232,8 +232,8 @@ public: MosseImpl() { isInit = 0; } // dummy implementation. - virtual void read( const FileNode& ){} - virtual void write( FileStorage& ) const{} + virtual void read( const FileNode& ) CV_OVERRIDE {} + virtual void write( FileStorage& ) const CV_OVERRIDE {} }; // MosseImpl diff --git a/modules/tracking/src/tldDetector.cpp b/modules/tracking/src/tldDetector.cpp index f6de5c639..bb52a4899 100644 --- a/modules/tracking/src/tldDetector.cpp +++ b/modules/tracking/src/tldDetector.cpp @@ -337,7 +337,7 @@ namespace cv { } - virtual void operator () (const cv::Range & r) const + virtual void operator () (const cv::Range & r) const CV_OVERRIDE { for (int ind = r.start; ind < r.end; ++ind) { diff --git a/modules/tracking/src/tldModel.cpp b/modules/tracking/src/tldModel.cpp index 9ee9064cf..833e586d0 100644 --- a/modules/tracking/src/tldModel.cpp +++ b/modules/tracking/src/tldModel.cpp @@ -195,7 +195,7 @@ namespace cv { } - virtual void operator () (const cv::Range & r) const + virtual void operator () (const cv::Range & r) const CV_OVERRIDE { for (int ind = r.start; ind < r.end; ++ind) { diff --git a/modules/tracking/src/tldModel.hpp b/modules/tracking/src/tldModel.hpp index a46aa1d8c..7616ebdc4 100644 --- a/modules/tracking/src/tldModel.hpp +++ b/modules/tracking/src/tldModel.hpp @@ -42,7 +42,6 @@ #ifndef OPENCV_TLD_MODEL #define OPENCV_TLD_MODEL -#include "precomp.hpp" #include "tldDetector.hpp" #include "tldUtils.hpp" @@ -79,8 +78,8 @@ namespace cv Size minSize_; TrackerTLD::Params params_; void pushIntoModel(const Mat_& example, bool positive); - void modelEstimationImpl(const std::vector& /*responses*/){} - void modelUpdateImpl(){} + void modelEstimationImpl(const std::vector& /*responses*/) CV_OVERRIDE {} + void modelUpdateImpl() CV_OVERRIDE {} Rect2d boundingBox_; RNG rng; }; diff --git a/modules/tracking/src/tldTracker.hpp b/modules/tracking/src/tldTracker.hpp index 069878f46..3f9861192 100644 --- a/modules/tracking/src/tldTracker.hpp +++ b/modules/tracking/src/tldTracker.hpp @@ -96,12 +96,12 @@ class TrackerProxyImpl : public TrackerProxy { public: TrackerProxyImpl(Tparams params = Tparams()) :params_(params){} - bool init(const Mat& image, const Rect2d& boundingBox) + bool init(const Mat& image, const Rect2d& boundingBox) CV_OVERRIDE { trackerPtr = T::create(); return trackerPtr->init(image, boundingBox); } - bool update(const Mat& image, Rect2d& boundingBox) + bool update(const Mat& image, Rect2d& boundingBox) CV_OVERRIDE { return trackerPtr->update(image, boundingBox); } @@ -119,8 +119,8 @@ class TrackerTLDImpl : public TrackerTLD { public: TrackerTLDImpl(const TrackerTLD::Params ¶meters = TrackerTLD::Params()); - void read(const FileNode& fn); - void write(FileStorage& fs) const; + void read(const FileNode& fn) CV_OVERRIDE; + void write(FileStorage& fs) const CV_OVERRIDE; Ptr getModel() { @@ -136,7 +136,7 @@ public: bool operator()(Rect2d /*box*/){ return false; } int additionalExamples(std::vector >& examplesForModel, std::vector >& examplesForEnsemble); protected: - Pexpert(){} + Pexpert() : detector_(NULL) {} Mat img_, imgBlurred_; Rect2d resultBox_; const TLDDetector* detector_; @@ -159,8 +159,8 @@ public: } }; - bool initImpl(const Mat& image, const Rect2d& boundingBox); - bool updateImpl(const Mat& image, Rect2d& boundingBox); + bool initImpl(const Mat& image, const Rect2d& boundingBox) CV_OVERRIDE; + bool updateImpl(const Mat& image, Rect2d& boundingBox) CV_OVERRIDE; TrackerTLD::Params params; Ptr data; diff --git a/modules/tracking/src/trackerBoosting.cpp b/modules/tracking/src/trackerBoosting.cpp index e1d6b4c2c..32ca27120 100644 --- a/modules/tracking/src/trackerBoosting.cpp +++ b/modules/tracking/src/trackerBoosting.cpp @@ -49,13 +49,13 @@ class TrackerBoostingImpl : public TrackerBoosting { public: TrackerBoostingImpl( const TrackerBoosting::Params ¶meters = TrackerBoosting::Params() ); - void read( const FileNode& fn ); - void write( FileStorage& fs ) const; + void read( const FileNode& fn ) CV_OVERRIDE; + void write( FileStorage& fs ) const CV_OVERRIDE; protected: - bool initImpl( const Mat& image, const Rect2d& boundingBox ); - bool updateImpl( const Mat& image, Rect2d& boundingBox ); + bool initImpl( const Mat& image, const Rect2d& boundingBox ) CV_OVERRIDE; + bool updateImpl( const Mat& image, Rect2d& boundingBox ) CV_OVERRIDE; TrackerBoosting::Params params; }; diff --git a/modules/tracking/src/trackerBoostingModel.hpp b/modules/tracking/src/trackerBoostingModel.hpp index 1e5e319f0..0d4582cd1 100644 --- a/modules/tracking/src/trackerBoostingModel.hpp +++ b/modules/tracking/src/trackerBoostingModel.hpp @@ -93,8 +93,8 @@ class TrackerBoostingModel : public TrackerModel std::vector getSelectedWeakClassifier(); protected: - void modelEstimationImpl( const std::vector& responses ); - void modelUpdateImpl(); + void modelEstimationImpl( const std::vector& responses ) CV_OVERRIDE; + void modelUpdateImpl() CV_OVERRIDE; private: diff --git a/modules/tracking/src/trackerCSRT.cpp b/modules/tracking/src/trackerCSRT.cpp index 81edce649..64eefd52b 100644 --- a/modules/tracking/src/trackerCSRT.cpp +++ b/modules/tracking/src/trackerCSRT.cpp @@ -19,8 +19,8 @@ public: TrackerCSRTModel(TrackerCSRT::Params /*params*/){} ~TrackerCSRTModel(){} protected: - void modelEstimationImpl(const std::vector& /*responses*/){} - void modelUpdateImpl(){} + void modelEstimationImpl(const std::vector& /*responses*/) CV_OVERRIDE {} + void modelUpdateImpl() CV_OVERRIDE {} }; @@ -28,15 +28,15 @@ class TrackerCSRTImpl : public TrackerCSRT { public: TrackerCSRTImpl(const TrackerCSRT::Params ¶meters = TrackerCSRT::Params()); - void read(const FileNode& fn); - void write(FileStorage& fs) const; + void read(const FileNode& fn) CV_OVERRIDE; + void write(FileStorage& fs) const CV_OVERRIDE; protected: TrackerCSRT::Params params; - bool initImpl(const Mat& image, const Rect2d& boundingBox); - virtual void setInitialMask(const Mat mask); - bool updateImpl(const Mat& image, Rect2d& boundingBox); + bool initImpl(const Mat& image, const Rect2d& boundingBox) CV_OVERRIDE; + virtual void setInitialMask(const Mat mask) CV_OVERRIDE; + bool updateImpl(const Mat& image, Rect2d& boundingBox) CV_OVERRIDE; void update_csr_filter(const Mat &image, const Mat &my_mask); void update_histograms(const Mat &image, const Rect ®ion); void extract_histograms(const Mat &image, cv::Rect region, Histogram &hf, Histogram &hb); @@ -232,7 +232,7 @@ public: this->P = P; this->admm_iterations = admm_iterations; } - virtual void operator ()(const Range& range) const + virtual void operator ()(const Range& range) const CV_OVERRIDE { for (int i = range.start; i < range.end; i++) { float mu = 5.0f; diff --git a/modules/tracking/src/trackerCSRTScaleEstimation.cpp b/modules/tracking/src/trackerCSRTScaleEstimation.cpp index c0befafa0..5bde5f420 100644 --- a/modules/tracking/src/trackerCSRTScaleEstimation.cpp +++ b/modules/tracking/src/trackerCSRTScaleEstimation.cpp @@ -35,7 +35,7 @@ public: this->col_len = col_len; this->result = result; } - virtual void operator ()(const Range& range) const + virtual void operator ()(const Range& range) const CV_OVERRIDE { for (int s = range.start; s < range.end; s++) { Size patch_sz = Size(static_cast(current_scale * scale_factors[s] * base_target_sz.width), diff --git a/modules/tracking/src/trackerFeature.cpp b/modules/tracking/src/trackerFeature.cpp index 3d1e1c16f..b48620e69 100644 --- a/modules/tracking/src/trackerFeature.cpp +++ b/modules/tracking/src/trackerFeature.cpp @@ -248,7 +248,7 @@ class Parallel_compute : public cv::ParallelLoopBody //features = featureEvaluator->getFeatures(); } - virtual void operator()( const cv::Range &r ) const + virtual void operator()( const cv::Range &r ) const CV_OVERRIDE { for ( int jf = r.start; jf != r.end; ++jf ) { diff --git a/modules/tracking/src/trackerKCF.cpp b/modules/tracking/src/trackerKCF.cpp index 7853f2980..cc7bb9e59 100644 --- a/modules/tracking/src/trackerKCF.cpp +++ b/modules/tracking/src/trackerKCF.cpp @@ -56,8 +56,8 @@ namespace cv{ TrackerKCFModel(TrackerKCF::Params /*params*/){} ~TrackerKCFModel(){} protected: - void modelEstimationImpl( const std::vector& /*responses*/ ){} - void modelUpdateImpl(){} + void modelEstimationImpl( const std::vector& /*responses*/ ) CV_OVERRIDE {} + void modelUpdateImpl() CV_OVERRIDE {} }; } /* namespace cv */ @@ -73,16 +73,16 @@ namespace cv{ class TrackerKCFImpl : public TrackerKCF { public: TrackerKCFImpl( const TrackerKCF::Params ¶meters = TrackerKCF::Params() ); - void read( const FileNode& /*fn*/ ); - void write( FileStorage& /*fs*/ ) const; - void setFeatureExtractor(void (*f)(const Mat, const Rect, Mat&), bool pca_func = false); + void read( const FileNode& /*fn*/ ) CV_OVERRIDE; + void write( FileStorage& /*fs*/ ) const CV_OVERRIDE; + void setFeatureExtractor(void (*f)(const Mat, const Rect, Mat&), bool pca_func = false) CV_OVERRIDE; protected: /* * basic functions and vars */ - bool initImpl( const Mat& /*image*/, const Rect2d& boundingBox ); - bool updateImpl( const Mat& image, Rect2d& boundingBox ); + bool initImpl( const Mat& /*image*/, const Rect2d& boundingBox ) CV_OVERRIDE; + bool updateImpl( const Mat& image, Rect2d& boundingBox ) CV_OVERRIDE; TrackerKCF::Params params; diff --git a/modules/tracking/src/trackerMIL.cpp b/modules/tracking/src/trackerMIL.cpp index 9b08f82e9..8ccc3b3b3 100644 --- a/modules/tracking/src/trackerMIL.cpp +++ b/modules/tracking/src/trackerMIL.cpp @@ -49,13 +49,13 @@ class TrackerMILImpl : public TrackerMIL { public: TrackerMILImpl( const TrackerMIL::Params ¶meters = TrackerMIL::Params() ); - void read( const FileNode& fn ); - void write( FileStorage& fs ) const; + void read( const FileNode& fn ) CV_OVERRIDE; + void write( FileStorage& fs ) const CV_OVERRIDE; protected: - bool initImpl( const Mat& image, const Rect2d& boundingBox ); - bool updateImpl( const Mat& image, Rect2d& boundingBox ); + bool initImpl( const Mat& image, const Rect2d& boundingBox ) CV_OVERRIDE; + bool updateImpl( const Mat& image, Rect2d& boundingBox ) CV_OVERRIDE; void compute_integral( const Mat & img, Mat & ii_img ); TrackerMIL::Params params; diff --git a/modules/tracking/src/trackerMILModel.hpp b/modules/tracking/src/trackerMILModel.hpp index 213e6c71f..cdbf9a3cb 100644 --- a/modules/tracking/src/trackerMILModel.hpp +++ b/modules/tracking/src/trackerMILModel.hpp @@ -87,8 +87,8 @@ class TrackerMILModel : public TrackerModel void responseToConfidenceMap( const std::vector& responses, ConfidenceMap& confidenceMap ); protected: - void modelEstimationImpl( const std::vector& responses ); - void modelUpdateImpl(); + void modelEstimationImpl( const std::vector& responses ) CV_OVERRIDE; + void modelUpdateImpl() CV_OVERRIDE; private: int mode; diff --git a/modules/tracking/src/trackerMedianFlow.cpp b/modules/tracking/src/trackerMedianFlow.cpp index 57a0e2a4b..6f41c3ebe 100644 --- a/modules/tracking/src/trackerMedianFlow.cpp +++ b/modules/tracking/src/trackerMedianFlow.cpp @@ -75,11 +75,11 @@ using namespace cv; class TrackerMedianFlowImpl : public TrackerMedianFlow{ public: TrackerMedianFlowImpl(TrackerMedianFlow::Params paramsIn = TrackerMedianFlow::Params()) {params=paramsIn;isInit=false;} - void read( const FileNode& fn ); - void write( FileStorage& fs ) const; + void read( const FileNode& fn ) CV_OVERRIDE; + void write( FileStorage& fs ) const CV_OVERRIDE; private: - bool initImpl( const Mat& image, const Rect2d& boundingBox ); - bool updateImpl( const Mat& image, Rect2d& boundingBox ); + bool initImpl( const Mat& image, const Rect2d& boundingBox ) CV_OVERRIDE; + bool updateImpl( const Mat& image, Rect2d& boundingBox ) CV_OVERRIDE; bool medianFlowImpl(Mat oldImage,Mat newImage,Rect2d& oldBox); Rect2d vote(const std::vector& oldPoints,const std::vector& newPoints,const Rect2d& oldRect,Point2f& mD); float dist(Point2f p1,Point2f p2); @@ -127,8 +127,8 @@ public: protected: Rect2d boundingBox_; Mat image_; - void modelEstimationImpl( const std::vector& /*responses*/ ){} - void modelUpdateImpl(){} + void modelEstimationImpl( const std::vector& /*responses*/ ) CV_OVERRIDE {} + void modelUpdateImpl() CV_OVERRIDE {} }; void TrackerMedianFlowImpl::read( const cv::FileNode& fn ) diff --git a/modules/tracking/src/unscented_kalman.cpp b/modules/tracking/src/unscented_kalman.cpp index c29d7dcf6..9b8001604 100644 --- a/modules/tracking/src/unscented_kalman.cpp +++ b/modules/tracking/src/unscented_kalman.cpp @@ -132,19 +132,19 @@ public: // perform prediction step // control - the optional control vector, CP x 1 - Mat predict( InputArray control = noArray() ); + Mat predict( InputArray control = noArray() ) CV_OVERRIDE; // perform correction step // measurement - current measurement vector, MP x 1 - Mat correct( InputArray measurement ); + Mat correct( InputArray measurement ) CV_OVERRIDE; // Get system parameters - Mat getProcessNoiseCov() const; - Mat getMeasurementNoiseCov() const; - Mat getErrorCov() const; + Mat getProcessNoiseCov() const CV_OVERRIDE; + Mat getMeasurementNoiseCov() const CV_OVERRIDE; + Mat getErrorCov() const CV_OVERRIDE; // Get the state estimate - Mat getState() const; + Mat getState() const CV_OVERRIDE; }; UnscentedKalmanFilterImpl::UnscentedKalmanFilterImpl(const UnscentedKalmanFilterParams& params) diff --git a/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp b/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp index fcfd9c72a..5efa0926d 100644 --- a/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp +++ b/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp @@ -210,11 +210,11 @@ public: * @param keypoints of interest within image * @param descriptors resulted descriptors array */ - virtual void compute( InputArray image, std::vector& keypoints, OutputArray descriptors ) = 0; + virtual void compute( InputArray image, std::vector& keypoints, OutputArray descriptors ) CV_OVERRIDE = 0; virtual void compute( InputArrayOfArrays images, std::vector >& keypoints, - OutputArrayOfArrays descriptors ); + OutputArrayOfArrays descriptors ) CV_OVERRIDE; /** @overload * @param image image to extract descriptors diff --git a/modules/xfeatures2d/src/affine_feature2d.cpp b/modules/xfeatures2d/src/affine_feature2d.cpp index 149ffa4f2..7c7e18732 100644 --- a/modules/xfeatures2d/src/affine_feature2d.cpp +++ b/modules/xfeatures2d/src/affine_feature2d.cpp @@ -589,7 +589,7 @@ namespace cv { namespace xfeatures2d { -class AffineFeature2D_Impl : public AffineFeature2D +class AffineFeature2D_Impl CV_FINAL : public AffineFeature2D { public: AffineFeature2D_Impl( @@ -599,12 +599,12 @@ public: , m_descriptor_extractor(descriptor_extractor) {} protected: using Feature2D::detect; // overload, don't hide - void detect(InputArray image, std::vector& keypoints, InputArray mask); - void detectAndCompute(InputArray image, InputArray mask, std::vector& keypoints, OutputArray descriptors, bool useProvidedKeypoints); - void detectAndCompute(InputArray image, InputArray mask, std::vector& keypoints, OutputArray descriptors, bool useProvidedKeypoints); - int descriptorSize() const; - int descriptorType() const; - int defaultNorm() const; + void detect(InputArray image, std::vector& keypoints, InputArray mask) CV_OVERRIDE; + void detectAndCompute(InputArray image, InputArray mask, std::vector& keypoints, OutputArray descriptors, bool useProvidedKeypoints) CV_OVERRIDE; + void detectAndCompute(InputArray image, InputArray mask, std::vector& keypoints, OutputArray descriptors, bool useProvidedKeypoints) CV_OVERRIDE; + int descriptorSize() const CV_OVERRIDE; + int descriptorType() const CV_OVERRIDE; + int defaultNorm() const CV_OVERRIDE; private: Ptr m_keypoint_detector; Ptr m_descriptor_extractor; diff --git a/modules/xfeatures2d/src/boostdesc.cpp b/modules/xfeatures2d/src/boostdesc.cpp index 02f6544e0..1e99f7d0e 100644 --- a/modules/xfeatures2d/src/boostdesc.cpp +++ b/modules/xfeatures2d/src/boostdesc.cpp @@ -68,7 +68,7 @@ namespace xfeatures2d /* !BoostDesc implementation */ -class BoostDesc_Impl : public BoostDesc +class BoostDesc_Impl CV_FINAL : public BoostDesc { public: @@ -79,26 +79,26 @@ public: float scale_factor = 6.25f ); // destructor - virtual ~BoostDesc_Impl(); + virtual ~BoostDesc_Impl() CV_OVERRIDE; // returns the descriptor length in bytes - virtual int descriptorSize() const { return m_descriptor_size; } + virtual int descriptorSize() const CV_OVERRIDE { return m_descriptor_size; } // returns the descriptor type - virtual int descriptorType() const { return m_descriptor_type; } + virtual int descriptorType() const CV_OVERRIDE { return m_descriptor_type; } // returns the default norm type - virtual int defaultNorm() const { return m_descriptor_norm; } + virtual int defaultNorm() const CV_OVERRIDE { return m_descriptor_norm; } // compute descriptors given keypoints - virtual void compute( InputArray image, vector& keypoints, OutputArray descriptors ); + virtual void compute( InputArray image, vector& keypoints, OutputArray descriptors ) CV_OVERRIDE; // getter / setter - virtual void setUseScaleOrientation(const bool use_scale_orientation) { m_use_scale_orientation = use_scale_orientation; } - virtual bool getUseScaleOrientation() const { return m_use_scale_orientation; } + virtual void setUseScaleOrientation(const bool use_scale_orientation) CV_OVERRIDE { m_use_scale_orientation = use_scale_orientation; } + virtual bool getUseScaleOrientation() const CV_OVERRIDE { return m_use_scale_orientation; } - virtual void setScaleFactor(const float scale_factor) { m_scale_factor = scale_factor; } - virtual float getScaleFactor() const { return m_scale_factor; } + virtual void setScaleFactor(const float scale_factor) CV_OVERRIDE { m_scale_factor = scale_factor; } + virtual float getScaleFactor() const CV_OVERRIDE { return m_scale_factor; } protected: @@ -415,7 +415,7 @@ struct ComputeBoostDescInvoker : ParallelLoopBody use_scale_orientation = _use_scale_orientation; } - void operator ()( const cv::Range& range ) const + void operator ()( const cv::Range& range ) const CV_OVERRIDE { // maps vector gradMap, integralMap; diff --git a/modules/xfeatures2d/src/brief.cpp b/modules/xfeatures2d/src/brief.cpp index 4557a5866..a43023464 100644 --- a/modules/xfeatures2d/src/brief.cpp +++ b/modules/xfeatures2d/src/brief.cpp @@ -63,14 +63,14 @@ public: // bytes is a length of descriptor in bytes. It can be equal 16, 32 or 64 bytes. BriefDescriptorExtractorImpl( int bytes = 32, bool use_orientation = false ); - virtual void read( const FileNode& ); - virtual void write( FileStorage& ) const; + virtual void read( const FileNode& ) CV_OVERRIDE; + virtual void write( FileStorage& ) const CV_OVERRIDE; - virtual int descriptorSize() const; - virtual int descriptorType() const; - virtual int defaultNorm() const; + virtual int descriptorSize() const CV_OVERRIDE; + virtual int descriptorType() const CV_OVERRIDE; + virtual int defaultNorm() const CV_OVERRIDE; - virtual void compute(InputArray image, std::vector& keypoints, OutputArray descriptors); + virtual void compute(InputArray image, std::vector& keypoints, OutputArray descriptors) CV_OVERRIDE; protected: typedef void(*PixelTestFn)(InputArray, const std::vector&, OutputArray, bool use_orientation ); diff --git a/modules/xfeatures2d/src/daisy.cpp b/modules/xfeatures2d/src/daisy.cpp index f2720e70e..30b7b7ae0 100644 --- a/modules/xfeatures2d/src/daisy.cpp +++ b/modules/xfeatures2d/src/daisy.cpp @@ -83,7 +83,7 @@ void DAISY::compute( InputArrayOfArrays images, /* !DAISY implementation */ -class DAISY_Impl : public DAISY +class DAISY_Impl CV_FINAL : public DAISY { public: @@ -101,39 +101,39 @@ public: int norm = DAISY::NRM_NONE, InputArray H = noArray(), bool interpolation = true, bool use_orientation = false); - virtual ~DAISY_Impl(); + virtual ~DAISY_Impl() CV_OVERRIDE; /** returns the descriptor length in bytes */ - virtual int descriptorSize() const { + virtual int descriptorSize() const CV_OVERRIDE { // +1 is for center pixel return ( (m_rad_q_no * m_th_q_no + 1) * m_hist_th_q_no ); }; /** returns the descriptor type */ - virtual int descriptorType() const { return CV_32F; } + virtual int descriptorType() const CV_OVERRIDE { return CV_32F; } /** returns the default norm type */ - virtual int defaultNorm() const { return NORM_L2; } + virtual int defaultNorm() const CV_OVERRIDE { return NORM_L2; } /** * @param image image to extract descriptors * @param keypoints of interest within image * @param descriptors resulted descriptors array */ - virtual void compute( InputArray image, std::vector& keypoints, OutputArray descriptors ); + virtual void compute( InputArray image, std::vector& keypoints, OutputArray descriptors ) CV_OVERRIDE; /** @overload * @param image image to extract descriptors * @param roi region of interest within image * @param descriptors resulted descriptors array */ - virtual void compute( InputArray image, Rect roi, OutputArray descriptors ); + virtual void compute( InputArray image, Rect roi, OutputArray descriptors ) CV_OVERRIDE; /** @overload * @param image image to extract descriptors * @param descriptors resulted descriptors array */ - virtual void compute( InputArray image, OutputArray descriptors ); + virtual void compute( InputArray image, OutputArray descriptors ) CV_OVERRIDE; /** * @param y position y on image @@ -141,7 +141,7 @@ public: * @param orientation orientation on image (0->360) * @param descriptor supplied array for descriptor storage */ - virtual void GetDescriptor( double y, double x, int orientation, float* descriptor ) const; + virtual void GetDescriptor( double y, double x, int orientation, float* descriptor ) const CV_OVERRIDE; /** * @param y position y on image @@ -150,7 +150,7 @@ public: * @param descriptor supplied array for descriptor storage * @param H homography matrix for warped grid */ - virtual bool GetDescriptor( double y, double x, int orientation, float* descriptor, double* H ) const; + virtual bool GetDescriptor( double y, double x, int orientation, float* descriptor, double* H ) const CV_OVERRIDE; /** * @param y position y on image @@ -158,7 +158,7 @@ public: * @param orientation orientation on image (0->360) * @param descriptor supplied array for descriptor storage */ - virtual void GetUnnormalizedDescriptor( double y, double x, int orientation, float* descriptor ) const; + virtual void GetUnnormalizedDescriptor( double y, double x, int orientation, float* descriptor ) const CV_OVERRIDE; /** * @param y position y on image @@ -167,7 +167,7 @@ public: * @param descriptor supplied array for descriptor storage * @param H homography matrix for warped grid */ - virtual bool GetUnnormalizedDescriptor( double y, double x, int orientation, float* descriptor, double* H ) const; + virtual bool GetUnnormalizedDescriptor( double y, double x, int orientation, float* descriptor, double* H ) const CV_OVERRIDE; protected: @@ -410,7 +410,7 @@ struct LayeredGradientInvoker : ParallelLoopBody layer_no = layers->size[0]; } - void operator ()(const cv::Range& range) const + void operator ()(const cv::Range& range) const CV_OVERRIDE { for (int l = range.start; l < range.end; ++l) { @@ -450,7 +450,7 @@ struct SmoothLayersInvoker : ParallelLoopBody ks = filter_size( sigma, 5.0f ); } - void operator ()(const cv::Range& range) const + void operator ()(const cv::Range& range) const CV_OVERRIDE { for (int l = range.start; l < range.end; ++l) { @@ -1003,7 +1003,7 @@ struct ComputeDescriptorsInvoker : ParallelLoopBody orientation_shift_table = _orientation_shift_table; } - void operator ()(const cv::Range& range) const + void operator ()(const cv::Range& range) const CV_OVERRIDE { int index, orientation; for (int y = range.start; y < range.end; ++y) @@ -1064,7 +1064,7 @@ struct NormalizeDescriptorsInvoker : ParallelLoopBody descriptor_size = _descriptor_size; } - void operator ()(const cv::Range& range) const + void operator ()(const cv::Range& range) const CV_OVERRIDE { for (int d = range.start; d < range.end; ++d) { @@ -1146,7 +1146,7 @@ struct ComputeHistogramsInvoker : ParallelLoopBody _hist_th_q_no = layers->at(r).size[2]; } - void operator ()(const cv::Range& range) const + void operator ()(const cv::Range& range) const CV_OVERRIDE { for (int y = range.start; y < range.end; ++y) { @@ -1251,7 +1251,7 @@ struct MaxDoGInvoker : ParallelLoopBody scale_map = _scale_map; } - void operator ()(const cv::Range& range) const + void operator ()(const cv::Range& range) const CV_OVERRIDE { for (int c = range.start; c < range.end; ++c) { @@ -1277,7 +1277,7 @@ struct RoundingInvoker : ParallelLoopBody scale_map = _scale_map; } - void operator ()(const cv::Range& range) const + void operator ()(const cv::Range& range) const CV_OVERRIDE { for (int c = range.start; c < range.end; ++c) { diff --git a/modules/xfeatures2d/src/freak.cpp b/modules/xfeatures2d/src/freak.cpp index a594a821a..384ad08a4 100644 --- a/modules/xfeatures2d/src/freak.cpp +++ b/modules/xfeatures2d/src/freak.cpp @@ -49,7 +49,7 @@ namespace xfeatures2d /*! FREAK implementation */ -class FREAK_Impl : public FREAK +class FREAK_Impl CV_FINAL : public FREAK { public: /** Constructor @@ -68,13 +68,13 @@ public: virtual ~FREAK_Impl(); /** returns the descriptor length in bytes */ - virtual int descriptorSize() const; + virtual int descriptorSize() const CV_OVERRIDE; /** returns the descriptor type */ - virtual int descriptorType() const; + virtual int descriptorType() const CV_OVERRIDE; /** returns the default norm type */ - virtual int defaultNorm() const; + virtual int defaultNorm() const CV_OVERRIDE; /** select the 512 "best description pairs" * @param images grayscale images set @@ -85,7 +85,7 @@ public: */ std::vector selectPairs( const std::vector& images, std::vector >& keypoints, const double corrThresh = 0.7, bool verbose = true ); - virtual void compute( InputArray image, std::vector& keypoints, OutputArray descriptors ); + virtual void compute( InputArray image, std::vector& keypoints, OutputArray descriptors ) CV_OVERRIDE; protected: @@ -131,7 +131,7 @@ protected: int weight_dx; // dx/(norm_sq))*4096 int weight_dy; // dy/(norm_sq))*4096 }; - + std::vector patternLookup; // look-up table for the pattern points (position+sigma of all points at all scales and orientation) int patternSizes[NB_SCALES]; // size of the pattern at a specific scale (used to check if a point is within image boundaries) DescriptionPair descriptionPairs[NB_PAIRS]; diff --git a/modules/xfeatures2d/src/harris_lapace_detector.cpp b/modules/xfeatures2d/src/harris_lapace_detector.cpp index 46b59f714..6a6c78581 100644 --- a/modules/xfeatures2d/src/harris_lapace_detector.cpp +++ b/modules/xfeatures2d/src/harris_lapace_detector.cpp @@ -315,7 +315,7 @@ namespace xfeatures2d /* * HarrisLaplaceFeatureDetector_Impl */ -class HarrisLaplaceFeatureDetector_Impl : public HarrisLaplaceFeatureDetector +class HarrisLaplaceFeatureDetector_Impl CV_FINAL : public HarrisLaplaceFeatureDetector { public: HarrisLaplaceFeatureDetector_Impl( @@ -325,11 +325,11 @@ public: int maxCorners=5000, int num_layers=4 ); - virtual void read( const FileNode& fn ); - virtual void write( FileStorage& fs ) const; + virtual void read( const FileNode& fn ) CV_OVERRIDE; + virtual void write( FileStorage& fs ) const CV_OVERRIDE; protected: - void detect( InputArray image, std::vector& keypoints, InputArray mask=noArray() ); + void detect( InputArray image, std::vector& keypoints, InputArray mask=noArray() ) CV_OVERRIDE; int numOctaves; float corn_thresh; diff --git a/modules/xfeatures2d/src/latch.cpp b/modules/xfeatures2d/src/latch.cpp index 8a255ed0a..b80e7bc22 100644 --- a/modules/xfeatures2d/src/latch.cpp +++ b/modules/xfeatures2d/src/latch.cpp @@ -58,21 +58,21 @@ namespace cv /* * LATCH Descriptor */ - class LATCHDescriptorExtractorImpl : public LATCH + class LATCHDescriptorExtractorImpl CV_FINAL : public LATCH { public: enum { PATCH_SIZE = 48 }; LATCHDescriptorExtractorImpl(int bytes = 32, bool rotationInvariance = true, int half_ssd_size = 3, double sigma = 2.0); - virtual void read( const FileNode& ); - virtual void write( FileStorage& ) const; + virtual void read( const FileNode& ) CV_OVERRIDE; + virtual void write( FileStorage& ) const CV_OVERRIDE; - virtual int descriptorSize() const; - virtual int descriptorType() const; - virtual int defaultNorm() const; + virtual int descriptorSize() const CV_OVERRIDE; + virtual int descriptorType() const CV_OVERRIDE; + virtual int defaultNorm() const CV_OVERRIDE; - virtual void compute(InputArray image, std::vector& keypoints, OutputArray descriptors); + virtual void compute(InputArray image, std::vector& keypoints, OutputArray descriptors) CV_OVERRIDE; protected: typedef void(*PixelTestFn)(const Mat& input_image, const std::vector& keypoints, OutputArray, const std::vector &points, bool rotationInvariance, int half_ssd_size); diff --git a/modules/xfeatures2d/src/lucid.cpp b/modules/xfeatures2d/src/lucid.cpp index dcebfc053..51d468dc6 100644 --- a/modules/xfeatures2d/src/lucid.cpp +++ b/modules/xfeatures2d/src/lucid.cpp @@ -62,15 +62,15 @@ namespace cv { LUCIDImpl(const int lucid_kernel = 1, const int blur_kernel = 2); /** returns the descriptor length */ - virtual int descriptorSize() const; + virtual int descriptorSize() const CV_OVERRIDE; /** returns the descriptor type */ - virtual int descriptorType() const; + virtual int descriptorType() const CV_OVERRIDE; /** returns the default norm type */ - virtual int defaultNorm() const; + virtual int defaultNorm() const CV_OVERRIDE; - virtual void compute(InputArray _src, std::vector &keypoints, OutputArray _desc); + virtual void compute(InputArray _src, std::vector &keypoints, OutputArray _desc) CV_OVERRIDE; protected: int l_kernel, b_kernel; diff --git a/modules/xfeatures2d/src/msd.cpp b/modules/xfeatures2d/src/msd.cpp index eff5b0550..637d992cb 100644 --- a/modules/xfeatures2d/src/msd.cpp +++ b/modules/xfeatures2d/src/msd.cpp @@ -78,7 +78,7 @@ namespace cv } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { for (int lvl = range.start; lvl < range.end; lvl++) { @@ -152,7 +152,7 @@ namespace cv remains = w - chunkSize*split; } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { for (int i = range.start; i < range.end; i++) { @@ -199,7 +199,7 @@ namespace cv { } - void detect(InputArray _image, std::vector& keypoints, InputArray _mask) + void detect(InputArray _image, std::vector& keypoints, InputArray _mask) CV_OVERRIDE { m_mask = _mask.getMat(); diff --git a/modules/xfeatures2d/src/pct_signatures.cpp b/modules/xfeatures2d/src/pct_signatures.cpp index 357c62d41..a5afe7857 100644 --- a/modules/xfeatures2d/src/pct_signatures.cpp +++ b/modules/xfeatures2d/src/pct_signatures.cpp @@ -49,7 +49,7 @@ Contributed by Gregor Kovalcik References: Martin Krulis, Jakub Lokoc, Tomas Skopal. Efficient Extraction of Clustering-Based Feature Signatures Using GPU Architectures. - Multimedia tools and applications, 75(13), pp.: 8071–8103, Springer, ISSN: 1380-7501, 2016 + Multimedia tools and applications, 75(13), pp.: 8071�8103, Springer, ISSN: 1380-7501, 2016 Christian Beecks, Merih Seran Uysal, Thomas Seidl. Signature quadratic form distance. @@ -121,66 +121,66 @@ namespace cv mClusterizer = PCTClusterizer::create(initClusterSeedIndexes); } - void computeSignature(InputArray image, OutputArray signature) const; + void computeSignature(InputArray image, OutputArray signature) const CV_OVERRIDE; - void computeSignatures(const std::vector& images, std::vector& signatures) const; + void computeSignatures(const std::vector& images, std::vector& signatures) const CV_OVERRIDE; void getGrayscaleBitmap(OutputArray _grayscaleBitmap, bool normalize) const; /**** sampler ****/ - int getSampleCount() const { return mSampler->getGrayscaleBits(); } - int getGrayscaleBits() const { return mSampler->getGrayscaleBits(); } - int getWindowRadius() const { return mSampler->getWindowRadius(); } - float getWeightX() const { return mSampler->getWeightX(); } - float getWeightY() const { return mSampler->getWeightY(); } - float getWeightL() const { return mSampler->getWeightL(); } - float getWeightA() const { return mSampler->getWeightA(); } - float getWeightB() const { return mSampler->getWeightB(); } - float getWeightContrast() const { return mSampler->getWeightContrast(); } - float getWeightEntropy() const { return mSampler->getWeightEntropy(); } + int getSampleCount() const CV_OVERRIDE { return mSampler->getGrayscaleBits(); } + int getGrayscaleBits() const CV_OVERRIDE { return mSampler->getGrayscaleBits(); } + int getWindowRadius() const CV_OVERRIDE { return mSampler->getWindowRadius(); } + float getWeightX() const CV_OVERRIDE { return mSampler->getWeightX(); } + float getWeightY() const CV_OVERRIDE { return mSampler->getWeightY(); } + float getWeightL() const CV_OVERRIDE { return mSampler->getWeightL(); } + float getWeightA() const CV_OVERRIDE { return mSampler->getWeightA(); } + float getWeightB() const CV_OVERRIDE { return mSampler->getWeightB(); } + float getWeightContrast() const CV_OVERRIDE { return mSampler->getWeightContrast(); } + float getWeightEntropy() const CV_OVERRIDE { return mSampler->getWeightEntropy(); } - std::vector getSamplingPoints() const { return mSampler->getSamplingPoints(); } + std::vector getSamplingPoints() const CV_OVERRIDE { return mSampler->getSamplingPoints(); } - void setGrayscaleBits(int grayscaleBits) { mSampler->setGrayscaleBits(grayscaleBits); } - void setWindowRadius(int windowRadius) { mSampler->setWindowRadius(windowRadius); } - void setWeightX(float weight) { mSampler->setWeightX(weight); } - void setWeightY(float weight) { mSampler->setWeightY(weight); } - void setWeightL(float weight) { mSampler->setWeightL(weight); } - void setWeightA(float weight) { mSampler->setWeightA(weight); } - void setWeightB(float weight) { mSampler->setWeightB(weight); } - void setWeightContrast(float weight) { mSampler->setWeightContrast(weight); } - void setWeightEntropy(float weight) { mSampler->setWeightEntropy(weight); } + void setGrayscaleBits(int grayscaleBits) CV_OVERRIDE { mSampler->setGrayscaleBits(grayscaleBits); } + void setWindowRadius(int windowRadius) CV_OVERRIDE { mSampler->setWindowRadius(windowRadius); } + void setWeightX(float weight) CV_OVERRIDE { mSampler->setWeightX(weight); } + void setWeightY(float weight) CV_OVERRIDE { mSampler->setWeightY(weight); } + void setWeightL(float weight) CV_OVERRIDE { mSampler->setWeightL(weight); } + void setWeightA(float weight) CV_OVERRIDE { mSampler->setWeightA(weight); } + void setWeightB(float weight) CV_OVERRIDE { mSampler->setWeightB(weight); } + void setWeightContrast(float weight) CV_OVERRIDE { mSampler->setWeightContrast(weight); } + void setWeightEntropy(float weight) CV_OVERRIDE { mSampler->setWeightEntropy(weight); } - void setWeight(int idx, float value) { mSampler->setWeight(idx, value); } - void setWeights(const std::vector& weights) { mSampler->setWeights(weights); } - void setTranslation(int idx, float value) { mSampler->setTranslation(idx, value); } - void setTranslations(const std::vector& translations) { mSampler->setTranslations(translations); } + void setWeight(int idx, float value) CV_OVERRIDE { mSampler->setWeight(idx, value); } + void setWeights(const std::vector& weights) CV_OVERRIDE { mSampler->setWeights(weights); } + void setTranslation(int idx, float value) CV_OVERRIDE { mSampler->setTranslation(idx, value); } + void setTranslations(const std::vector& translations) CV_OVERRIDE { mSampler->setTranslations(translations); } - void setSamplingPoints(std::vector samplingPoints) { mSampler->setSamplingPoints(samplingPoints); } + void setSamplingPoints(std::vector samplingPoints) CV_OVERRIDE { mSampler->setSamplingPoints(samplingPoints); } /**** clusterizer ****/ - int getIterationCount() const { return mClusterizer->getIterationCount(); } - std::vector getInitSeedIndexes() const { return mClusterizer->getInitSeedIndexes(); } - int getInitSeedCount() const { return (int)mClusterizer->getInitSeedIndexes().size(); } - int getMaxClustersCount() const { return mClusterizer->getMaxClustersCount(); } - int getClusterMinSize() const { return mClusterizer->getClusterMinSize(); } - float getJoiningDistance() const { return mClusterizer->getJoiningDistance(); } - float getDropThreshold() const { return mClusterizer->getDropThreshold(); } - int getDistanceFunction() const + int getIterationCount() const CV_OVERRIDE { return mClusterizer->getIterationCount(); } + std::vector getInitSeedIndexes() const CV_OVERRIDE { return mClusterizer->getInitSeedIndexes(); } + int getInitSeedCount() const CV_OVERRIDE { return (int)mClusterizer->getInitSeedIndexes().size(); } + int getMaxClustersCount() const CV_OVERRIDE { return mClusterizer->getMaxClustersCount(); } + int getClusterMinSize() const CV_OVERRIDE { return mClusterizer->getClusterMinSize(); } + float getJoiningDistance() const CV_OVERRIDE { return mClusterizer->getJoiningDistance(); } + float getDropThreshold() const CV_OVERRIDE { return mClusterizer->getDropThreshold(); } + int getDistanceFunction() const CV_OVERRIDE { return mClusterizer->getDistanceFunction(); } - void setIterationCount(int iterations) { mClusterizer->setIterationCount(iterations); } - void setInitSeedIndexes(std::vector initSeedIndexes) + void setIterationCount(int iterations) CV_OVERRIDE { mClusterizer->setIterationCount(iterations); } + void setInitSeedIndexes(std::vector initSeedIndexes) CV_OVERRIDE { mClusterizer->setInitSeedIndexes(initSeedIndexes); } - void setMaxClustersCount(int maxClusters) { mClusterizer->setMaxClustersCount(maxClusters); } - void setClusterMinSize(int clusterMinSize) { mClusterizer->setClusterMinSize(clusterMinSize); } - void setJoiningDistance(float joiningDistance) { mClusterizer->setJoiningDistance(joiningDistance); } - void setDropThreshold(float dropThreshold) { mClusterizer->setDropThreshold(dropThreshold); } - void setDistanceFunction(int distanceFunction) + void setMaxClustersCount(int maxClusters) CV_OVERRIDE { mClusterizer->setMaxClustersCount(maxClusters); } + void setClusterMinSize(int clusterMinSize) CV_OVERRIDE { mClusterizer->setClusterMinSize(clusterMinSize); } + void setJoiningDistance(float joiningDistance) CV_OVERRIDE { mClusterizer->setJoiningDistance(joiningDistance); } + void setDropThreshold(float dropThreshold) CV_OVERRIDE { mClusterizer->setDropThreshold(dropThreshold); } + void setDistanceFunction(int distanceFunction) CV_OVERRIDE { mClusterizer->setDistanceFunction(distanceFunction); } private: @@ -236,7 +236,7 @@ namespace cv mSignatures->resize(images->size()); } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { for (int i = range.start; i < range.end; i++) { diff --git a/modules/xfeatures2d/src/pct_signatures/pct_clusterizer.cpp b/modules/xfeatures2d/src/pct_signatures/pct_clusterizer.cpp index acbd0205d..f02a23954 100644 --- a/modules/xfeatures2d/src/pct_signatures/pct_clusterizer.cpp +++ b/modules/xfeatures2d/src/pct_signatures/pct_clusterizer.cpp @@ -49,7 +49,7 @@ Contributed by Gregor Kovalcik References: Martin Krulis, Jakub Lokoc, Tomas Skopal. Efficient Extraction of Clustering-Based Feature Signatures Using GPU Architectures. - Multimedia tools and applications, 75(13), pp.: 8071–8103, Springer, ISSN: 1380-7501, 2016 + Multimedia tools and applications, 75(13), pp.: 8071�8103, Springer, ISSN: 1380-7501, 2016 Christian Beecks, Merih Seran Uysal, Thomas Seidl. Signature quadratic form distance. @@ -68,7 +68,7 @@ namespace cv { namespace pct_signatures { - class PCTClusterizer_Impl : public PCTClusterizer + class PCTClusterizer_Impl CV_FINAL : public PCTClusterizer { public: @@ -95,21 +95,21 @@ namespace cv } - int getIterationCount() const { return mIterationCount; } - std::vector getInitSeedIndexes() const { return mInitSeedIndexes; } - int getMaxClustersCount() const { return mMaxClustersCount; } - int getClusterMinSize() const { return mClusterMinSize; } - float getJoiningDistance() const { return mJoiningDistance; } - float getDropThreshold() const { return mDropThreshold; } - int getDistanceFunction() const { return mDistanceFunction; } + int getIterationCount() const CV_OVERRIDE { return mIterationCount; } + std::vector getInitSeedIndexes() const CV_OVERRIDE { return mInitSeedIndexes; } + int getMaxClustersCount() const CV_OVERRIDE { return mMaxClustersCount; } + int getClusterMinSize() const CV_OVERRIDE { return mClusterMinSize; } + float getJoiningDistance() const CV_OVERRIDE { return mJoiningDistance; } + float getDropThreshold() const CV_OVERRIDE { return mDropThreshold; } + int getDistanceFunction() const CV_OVERRIDE { return mDistanceFunction; } - void setIterationCount(int iterationCount) { mIterationCount = iterationCount; } - void setInitSeedIndexes(std::vector initSeedIndexes) { mInitSeedIndexes = initSeedIndexes; } - void setMaxClustersCount(int maxClustersCount) { mMaxClustersCount = maxClustersCount; } - void setClusterMinSize(int clusterMinSize) { mClusterMinSize = clusterMinSize; } - void setJoiningDistance(float joiningDistance) { mJoiningDistance = joiningDistance; } - void setDropThreshold(float dropThreshold) { mDropThreshold = dropThreshold; } - void setDistanceFunction(int distanceFunction) { mDistanceFunction = distanceFunction; } + void setIterationCount(int iterationCount) CV_OVERRIDE { mIterationCount = iterationCount; } + void setInitSeedIndexes(std::vector initSeedIndexes) CV_OVERRIDE { mInitSeedIndexes = initSeedIndexes; } + void setMaxClustersCount(int maxClustersCount) CV_OVERRIDE { mMaxClustersCount = maxClustersCount; } + void setClusterMinSize(int clusterMinSize) CV_OVERRIDE { mClusterMinSize = clusterMinSize; } + void setJoiningDistance(float joiningDistance) CV_OVERRIDE { mJoiningDistance = joiningDistance; } + void setDropThreshold(float dropThreshold) CV_OVERRIDE { mDropThreshold = dropThreshold; } + void setDistanceFunction(int distanceFunction) CV_OVERRIDE { mDistanceFunction = distanceFunction; } /** @@ -117,7 +117,7 @@ namespace cv * @param samples List of sampled points. * @param signature Output list of computed centroids - the signature of the image. */ - void clusterize(InputArray _samples, OutputArray _signature) + void clusterize(InputArray _samples, OutputArray _signature) CV_OVERRIDE { CV_Assert(!_samples.empty()); diff --git a/modules/xfeatures2d/src/pct_signatures/pct_sampler.cpp b/modules/xfeatures2d/src/pct_signatures/pct_sampler.cpp index bc4701694..11343bcb5 100644 --- a/modules/xfeatures2d/src/pct_signatures/pct_sampler.cpp +++ b/modules/xfeatures2d/src/pct_signatures/pct_sampler.cpp @@ -49,7 +49,7 @@ Contributed by Gregor Kovalcik References: Martin Krulis, Jakub Lokoc, Tomas Skopal. Efficient Extraction of Clustering-Based Feature Signatures Using GPU Architectures. - Multimedia tools and applications, 75(13), pp.: 8071–8103, Springer, ISSN: 1380-7501, 2016 + Multimedia tools and applications, 75(13), pp.: 8071�8103, Springer, ISSN: 1380-7501, 2016 Christian Beecks, Merih Seran Uysal, Thomas Seidl. Signature quadratic form distance. @@ -67,7 +67,7 @@ namespace cv { namespace pct_signatures { - class PCTSampler_Impl : public PCTSampler + class PCTSampler_Impl CV_FINAL : public PCTSampler { private: /** @@ -119,40 +119,40 @@ namespace cv /**** Acessors ****/ - int getSampleCount() const { return (int)mInitSamplingPoints.size(); } - int getGrayscaleBits() const { return mGrayscaleBits; } - int getWindowRadius() const { return mWindowRadius; } + int getSampleCount() const CV_OVERRIDE { return (int)mInitSamplingPoints.size(); } + int getGrayscaleBits() const CV_OVERRIDE { return mGrayscaleBits; } + int getWindowRadius() const CV_OVERRIDE { return mWindowRadius; } - float getWeightX() const { return mWeights[X_IDX]; } - float getWeightY() const { return mWeights[Y_IDX]; } - float getWeightL() const { return mWeights[L_IDX]; } - float getWeightA() const { return mWeights[A_IDX]; } - float getWeightB() const { return mWeights[B_IDX]; } - float getWeightContrast() const { return mWeights[CONTRAST_IDX]; } - float getWeightEntropy() const { return mWeights[ENTROPY_IDX]; } + float getWeightX() const CV_OVERRIDE { return mWeights[X_IDX]; } + float getWeightY() const CV_OVERRIDE { return mWeights[Y_IDX]; } + float getWeightL() const CV_OVERRIDE { return mWeights[L_IDX]; } + float getWeightA() const CV_OVERRIDE { return mWeights[A_IDX]; } + float getWeightB() const CV_OVERRIDE { return mWeights[B_IDX]; } + float getWeightContrast() const CV_OVERRIDE { return mWeights[CONTRAST_IDX]; } + float getWeightEntropy() const CV_OVERRIDE { return mWeights[ENTROPY_IDX]; } - std::vector getSamplingPoints() const + std::vector getSamplingPoints() const CV_OVERRIDE { return mInitSamplingPoints; } - void setGrayscaleBits(int grayscaleBits) { mGrayscaleBits = grayscaleBits; } - void setWindowRadius(int windowRadius) { mWindowRadius = windowRadius; } + void setGrayscaleBits(int grayscaleBits) CV_OVERRIDE { mGrayscaleBits = grayscaleBits; } + void setWindowRadius(int windowRadius) CV_OVERRIDE { mWindowRadius = windowRadius; } - void setWeightX(float weight) { mWeights[X_IDX] = weight; } - void setWeightY(float weight) { mWeights[Y_IDX] = weight; } - void setWeightL(float weight) { mWeights[L_IDX] = weight; } - void setWeightA(float weight) { mWeights[A_IDX] = weight; } - void setWeightB(float weight) { mWeights[B_IDX] = weight; } - void setWeightContrast(float weight) { mWeights[CONTRAST_IDX] = weight; } - void setWeightEntropy(float weight) { mWeights[ENTROPY_IDX] = weight; } + void setWeightX(float weight) CV_OVERRIDE { mWeights[X_IDX] = weight; } + void setWeightY(float weight) CV_OVERRIDE { mWeights[Y_IDX] = weight; } + void setWeightL(float weight) CV_OVERRIDE { mWeights[L_IDX] = weight; } + void setWeightA(float weight) CV_OVERRIDE { mWeights[A_IDX] = weight; } + void setWeightB(float weight) CV_OVERRIDE { mWeights[B_IDX] = weight; } + void setWeightContrast(float weight) CV_OVERRIDE { mWeights[CONTRAST_IDX] = weight; } + void setWeightEntropy(float weight) CV_OVERRIDE { mWeights[ENTROPY_IDX] = weight; } - void setWeight(int idx, float value) + void setWeight(int idx, float value) CV_OVERRIDE { mWeights[idx] = value; } - void setWeights(const std::vector& weights) + void setWeights(const std::vector& weights) CV_OVERRIDE { if (weights.size() != mWeights.size()) { @@ -168,12 +168,12 @@ namespace cv } } - void setTranslation(int idx, float value) + void setTranslation(int idx, float value) CV_OVERRIDE { mTranslations[idx] = value; } - void setTranslations(const std::vector& translations) + void setTranslations(const std::vector& translations) CV_OVERRIDE { if (translations.size() != mTranslations.size()) { @@ -189,10 +189,10 @@ namespace cv } } - void setSamplingPoints(std::vector samplingPoints) { mInitSamplingPoints = samplingPoints; } + void setSamplingPoints(std::vector samplingPoints) CV_OVERRIDE { mInitSamplingPoints = samplingPoints; } - void sample(InputArray _image, OutputArray _samples) const + void sample(InputArray _image, OutputArray _samples) const CV_OVERRIDE { // prepare matrices Mat image = _image.getMat(); diff --git a/modules/xfeatures2d/src/pct_signatures_sqfd.cpp b/modules/xfeatures2d/src/pct_signatures_sqfd.cpp index 602e8aa1d..daf21b6cc 100644 --- a/modules/xfeatures2d/src/pct_signatures_sqfd.cpp +++ b/modules/xfeatures2d/src/pct_signatures_sqfd.cpp @@ -49,7 +49,7 @@ Contributed by Gregor Kovalcik References: Martin Krulis, Jakub Lokoc, Tomas Skopal. Efficient Extraction of Clustering-Based Feature Signatures Using GPU Architectures. - Multimedia tools and applications, 75(13), pp.: 8071–8103, Springer, ISSN: 1380-7501, 2016 + Multimedia tools and applications, 75(13), pp.: 8071�8103, Springer, ISSN: 1380-7501, 2016 Christian Beecks, Merih Seran Uysal, Thomas Seidl. Signature quadratic form distance. @@ -84,12 +84,12 @@ namespace cv float computeQuadraticFormDistance( InputArray _signature0, - InputArray _signature1) const; + InputArray _signature1) const CV_OVERRIDE; void computeQuadraticFormDistances( const Mat& sourceSignature, const std::vector& imageSignatures, - std::vector& distances) const; + std::vector& distances) const CV_OVERRIDE; private: @@ -129,7 +129,7 @@ namespace cv mDistances->resize(imageSignatures->size()); } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { if (mSourceSignature->empty()) { diff --git a/modules/xfeatures2d/src/sift.cpp b/modules/xfeatures2d/src/sift.cpp index 2994221f0..b2ab2b88f 100644 --- a/modules/xfeatures2d/src/sift.cpp +++ b/modules/xfeatures2d/src/sift.cpp @@ -125,20 +125,20 @@ public: double sigma = 1.6); //! returns the descriptor size in floats (128) - int descriptorSize() const; + int descriptorSize() const CV_OVERRIDE; //! returns the descriptor type - int descriptorType() const; + int descriptorType() const CV_OVERRIDE; //! returns the default norm type - int defaultNorm() const; + int defaultNorm() const CV_OVERRIDE; //! finds the keypoints and computes descriptors for them using SIFT algorithm. //! Optionally it can compute descriptors for the user-provided keypoints void detectAndCompute(InputArray img, InputArray mask, std::vector& keypoints, OutputArray descriptors, - bool useProvidedKeypoints = false); + bool useProvidedKeypoints = false) CV_OVERRIDE; void buildGaussianPyramid( const Mat& base, std::vector& pyr, int nOctaves ) const; void buildDoGPyramid( const std::vector& pyr, std::vector& dogpyr ) const; @@ -302,7 +302,7 @@ public: gpyr(_gpyr), dogpyr(_dogpyr) { } - void operator()( const cv::Range& range ) const + void operator()( const cv::Range& range ) const CV_OVERRIDE { const int begin = range.start; const int end = range.end; @@ -605,7 +605,7 @@ public: gauss_pyr(_gauss_pyr), dog_pyr(_dog_pyr), tls_kpts_struct(_tls_kpts_struct) { } - void operator()( const cv::Range& range ) const + void operator()( const cv::Range& range ) const CV_OVERRIDE { const int begin = range.start; const int end = range.end; @@ -1046,7 +1046,7 @@ public: nOctaveLayers(_nOctaveLayers), firstOctave(_firstOctave) { } - void operator()( const cv::Range& range ) const + void operator()( const cv::Range& range ) const CV_OVERRIDE { const int begin = range.start; const int end = range.end; diff --git a/modules/xfeatures2d/src/stardetector.cpp b/modules/xfeatures2d/src/stardetector.cpp index 13d80de09..b15ccc3ce 100644 --- a/modules/xfeatures2d/src/stardetector.cpp +++ b/modules/xfeatures2d/src/stardetector.cpp @@ -60,7 +60,7 @@ public: int _lineThresholdBinarized=8, int _suppressNonmaxSize=5); - void detect( InputArray image, std::vector& keypoints, InputArray mask=noArray() ); + void detect( InputArray image, std::vector& keypoints, InputArray mask=noArray() ) CV_OVERRIDE; protected: int maxSize; diff --git a/modules/xfeatures2d/src/surf.cpp b/modules/xfeatures2d/src/surf.cpp index 6839fd615..d4e16e474 100644 --- a/modules/xfeatures2d/src/surf.cpp +++ b/modules/xfeatures2d/src/surf.cpp @@ -274,7 +274,7 @@ struct SURFBuildInvoker : ParallelLoopBody traces = &_traces; } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { for( int i=range.start; i& sizes, std::vector& keypoints, int octave, int layer, float hessianThreshold, int sampleStep ); - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { for( int i=range.start; i SURF::create(double _threshold, int _nOctaves, int _nOctaveLayers, boo { return makePtr(_threshold, _nOctaves, _nOctaveLayers, _extended, _upright); } - + } } diff --git a/modules/xfeatures2d/src/surf.hpp b/modules/xfeatures2d/src/surf.hpp index cf3fda16b..b507d8f87 100644 --- a/modules/xfeatures2d/src/surf.hpp +++ b/modules/xfeatures2d/src/surf.hpp @@ -24,13 +24,13 @@ public: bool extended = true, bool upright = false); //! returns the descriptor size in float's (64 or 128) - CV_WRAP int descriptorSize() const; + CV_WRAP int descriptorSize() const CV_OVERRIDE; //! returns the descriptor type - CV_WRAP int descriptorType() const; + CV_WRAP int descriptorType() const CV_OVERRIDE; //! returns the descriptor type - CV_WRAP int defaultNorm() const; + CV_WRAP int defaultNorm() const CV_OVERRIDE; void set(int, double); double get(int) const; @@ -40,22 +40,22 @@ public: void detectAndCompute(InputArray img, InputArray mask, CV_OUT std::vector& keypoints, OutputArray descriptors, - bool useProvidedKeypoints = false); + bool useProvidedKeypoints = false) CV_OVERRIDE; - void setHessianThreshold(double hessianThreshold_) { hessianThreshold = hessianThreshold_; } - double getHessianThreshold() const { return hessianThreshold; } + void setHessianThreshold(double hessianThreshold_) CV_OVERRIDE { hessianThreshold = hessianThreshold_; } + double getHessianThreshold() const CV_OVERRIDE { return hessianThreshold; } - void setNOctaves(int nOctaves_) { nOctaves = nOctaves_; } - int getNOctaves() const { return nOctaves; } + void setNOctaves(int nOctaves_) CV_OVERRIDE { nOctaves = nOctaves_; } + int getNOctaves() const CV_OVERRIDE { return nOctaves; } - void setNOctaveLayers(int nOctaveLayers_) { nOctaveLayers = nOctaveLayers_; } - int getNOctaveLayers() const { return nOctaveLayers; } + void setNOctaveLayers(int nOctaveLayers_) CV_OVERRIDE { nOctaveLayers = nOctaveLayers_; } + int getNOctaveLayers() const CV_OVERRIDE { return nOctaveLayers; } - void setExtended(bool extended_) { extended = extended_; } - bool getExtended() const { return extended; } + void setExtended(bool extended_) CV_OVERRIDE { extended = extended_; } + bool getExtended() const CV_OVERRIDE { return extended; } - void setUpright(bool upright_) { upright = upright_; } - bool getUpright() const { return upright; } + void setUpright(bool upright_) CV_OVERRIDE { upright = upright_; } + bool getUpright() const CV_OVERRIDE { return upright; } double hessianThreshold; int nOctaves; diff --git a/modules/xfeatures2d/src/vgg.cpp b/modules/xfeatures2d/src/vgg.cpp index b67979dff..a187f6b1d 100644 --- a/modules/xfeatures2d/src/vgg.cpp +++ b/modules/xfeatures2d/src/vgg.cpp @@ -69,7 +69,7 @@ namespace xfeatures2d /* !VGG implementation */ -class VGG_Impl : public VGG +class VGG_Impl CV_FINAL : public VGG { public: @@ -80,35 +80,35 @@ public: float scale_factor = 6.25f, bool dsc_normalize = false ); // destructor - virtual ~VGG_Impl(); + virtual ~VGG_Impl() CV_OVERRIDE; // returns the descriptor length in bytes - virtual int descriptorSize() const { return m_descriptor_size; } + virtual int descriptorSize() const CV_OVERRIDE { return m_descriptor_size; } // returns the descriptor type - virtual int descriptorType() const { return CV_32F; } + virtual int descriptorType() const CV_OVERRIDE { return CV_32F; } // returns the default norm type - virtual int defaultNorm() const { return NORM_L2; } + virtual int defaultNorm() const CV_OVERRIDE { return NORM_L2; } // compute descriptors given keypoints - virtual void compute( InputArray image, vector& keypoints, OutputArray descriptors ); + virtual void compute( InputArray image, vector& keypoints, OutputArray descriptors ) CV_OVERRIDE; // getter / setter - virtual void setSigma(const float isigma) { m_isigma = isigma; } - virtual float getSigma() const { return m_isigma; } + virtual void setSigma(const float isigma) CV_OVERRIDE { m_isigma = isigma; } + virtual float getSigma() const CV_OVERRIDE { return m_isigma; } - virtual void setUseNormalizeImage(const bool img_normalize) { m_img_normalize = img_normalize; } - virtual bool getUseNormalizeImage() const { return m_img_normalize; } + virtual void setUseNormalizeImage(const bool img_normalize) CV_OVERRIDE { m_img_normalize = img_normalize; } + virtual bool getUseNormalizeImage() const CV_OVERRIDE { return m_img_normalize; } - virtual void setUseScaleOrientation(const bool use_scale_orientation) { m_use_scale_orientation = use_scale_orientation; } - virtual bool getUseScaleOrientation() const { return m_use_scale_orientation; } + virtual void setUseScaleOrientation(const bool use_scale_orientation) CV_OVERRIDE { m_use_scale_orientation = use_scale_orientation; } + virtual bool getUseScaleOrientation() const CV_OVERRIDE { return m_use_scale_orientation; } - virtual void setScaleFactor(const float scale_factor) { m_scale_factor = scale_factor; } - virtual float getScaleFactor() const { return m_scale_factor; } + virtual void setScaleFactor(const float scale_factor) CV_OVERRIDE { m_scale_factor = scale_factor; } + virtual float getScaleFactor() const CV_OVERRIDE { return m_scale_factor; } - virtual void setUseNormalizeDescriptor(const bool dsc_normalize) { m_dsc_normalize = dsc_normalize; } - virtual bool getUseNormalizeDescriptor() const { return m_dsc_normalize; } + virtual void setUseNormalizeDescriptor(const bool dsc_normalize) CV_OVERRIDE { m_dsc_normalize = dsc_normalize; } + virtual bool getUseNormalizeDescriptor() const CV_OVERRIDE { return m_dsc_normalize; } protected: @@ -352,7 +352,7 @@ struct ComputeVGGInvoker : ParallelLoopBody use_scale_orientation = _use_scale_orientation; } - void operator ()(const cv::Range& range) const + void operator ()(const cv::Range& range) const CV_OVERRIDE { Mat Desc, PatchTrans; Mat Patch( 64, 64, CV_32F ); diff --git a/modules/ximgproc/src/adaptive_manifold_filter_n.cpp b/modules/ximgproc/src/adaptive_manifold_filter_n.cpp index 89a5325c7..3aa58cafe 100644 --- a/modules/ximgproc/src/adaptive_manifold_filter_n.cpp +++ b/modules/ximgproc/src/adaptive_manifold_filter_n.cpp @@ -2,26 +2,26 @@ * By downloading, copying, installing or using the software you agree to this license. * If you do not agree to this license, do not download, install, * copy or use the software. - * - * + * + * * License Agreement * For Open Source Computer Vision Library * (3 - clause BSD License) - * + * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met : - * + * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and / or other materials provided with the distribution. - * + * * * Neither the names of the copyright holders nor the names of the contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * This software is provided by the copyright holders and contributors "as is" and * any express or implied warranties, including, but not limited to, the implied * warranties of merchantability and fitness for a particular purpose are disclaimed. @@ -109,16 +109,22 @@ class AdaptiveManifoldFilterN : public AdaptiveManifoldFilter public: AdaptiveManifoldFilterN(); - void filter(InputArray src, OutputArray dst, InputArray joint); + void filter(InputArray src, OutputArray dst, InputArray joint) CV_OVERRIDE; - void collectGarbage(); + void collectGarbage() CV_OVERRIDE; - CV_IMPL_PROPERTY(double, SigmaS, sigma_s_) - CV_IMPL_PROPERTY(double, SigmaR, sigma_r_) - CV_IMPL_PROPERTY(int, TreeHeight, tree_height_) - CV_IMPL_PROPERTY(int, PCAIterations, num_pca_iterations_) - CV_IMPL_PROPERTY(bool, AdjustOutliers, adjust_outliers_) - CV_IMPL_PROPERTY(bool, UseRNG, useRNG) + inline double getSigmaS() const CV_OVERRIDE { return sigma_s_; } + inline void setSigmaS(double val) CV_OVERRIDE { sigma_s_ = val; } + inline double getSigmaR() const CV_OVERRIDE { return sigma_r_; } + inline void setSigmaR(double val) CV_OVERRIDE { sigma_r_ = val; } + inline int getTreeHeight() const CV_OVERRIDE { return tree_height_; } + inline void setTreeHeight(int val) CV_OVERRIDE { tree_height_ = val; } + inline int getPCAIterations() const CV_OVERRIDE { return num_pca_iterations_; } + inline void setPCAIterations(int val) CV_OVERRIDE { num_pca_iterations_ = val; } + inline bool getAdjustOutliers() const CV_OVERRIDE { return adjust_outliers_; } + inline void setAdjustOutliers(bool val) CV_OVERRIDE { adjust_outliers_ = val; } + inline bool getUseRNG() const CV_OVERRIDE { return useRNG; } + inline void setUseRNG(bool val) CV_OVERRIDE { useRNG = val; } protected: @@ -130,7 +136,7 @@ protected: bool useRNG; private: - + Size srcSize; Size smallSize; int jointCnNum; @@ -142,14 +148,14 @@ private: vector etaFull; vector sum_w_ki_Psi_blur_; - Mat sum_w_ki_Psi_blur_0_; - + Mat sum_w_ki_Psi_blur_0_; + Mat w_k; Mat Psi_splat_0_small; vector Psi_splat_small; Mat1f minDistToManifoldSquared; - + int curTreeHeight; float sigma_r_over_sqrt_2; @@ -256,8 +262,8 @@ private: /*Parallelization routines*/ MapFunc transform; const vector& srcv; vector& dstv; - - void operator () (const Range& range) const + + void operator () (const Range& range) const CV_OVERRIDE { for (int i = range.start; i < range.end; i++) (instancePtr->*transform)(srcv[i], dstv[i]); @@ -299,7 +305,7 @@ void AdaptiveManifoldFilterN::initBuffers(InputArray src_, InputArray joint_) sum_w_ki_Psi_blur_0_ = Mat::zeros(srcSize, CV_32FC1); w_k.create(srcSize, CV_32FC1); Psi_splat_0_small.create(smallSize, CV_32FC1); - + if (adjust_outliers_) minDistToManifoldSquared.create(srcSize); } @@ -335,7 +341,7 @@ void AdaptiveManifoldFilterN::initSrcAndJoint(InputArray src_, InputArray joint_ else { splitChannels(joint_, jointCn); - + jointCnNum = (int)jointCn.size(); int jointDepth = jointCn[0].depth(); Size jointSize = jointCn[0].size(); @@ -364,7 +370,7 @@ void AdaptiveManifoldFilterN::filter(InputArray src, OutputArray dst, InputArray const double seedCoef = jointCn[0].at(srcSize.height/2, srcSize.width/2); const uint64 baseCoef = numeric_limits::max() / 0xFFFF; rnd.state = static_cast(baseCoef*seedCoef); - + Mat1b cluster0(srcSize, 0xFF); vector eta0(jointCnNum); for (int i = 0; i < jointCnNum; i++) @@ -431,7 +437,7 @@ void AdaptiveManifoldFilterN::buildManifoldsAndPerformFiltering(vector& eta upsample(eta, etaFull); compute_w_k(etaFull, w_k, sigma_r_over_sqrt_2, treeLevel); } - + //blurring Psi_splat_small.resize(srcCnNum); for (int si = 0; si < srcCnNum; si++) @@ -611,13 +617,13 @@ void AdaptiveManifoldFilterN::computeDTHor(vector& srcCn, Mat& dst, float s else add_sqr_dif(dstRow, curCnRow, curCnRow + 1, w - 1); } - + mad(dstRow, dstRow, sigmaRatioSqr, 1.0f, w - 1); sqrt_(dstRow, dstRow, w - 1); mul(dstRow, dstRow, lnAlpha, w - 1); //Exp_32f(dstRow, dstRow, w - 1); } - + cv::exp(dst, dst); } @@ -680,7 +686,7 @@ void AdaptiveManifoldFilterN::RFFilterPass(vector& joint, vector& Psi_ void AdaptiveManifoldFilterN::computeClusters(Mat1b& cluster, Mat1b& cluster_minus, Mat1b& cluster_plus) { - + Mat1f difOreientation; if (jointCnNum > 1) { @@ -723,7 +729,7 @@ void AdaptiveManifoldFilterN::computeEta(Mat& teta, Mat1b& cluster, vector& Mat1f tetaMasked = Mat1f::zeros(srcSize); teta.copyTo(tetaMasked, cluster); - + float sigma_s = (float)(sigma_s_ / getResizeRatio()); Mat1f tetaMaskedBlur; @@ -750,7 +756,7 @@ void AdaptiveManifoldFilterN::computeEigenVector(const vector& X, const Mat vecDst.create(1, cnNum); CV_Assert(vecRand.size() == Size(cnNum, 1) && vecDst.size() == Size(cnNum, 1)); CV_Assert(mask.rows == height && mask.cols == width); - + const float *pVecRand = vecRand.ptr(); Mat1d vecDstd(1, cnNum, 0.0); double *pVecDst = vecDstd.ptr(); @@ -763,7 +769,7 @@ void AdaptiveManifoldFilterN::computeEigenVector(const vector& X, const Mat const uchar *maskRow = mask.ptr(i); float *mulRow = Xw.ptr(i); - //first multiplication + //first multiplication for (int cn = 0; cn < cnNum; cn++) { const float *srcRow = X[cn].ptr(i); @@ -793,7 +799,7 @@ void AdaptiveManifoldFilterN::computeEigenVector(const vector& X, const Mat for (int j = 0; j < width; j++) curCnSum += mulRow[j]*srcRow[j]; - //TODO: parallel reduce + //TODO: parallel reduce pVecDst[cn] += curCnSum; } } @@ -852,7 +858,7 @@ Ptr AdaptiveManifoldFilter::create() Ptr createAMFilter(double sigma_s, double sigma_r, bool adjust_outliers) { Ptr amf(new AdaptiveManifoldFilterN()); - + amf->setSigmaS(sigma_s); amf->setSigmaR(sigma_r); amf->setAdjustOutliers(adjust_outliers); diff --git a/modules/ximgproc/src/anisodiff.cpp b/modules/ximgproc/src/anisodiff.cpp index 370482b89..996b4ac5b 100644 --- a/modules/ximgproc/src/anisodiff.cpp +++ b/modules/ximgproc/src/anisodiff.cpp @@ -92,7 +92,7 @@ public: alpha_ = alpha; } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { const int cn = 3; int cols = src->cols; diff --git a/modules/ximgproc/src/deriche_filter.cpp b/modules/ximgproc/src/deriche_filter.cpp index 98821cd78..031a9a501 100644 --- a/modules/ximgproc/src/deriche_filter.cpp +++ b/modules/ximgproc/src/deriche_filter.cpp @@ -162,7 +162,7 @@ public: verbose(false) {} void Verbose(bool b) { verbose = b; } - virtual void operator()(const Range& range) const + virtual void operator()(const Range& range) const CV_OVERRIDE { CV_Assert(img.depth()==CV_8UC1 || img.depth()==CV_8SC1 || img.depth()==CV_16SC1 || img.depth()==CV_16UC1); CV_Assert(dst.depth()==CV_32FC1); @@ -209,7 +209,7 @@ public: verbose(false) {} void Verbose(bool b) { verbose = b; } - virtual void operator()(const Range& range) const + virtual void operator()(const Range& range) const CV_OVERRIDE { CV_Assert(img.depth()==CV_32FC1); CV_Assert(dst.depth()==CV_32FC1); @@ -282,7 +282,7 @@ public: verbose(false) {} void Verbose(bool b) { verbose = b; } - virtual void operator()(const Range& range) const + virtual void operator()(const Range& range) const CV_OVERRIDE { CV_Assert(img.depth()==CV_32FC1); CV_Assert(dst.depth()==CV_32FC1); @@ -357,7 +357,7 @@ public: verbose(false) {} void Verbose(bool b) { verbose = b; } - virtual void operator()(const Range& range) const + virtual void operator()(const Range& range) const CV_OVERRIDE { CV_Assert(img.depth()==CV_8UC1 || img.depth()==CV_8SC1 || img.depth()==CV_16SC1 || img.depth()==CV_16UC1); CV_Assert(dst.depth()==CV_32FC1); diff --git a/modules/ximgproc/src/disparity_filters.cpp b/modules/ximgproc/src/disparity_filters.cpp index e38e36bca..068d4bfec 100644 --- a/modules/ximgproc/src/disparity_filters.cpp +++ b/modules/ximgproc/src/disparity_filters.cpp @@ -76,7 +76,7 @@ protected: int nstripes, stripe_sz; ComputeDiscontinuityAwareLRC_ParBody(DisparityWLSFilterImpl& _wls, Mat& _left_disp, Mat& _right_disp, Mat& _left_disc, Mat& _right_disc, Mat& _dst, Rect _left_ROI, Rect _right_ROI, int _nstripes); - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; struct ComputeDepthDisc_ParBody : public ParallelLoopBody @@ -86,7 +86,7 @@ protected: int nstripes, stripe_sz; ComputeDepthDisc_ParBody(DisparityWLSFilterImpl& _wls, Mat& _disp, Mat& _disp_squares, Mat& _dst, int _nstripes); - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; typedef void (DisparityWLSFilterImpl::*MatOp)(Mat& src, Mat& dst); @@ -99,7 +99,7 @@ protected: vector dst; ParallelMatOp_ParBody(DisparityWLSFilterImpl& _wls, vector _ops, vector& _src, vector& _dst); - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; void boxFilterOp(Mat& src,Mat& dst) @@ -121,23 +121,23 @@ protected: public: static Ptr create(bool _use_confidence, int l_offs, int r_offs, int t_offs, int b_offs, int min_disp); - void filter(InputArray disparity_map_left, InputArray left_view, OutputArray filtered_disparity_map, InputArray disparity_map_right, Rect ROI, InputArray); + void filter(InputArray disparity_map_left, InputArray left_view, OutputArray filtered_disparity_map, InputArray disparity_map_right, Rect ROI, InputArray) CV_OVERRIDE; void filter_(InputArray disparity_map_left, InputArray left_view, OutputArray filtered_disparity_map, InputArray disparity_map_right, Rect ROI); - double getLambda() {return lambda;} - void setLambda(double _lambda) {lambda = _lambda;} + double getLambda() CV_OVERRIDE { return lambda; } + void setLambda(double _lambda) CV_OVERRIDE { lambda = _lambda; } - double getSigmaColor() {return sigma_color;} - void setSigmaColor(double _sigma_color) {sigma_color = _sigma_color;} + double getSigmaColor() CV_OVERRIDE { return sigma_color; } + void setSigmaColor(double _sigma_color) CV_OVERRIDE { sigma_color = _sigma_color; } - int getLRCthresh() {return LRC_thresh;} - void setLRCthresh(int _LRC_thresh) {LRC_thresh = _LRC_thresh;} + int getLRCthresh() CV_OVERRIDE { return LRC_thresh; } + void setLRCthresh(int _LRC_thresh) CV_OVERRIDE { LRC_thresh = _LRC_thresh; } - int getDepthDiscontinuityRadius() {return depth_discontinuity_radius;} - void setDepthDiscontinuityRadius(int _disc_radius) {depth_discontinuity_radius = _disc_radius;} + int getDepthDiscontinuityRadius() CV_OVERRIDE { return depth_discontinuity_radius; } + void setDepthDiscontinuityRadius(int _disc_radius) CV_OVERRIDE { depth_discontinuity_radius = _disc_radius; } - Mat getConfidenceMap() {return confidence_map;} - Rect getROI() {return valid_disp_ROI;} + Mat getConfidenceMap() CV_OVERRIDE { return confidence_map; } + Rect getROI() CV_OVERRIDE { return valid_disp_ROI; } }; void DisparityWLSFilterImpl::init(double _lambda, double _sigma_color, bool _use_confidence, int l_offs, int r_offs, int t_offs, int b_offs, int _min_disp) diff --git a/modules/ximgproc/src/dtfilter_cpu.hpp b/modules/ximgproc/src/dtfilter_cpu.hpp index 89881f94d..3eaec8b77 100644 --- a/modules/ximgproc/src/dtfilter_cpu.hpp +++ b/modules/ximgproc/src/dtfilter_cpu.hpp @@ -2,26 +2,26 @@ * By downloading, copying, installing or using the software you agree to this license. * If you do not agree to this license, do not download, install, * copy or use the software. - * - * + * + * * License Agreement * For Open Source Computer Vision Library * (3 - clause BSD License) - * + * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met : - * + * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and / or other materials provided with the distribution. - * + * * * Neither the names of the copyright holders nor the names of the contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * This software is provided by the copyright holders and contributors "as is" and * any express or implied warranties, including, but not limited to, the implied * warranties of merchantability and fitness for a particular purpose are disclaimed. @@ -59,7 +59,7 @@ public: /*Non-template methods*/ static Ptr createRF(InputArray adistHor, InputArray adistVert, double sigmaSpatial, double sigmaColor, int numIters = 3); - void filter(InputArray src, OutputArray dst, int dDepth = -1); + void filter(InputArray src, OutputArray dst, int dDepth = -1) CV_OVERRIDE; void setSingleFilterCall(bool value); @@ -141,7 +141,7 @@ protected: /*Wrappers for parallelization*/ float radius; FilterNC_horPass(Mat& src_, Mat& idist_, Mat& dst_); - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; }; template @@ -151,7 +151,7 @@ protected: /*Wrappers for parallelization*/ float radius; FilterIC_horPass(Mat& src_, Mat& idist_, Mat& dist_, Mat& dst_); - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; }; template @@ -161,7 +161,7 @@ protected: /*Wrappers for parallelization*/ int iteration; FilterRF_horPass(Mat& res_, Mat& alphaD_, int iteration_); - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; Range getRange() const { return Range(0, res.rows); } }; @@ -172,7 +172,7 @@ protected: /*Wrappers for parallelization*/ int iteration; FilterRF_vertPass(Mat& res_, Mat& alphaD_, int iteration_); - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; #ifdef CV_GET_NUM_THREAD_WORKS_PROPERLY Range getRange() const { return Range(0, cv::getNumThreads()); } #else @@ -187,7 +187,7 @@ protected: /*Wrappers for parallelization*/ Mat &guide, &dst; ComputeIDTHor_ParBody(DTFilterCPU& dtf_, Mat& guide_, Mat& dst_); - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; Range getRange() { return Range(0, guide.rows); } }; @@ -199,7 +199,7 @@ protected: /*Wrappers for parallelization*/ IDistType maxRadius; ComputeDTandIDTHor_ParBody(DTFilterCPU& dtf_, Mat& guide_, Mat& dist_, Mat& idist_); - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; Range getRange() { return Range(0, guide.rows); } }; @@ -211,7 +211,7 @@ protected: /*Wrappers for parallelization*/ float lna; ComputeA0DTHor_ParBody(DTFilterCPU& dtf_, Mat& guide_); - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; Range getRange() { return Range(0, guide.rows); } ~ComputeA0DTHor_ParBody(); }; @@ -224,7 +224,7 @@ protected: /*Wrappers for parallelization*/ float lna; ComputeA0DTVert_ParBody(DTFilterCPU& dtf_, Mat& guide_); - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; Range getRange() const { return Range(0, guide.rows - 1); } ~ComputeA0DTVert_ParBody(); }; @@ -291,4 +291,4 @@ void domainTransformFilter( const Mat& guide, #include "dtfilter_cpu.inl.hpp" -#endif \ No newline at end of file +#endif diff --git a/modules/ximgproc/src/dtfilter_cpu.inl.hpp b/modules/ximgproc/src/dtfilter_cpu.inl.hpp index 9a3641b55..cdc28d45b 100644 --- a/modules/ximgproc/src/dtfilter_cpu.inl.hpp +++ b/modules/ximgproc/src/dtfilter_cpu.inl.hpp @@ -2,26 +2,26 @@ * By downloading, copying, installing or using the software you agree to this license. * If you do not agree to this license, do not download, install, * copy or use the software. - * - * + * + * * License Agreement * For Open Source Computer Vision Library * (3 - clause BSD License) - * + * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met : - * + * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and / or other materials provided with the distribution. - * + * * * Neither the names of the copyright holders nor the names of the contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * This software is provided by the copyright holders and contributors "as is" and * any express or implied warranties, including, but not limited to, the implied * warranties of merchantability and fitness for a particular purpose are disclaimed. @@ -137,7 +137,7 @@ void DTFilterCPU::filter_(const Mat& src, Mat& dst, int dDepth) Mat res; if (dDepth == -1) dDepth = src.depth(); - + //small optimization to avoid extra copying of data bool useDstAsRes = (dDepth == traits::Depth::value && (mode == DTF_NC || mode == DTF_RF)); if (useDstAsRes) @@ -193,7 +193,7 @@ void DTFilterCPU::filter_(const Mat& src, Mat& dst, int dDepth) bool useA0DT = (singleFilterCall || iter == 1); Mat& a0dHor = (useA0DT) ? a0distHor : adistHor; Mat& a0dVert = (useA0DT) ? a0distVert : adistVert; - + FilterRF_horPass horParBody(res, a0dHor, iter); FilterRF_vertPass vertParBody(res, a0dVert, iter); parallel_for_(horParBody.getRange(), horParBody); @@ -261,7 +261,7 @@ void DTFilterCPU::prepareSrcImg_IC(const Mat& src, Mat& dst, Mat& dstT) { line = dstOutT.ptr(i); line[0] = topLine[i]; - line[ri] = bottomLine[i]; + line[ri] = bottomLine[i]; } } @@ -514,7 +514,7 @@ void DTFilterCPU::ComputeDTandIDTHor_ParBody::operator()(const Range& DistType curDist; IDistType curIDist = (IDistType)0; int j; - + distLine[-1] = maxRadius; //idistLine[-1] = curIDist - maxRadius; idistLine[0] = curIDist; @@ -621,4 +621,4 @@ void domainTransformFilter( const Mat& guide, } } -#endif \ No newline at end of file +#endif diff --git a/modules/ximgproc/src/edgeboxes.cpp b/modules/ximgproc/src/edgeboxes.cpp index fe07ea430..2e65b2fa3 100644 --- a/modules/ximgproc/src/edgeboxes.cpp +++ b/modules/ximgproc/src/edgeboxes.cpp @@ -79,10 +79,10 @@ public: float gamma, float kappa); - virtual void getBoundingBoxes(InputArray edge_map, InputArray orientation_map, std::vector &boxes); + virtual void getBoundingBoxes(InputArray edge_map, InputArray orientation_map, std::vector &boxes) CV_OVERRIDE; - float getAlpha() const { return _alpha; } - void setAlpha(float value) + float getAlpha() const CV_OVERRIDE { return _alpha; } + void setAlpha(float value) CV_OVERRIDE { _alpha = value; _sxStep = sqrt(1 / _alpha); @@ -90,38 +90,38 @@ public: _xyStepRatio = (1 - _alpha) / (1 + _alpha); } - float getBeta() const { return _beta; } - void setBeta(float value) { _beta = value; } + float getBeta() const CV_OVERRIDE { return _beta; } + void setBeta(float value) CV_OVERRIDE { _beta = value; } - float getEta() const { return _eta; } - void setEta(float value) { _eta = value; } + float getEta() const CV_OVERRIDE { return _eta; } + void setEta(float value) CV_OVERRIDE { _eta = value; } - float getMinScore() const { return _minScore; } - void setMinScore(float value) { _minScore = value; } + float getMinScore() const CV_OVERRIDE { return _minScore; } + void setMinScore(float value) CV_OVERRIDE { _minScore = value; } - int getMaxBoxes() const { return _maxBoxes; } - void setMaxBoxes(int value) { _maxBoxes = value; } + int getMaxBoxes() const CV_OVERRIDE { return _maxBoxes; } + void setMaxBoxes(int value) CV_OVERRIDE { _maxBoxes = value; } - float getEdgeMinMag() const { return _edgeMinMag; } - void setEdgeMinMag(float value) { _edgeMinMag = value; } + float getEdgeMinMag() const CV_OVERRIDE { return _edgeMinMag; } + void setEdgeMinMag(float value) CV_OVERRIDE { _edgeMinMag = value; } - float getEdgeMergeThr() const { return _edgeMergeThr; } - void setEdgeMergeThr(float value) { _edgeMergeThr = value; } + float getEdgeMergeThr() const CV_OVERRIDE { return _edgeMergeThr; } + void setEdgeMergeThr(float value) CV_OVERRIDE { _edgeMergeThr = value; } - float getClusterMinMag() const { return _clusterMinMag; } - void setClusterMinMag(float value) { _clusterMinMag = value; } + float getClusterMinMag() const CV_OVERRIDE { return _clusterMinMag; } + void setClusterMinMag(float value) CV_OVERRIDE { _clusterMinMag = value; } - float getMaxAspectRatio() const { return _maxAspectRatio; } - void setMaxAspectRatio(float value) { _maxAspectRatio = value; } + float getMaxAspectRatio() const CV_OVERRIDE { return _maxAspectRatio; } + void setMaxAspectRatio(float value) CV_OVERRIDE { _maxAspectRatio = value; } - float getMinBoxArea() const { return _minBoxArea; } - void setMinBoxArea(float value) { _minBoxArea = value; } + float getMinBoxArea() const CV_OVERRIDE { return _minBoxArea; } + void setMinBoxArea(float value) CV_OVERRIDE { _minBoxArea = value; } - float getGamma() const { return _gamma; } - void setGamma(float value) { _gamma = value; } + float getGamma() const CV_OVERRIDE { return _gamma; } + void setGamma(float value) CV_OVERRIDE { _gamma = value; } - float getKappa() const { return _kappa; } - void setKappa(float value) + float getKappa() const CV_OVERRIDE { return _kappa; } + void setKappa(float value) CV_OVERRIDE { _kappa = value; _scaleNorm.resize(10000); diff --git a/modules/ximgproc/src/fast_line_detector.cpp b/modules/ximgproc/src/fast_line_detector.cpp index ffd7a5891..33560184d 100644 --- a/modules/ximgproc/src/fast_line_detector.cpp +++ b/modules/ximgproc/src/fast_line_detector.cpp @@ -49,7 +49,7 @@ class FastLineDetectorImpl : public FastLineDetector * a line. Where Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 is the end. * Returned lines are directed so that the brighter side is placed on left. */ - void detect(InputArray _image, OutputArray _lines); + void detect(InputArray _image, OutputArray _lines) CV_OVERRIDE; /** * Draw lines on the given canvas. @@ -59,7 +59,7 @@ class FastLineDetectorImpl : public FastLineDetector * @param lines The lines that need to be drawn * @param draw_arrow If true, arrow heads will be drawn */ - void drawSegments(InputOutputArray _image, InputArray lines, bool draw_arrow = false); + void drawSegments(InputOutputArray _image, InputArray lines, bool draw_arrow = false) CV_OVERRIDE; private: int imagewidth, imageheight, threshold_length; diff --git a/modules/ximgproc/src/fgs_filter.cpp b/modules/ximgproc/src/fgs_filter.cpp index b1c96550e..d5e633893 100644 --- a/modules/ximgproc/src/fgs_filter.cpp +++ b/modules/ximgproc/src/fgs_filter.cpp @@ -62,7 +62,7 @@ class FastGlobalSmootherFilterImpl : public FastGlobalSmootherFilter { public: static Ptr create(InputArray guide, double lambda, double sigma_color, int num_iter,double lambda_attenuation); - void filter(InputArray src, OutputArray dst); + void filter(InputArray src, OutputArray dst) CV_OVERRIDE; protected: int w,h; @@ -85,7 +85,7 @@ protected: int h; HorizontalPass_ParBody(FastGlobalSmootherFilterImpl &_fgs, Mat& _cur, int _nstripes, int _h); - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; inline void process_4row_block(Mat* cur,int i); inline void process_row(Mat* cur,int i); @@ -98,7 +98,7 @@ protected: int w; VerticalPass_ParBody(FastGlobalSmootherFilterImpl &_fgs, Mat& _cur, int _nstripes, int _w); - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; template @@ -110,7 +110,7 @@ protected: int h; ComputeHorizontalWeights_ParBody(FastGlobalSmootherFilterImpl &_fgs, Mat& _guide, int _nstripes, int _h); - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; template @@ -122,7 +122,7 @@ protected: int w; ComputeVerticalWeights_ParBody(FastGlobalSmootherFilterImpl &_fgs, Mat& _guide, int _nstripes, int _w); - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; struct ComputeLUT_ParBody : public ParallelLoopBody @@ -133,7 +133,7 @@ protected: int sz; ComputeLUT_ParBody(FastGlobalSmootherFilterImpl &_fgs, WorkType* _LUT, int _nstripes, int _sz); - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; }; diff --git a/modules/ximgproc/src/graphsegmentation.cpp b/modules/ximgproc/src/graphsegmentation.cpp index f81eb673e..4a11a4324 100644 --- a/modules/ximgproc/src/graphsegmentation.cpp +++ b/modules/ximgproc/src/graphsegmentation.cpp @@ -106,28 +106,28 @@ namespace cv { name_ = "GraphSegmentation"; } - ~GraphSegmentationImpl() { + ~GraphSegmentationImpl() CV_OVERRIDE { }; - virtual void processImage(InputArray src, OutputArray dst); + virtual void processImage(InputArray src, OutputArray dst) CV_OVERRIDE; - virtual void setSigma(double sigma_) { if (sigma_ <= 0) { sigma_ = 0.001; } sigma = sigma_; } - virtual double getSigma() { return sigma; } + virtual void setSigma(double sigma_) CV_OVERRIDE { if (sigma_ <= 0) { sigma_ = 0.001; } sigma = sigma_; } + virtual double getSigma() CV_OVERRIDE { return sigma; } - virtual void setK(float k_) { k = k_; } - virtual float getK() { return k; } + virtual void setK(float k_) CV_OVERRIDE { k = k_; } + virtual float getK() CV_OVERRIDE { return k; } - virtual void setMinSize(int min_size_) { min_size = min_size_; } - virtual int getMinSize() { return min_size; } + virtual void setMinSize(int min_size_) CV_OVERRIDE { min_size = min_size_; } + virtual int getMinSize() CV_OVERRIDE { return min_size; } - virtual void write(FileStorage& fs) const { + virtual void write(FileStorage& fs) const CV_OVERRIDE { fs << "name" << name_ << "sigma" << sigma << "k" << k << "min_size" << (int)min_size; } - virtual void read(const FileNode& fn) { + virtual void read(const FileNode& fn) CV_OVERRIDE { CV_Assert( (String)fn["name"] == name_ ); sigma = (double)fn["sigma"]; diff --git a/modules/ximgproc/src/guided_filter.cpp b/modules/ximgproc/src/guided_filter.cpp index 16c676199..11fa0f6fc 100644 --- a/modules/ximgproc/src/guided_filter.cpp +++ b/modules/ximgproc/src/guided_filter.cpp @@ -130,7 +130,7 @@ public: static Ptr create(InputArray guide, int radius, double eps); - void filter(InputArray src, OutputArray dst, int dDepth = -1); + void filter(InputArray src, OutputArray dst, int dDepth = -1) CV_OVERRIDE; protected: @@ -181,7 +181,7 @@ private: /*Routines to parallelize boxFilter and convertTo*/ GFTransform_ParBody(GuidedFilterImpl& gf_, vector& srcv, vector& dstv, TransformFunc func_); GFTransform_ParBody(GuidedFilterImpl& gf_, vector >& srcvv, vector >& dstvv, TransformFunc func_); - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; Range getRange() const { @@ -218,7 +218,7 @@ private: /*Parallel body classes*/ MulChannelsGuide_ParBody(GuidedFilterImpl& gf_, SymArray2D& covars_) : gf(gf_), covars(covars_) {} - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; struct ComputeCovGuideFromChannelsMul_ParBody : public ParallelLoopBody @@ -229,7 +229,7 @@ private: /*Parallel body classes*/ ComputeCovGuideFromChannelsMul_ParBody(GuidedFilterImpl& gf_, SymArray2D& covars_) : gf(gf_), covars(covars_) {} - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; struct ComputeCovGuideInv_ParBody : public ParallelLoopBody @@ -239,7 +239,7 @@ private: /*Parallel body classes*/ ComputeCovGuideInv_ParBody(GuidedFilterImpl& gf_, SymArray2D& covars_); - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; @@ -252,7 +252,7 @@ private: /*Parallel body classes*/ MulChannelsGuideAndSrc_ParBody(GuidedFilterImpl& gf_, vector& srcCn_, vector >& cov_) : gf(gf_), cov(cov_), srcCn(srcCn_) {} - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; struct ComputeCovFromSrcChannelsMul_ParBody : public ParallelLoopBody @@ -264,7 +264,7 @@ private: /*Parallel body classes*/ ComputeCovFromSrcChannelsMul_ParBody(GuidedFilterImpl& gf_, vector& srcCnMean_, vector >& cov_) : gf(gf_), cov(cov_), srcCnMean(srcCnMean_) {} - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; struct ComputeAlpha_ParBody : public ParallelLoopBody @@ -276,7 +276,7 @@ private: /*Parallel body classes*/ ComputeAlpha_ParBody(GuidedFilterImpl& gf_, vector >& alpha_, vector >& covSrc_) : gf(gf_), alpha(alpha_), covSrc(covSrc_) {} - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; struct ComputeBeta_ParBody : public ParallelLoopBody @@ -289,7 +289,7 @@ private: /*Parallel body classes*/ ComputeBeta_ParBody(GuidedFilterImpl& gf_, vector >& alpha_, vector& srcCnMean_, vector& beta_) : gf(gf_), alpha(alpha_), srcCnMean(srcCnMean_), beta(beta_) {} - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; struct ApplyTransform_ParBody : public ParallelLoopBody @@ -301,7 +301,7 @@ private: /*Parallel body classes*/ ApplyTransform_ParBody(GuidedFilterImpl& gf_, vector >& alpha_, vector& beta_) : gf(gf_), alpha(alpha_), beta(beta_) {} - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; }; diff --git a/modules/ximgproc/src/joint_bilateral_filter.cpp b/modules/ximgproc/src/joint_bilateral_filter.cpp index e9863e852..f69785e9b 100644 --- a/modules/ximgproc/src/joint_bilateral_filter.cpp +++ b/modules/ximgproc/src/joint_bilateral_filter.cpp @@ -2,26 +2,26 @@ * By downloading, copying, installing or using the software you agree to this license. * If you do not agree to this license, do not download, install, * copy or use the software. - * - * + * + * * License Agreement * For Open Source Computer Vision Library * (3 - clause BSD License) - * + * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met : - * + * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and / or other materials provided with the distribution. - * + * * * Neither the names of the copyright holders nor the names of the contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * This software is provided by the copyright holders and contributors "as is" and * any express or implied warranties, including, but not limited to, the implied * warranties of merchantability and fitness for a particular purpose are disclaimed. @@ -74,7 +74,7 @@ public: JointBilateralFilter_32f(Mat& joint_, Mat& src_, Mat& dst_, int radius_, int maxk_, float scaleIndex_, int *spaceOfs_, float *spaceWeights_, float *expLUT_) : - joint(joint_), src(src_), dst(dst_), radius(radius_), maxk(maxk_), + joint(joint_), src(src_), dst(dst_), radius(radius_), maxk(maxk_), scaleIndex(scaleIndex_), spaceOfs(spaceOfs_), spaceWeights(spaceWeights_), expLUT(expLUT_) { CV_DbgAssert(joint.type() == traits::Type::value && src.type() == dst.type() && src.type() == traits::Type::value); @@ -82,7 +82,7 @@ public: CV_DbgAssert(joint.cols == src.cols && src.cols == dst.cols + 2*radius); } - void operator () (const Range& range) const + void operator () (const Range& range) const CV_OVERRIDE { for (int i = radius + range.start; i < radius + range.end; i++) { @@ -122,7 +122,7 @@ public: void jointBilateralFilter_32f(Mat& joint, Mat& src, Mat& dst, int radius, double sigmaColor, double sigmaSpace, int borderType) { CV_DbgAssert(joint.depth() == CV_32F && src.depth() == CV_32F); - + int d = 2*radius + 1; int jCn = joint.channels(); const int kExpNumBinsPerChannel = 1 << 12; @@ -228,7 +228,7 @@ public: CV_DbgAssert(joint.cols == src.cols && src.cols == dst.cols + 2 * radius); } - void operator () (const Range& range) const + void operator () (const Range& range) const CV_OVERRIDE { typedef Vec JointVeci; typedef Vec SrcVecf; @@ -250,7 +250,7 @@ public: int alpha = 0; for (int cn = 0; cn < JointVec::channels; cn++) alpha += std::abs(jointPix0[cn] - (int)jointPix[cn]); - + float weight = spaceWeights[k] * expLUT[alpha]; uchar *srcPix = reinterpret_cast(srcCenterPixPtr + spaceOfs[k]); @@ -399,4 +399,4 @@ void jointBilateralFilter(InputArray joint_, InputArray src_, OutputArray dst_, } } -} \ No newline at end of file +} diff --git a/modules/ximgproc/src/l0_smooth.cpp b/modules/ximgproc/src/l0_smooth.cpp index 65b1b7e4d..c7aa51d17 100644 --- a/modules/ximgproc/src/l0_smooth.cpp +++ b/modules/ximgproc/src/l0_smooth.cpp @@ -54,7 +54,7 @@ namespace { src_ = s; } - void operator() (const Range& range) const + void operator() (const Range& range) const CV_OVERRIDE { for (int i = range.start; i != range.end; i++) { @@ -72,7 +72,7 @@ namespace { src_ = s; } - void operator() (const Range& range) const + void operator() (const Range& range) const CV_OVERRIDE { for (int i = range.start; i != range.end; i++) { @@ -95,7 +95,7 @@ namespace denom_ = denom; dst_ = dst; } - void operator() (const Range& range) const + void operator() (const Range& range) const CV_OVERRIDE { for (int i = range.start; i != range.end; i++) { diff --git a/modules/ximgproc/src/lsc.cpp b/modules/ximgproc/src/lsc.cpp index 60a717871..9ef507c8f 100644 --- a/modules/ximgproc/src/lsc.cpp +++ b/modules/ximgproc/src/lsc.cpp @@ -59,22 +59,22 @@ public: SuperpixelLSCImpl( InputArray image, int region_size, float ratio ); - virtual ~SuperpixelLSCImpl(); + virtual ~SuperpixelLSCImpl() CV_OVERRIDE; // perform amount of iteration - virtual void iterate( int num_iterations = 10 ); + virtual void iterate( int num_iterations = 10 ) CV_OVERRIDE; // get amount of superpixels - virtual int getNumberOfSuperpixels() const; + virtual int getNumberOfSuperpixels() const CV_OVERRIDE; // get image with labels - virtual void getLabels( OutputArray labels_out ) const; + virtual void getLabels( OutputArray labels_out ) const CV_OVERRIDE; // get mask image with contour - virtual void getLabelContourMask( OutputArray image, bool thick_line = true ) const; + virtual void getLabelContourMask( OutputArray image, bool thick_line = true ) const CV_OVERRIDE; // enforce connectivity over labels - virtual void enforceLabelConnectivity( int min_element_size ); + virtual void enforceLabelConnectivity( int min_element_size ) CV_OVERRIDE; protected: @@ -1075,7 +1075,7 @@ struct FeatureSpaceWeights : ParallelLoopBody sigmaC1 = _sigmaC1; sigmaC2 = _sigmaC2; } - void operator()( const Range& range ) const + void operator()( const Range& range ) const CV_OVERRIDE { for( int x = range.start; x < range.end; x++ ) { @@ -1222,7 +1222,7 @@ struct FeatureSpaceCenters : ParallelLoopBody centerC1 = _centerC1; centerC2 = _centerC2; } - void operator()( const Range& range ) const + void operator()( const Range& range ) const CV_OVERRIDE { for( int i = range.start; i < range.end; i++ ) { @@ -1364,7 +1364,7 @@ struct FeatureSpaceKmeans : ParallelLoopBody centerC1 = _centerC1; centerC2 = _centerC2; } - void operator()( const Range& range ) const + void operator()( const Range& range ) const CV_OVERRIDE { for( int i = range.start; i < range.end; i++ ) { @@ -1693,7 +1693,7 @@ struct FeatureNormals : ParallelLoopBody centerC1 = _centerC1; centerC2 = _centerC2; } - void operator()( const Range& range ) const + void operator()( const Range& range ) const CV_OVERRIDE { for( int i = range.start; i < range.end; i++ ) { diff --git a/modules/ximgproc/src/paillou_filter.cpp b/modules/ximgproc/src/paillou_filter.cpp index 59701de71..7d3c08413 100644 --- a/modules/ximgproc/src/paillou_filter.cpp +++ b/modules/ximgproc/src/paillou_filter.cpp @@ -145,7 +145,7 @@ public: verbose(false) {} void Verbose(bool b){verbose=b;} - virtual void operator()(const Range& range) const + virtual void operator()(const Range& range) const CV_OVERRIDE { CV_Assert(img.depth()==CV_8UC1 || img.depth()==CV_16SC1 || img.depth()==CV_16UC1); CV_Assert(dst.depth()==CV_32FC1); @@ -193,7 +193,7 @@ public: verbose(false) {} void Verbose(bool b){verbose=b;} - virtual void operator()(const Range& range) const + virtual void operator()(const Range& range) const CV_OVERRIDE { CV_Assert(img.depth()==CV_32FC1); if (verbose) @@ -263,7 +263,7 @@ public: verbose(false) {} void Verbose(bool b){verbose=b;} - virtual void operator()(const Range& range) const + virtual void operator()(const Range& range) const CV_OVERRIDE { CV_Assert(img.depth()==CV_32FC1); if (verbose) @@ -333,7 +333,7 @@ public: verbose(false) {} void Verbose(bool b){verbose=b;} - virtual void operator()(const Range& range) const + virtual void operator()(const Range& range) const CV_OVERRIDE { if (verbose) std::cout << getThreadNum()<<"# :Start from row " << range.start << " to " << range.end-1<<" ("< g, float weight); - virtual void clearStrategies(); + virtual void addStrategy(Ptr g, float weight) CV_OVERRIDE; + virtual void clearStrategies() CV_OVERRIDE; private: String name_; @@ -346,15 +346,15 @@ namespace cv { * Stragegy / Size ***************************************/ - class SelectiveSearchSegmentationStrategySizeImpl : public SelectiveSearchSegmentationStrategySize { + class SelectiveSearchSegmentationStrategySizeImpl CV_FINAL : public SelectiveSearchSegmentationStrategySize { public: SelectiveSearchSegmentationStrategySizeImpl() { name_ = "SelectiveSearchSegmentationStrategySize"; } - virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1); - virtual float get(int r1, int r2); - virtual void merge(int r1, int r2); + virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1) CV_OVERRIDE; + virtual float get(int r1, int r2) CV_OVERRIDE; + virtual void merge(int r1, int r2) CV_OVERRIDE; private: String name_; @@ -393,15 +393,15 @@ namespace cv { * Stragegy / Fill ***************************************/ - class SelectiveSearchSegmentationStrategyFillImpl : public SelectiveSearchSegmentationStrategyFill { + class SelectiveSearchSegmentationStrategyFillImpl CV_FINAL : public SelectiveSearchSegmentationStrategyFill { public: SelectiveSearchSegmentationStrategyFillImpl() { name_ = "SelectiveSearchSegmentationStrategyFill"; } - virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1); - virtual float get(int r1, int r2); - virtual void merge(int r1, int r2); + virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1) CV_OVERRIDE; + virtual float get(int r1, int r2) CV_OVERRIDE; + virtual void merge(int r1, int r2) CV_OVERRIDE; private: String name_; @@ -471,16 +471,16 @@ namespace cv { * Stragegy / Texture ***************************************/ - class SelectiveSearchSegmentationStrategyTextureImpl : public SelectiveSearchSegmentationStrategyTexture { + class SelectiveSearchSegmentationStrategyTextureImpl CV_FINAL : public SelectiveSearchSegmentationStrategyTexture { public: SelectiveSearchSegmentationStrategyTextureImpl() { name_ = "SelectiveSearchSegmentationStrategyTexture"; last_image_id = -1; } - virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1); - virtual float get(int r1, int r2); - virtual void merge(int r1, int r2); + virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1) CV_OVERRIDE; + virtual float get(int r1, int r2) CV_OVERRIDE; + virtual void merge(int r1, int r2) CV_OVERRIDE; private: String name_; @@ -678,39 +678,39 @@ namespace cv { // Core - class SelectiveSearchSegmentationImpl : public SelectiveSearchSegmentation { + class SelectiveSearchSegmentationImpl CV_FINAL : public SelectiveSearchSegmentation { public: SelectiveSearchSegmentationImpl() { name_ = "SelectiveSearchSegmentation"; } - ~SelectiveSearchSegmentationImpl() { + ~SelectiveSearchSegmentationImpl() CV_OVERRIDE { }; - virtual void write(FileStorage& fs) const { + virtual void write(FileStorage& fs) const CV_OVERRIDE { fs << "name" << name_; } - virtual void read(const FileNode& fn) { + virtual void read(const FileNode& fn) CV_OVERRIDE { CV_Assert( (String)fn["name"] == name_); } - virtual void setBaseImage(InputArray img); + virtual void setBaseImage(InputArray img) CV_OVERRIDE; - virtual void switchToSingleStrategy(int k = 200, float sigma = 0.8); - virtual void switchToSelectiveSearchFast(int base_k = 150, int inc_k = 150, float sigma = 0.8); - virtual void switchToSelectiveSearchQuality(int base_k = 150, int inc_k = 150, float sigma = 0.8); + virtual void switchToSingleStrategy(int k = 200, float sigma = 0.8) CV_OVERRIDE; + virtual void switchToSelectiveSearchFast(int base_k = 150, int inc_k = 150, float sigma = 0.8) CV_OVERRIDE; + virtual void switchToSelectiveSearchQuality(int base_k = 150, int inc_k = 150, float sigma = 0.8) CV_OVERRIDE; - virtual void addImage(InputArray img); - virtual void clearImages(); + virtual void addImage(InputArray img) CV_OVERRIDE; + virtual void clearImages() CV_OVERRIDE; - virtual void addGraphSegmentation(Ptr g); - virtual void clearGraphSegmentations(); + virtual void addGraphSegmentation(Ptr g) CV_OVERRIDE; + virtual void clearGraphSegmentations() CV_OVERRIDE; - virtual void addStrategy(Ptr s); - virtual void clearStrategies(); + virtual void addStrategy(Ptr s) CV_OVERRIDE; + virtual void clearStrategies() CV_OVERRIDE; - virtual void process(std::vector& rects); + virtual void process(std::vector& rects) CV_OVERRIDE; private: diff --git a/modules/ximgproc/src/slic.cpp b/modules/ximgproc/src/slic.cpp index d57a6d7fc..463700904 100644 --- a/modules/ximgproc/src/slic.cpp +++ b/modules/ximgproc/src/slic.cpp @@ -72,22 +72,22 @@ public: SuperpixelSLICImpl( InputArray image, int algorithm, int region_size, float ruler ); - virtual ~SuperpixelSLICImpl(); + virtual ~SuperpixelSLICImpl() CV_OVERRIDE; // perform amount of iteration - virtual void iterate( int num_iterations = 10 ); + virtual void iterate( int num_iterations = 10 ) CV_OVERRIDE; // get amount of superpixels - virtual int getNumberOfSuperpixels() const; + virtual int getNumberOfSuperpixels() const CV_OVERRIDE; // get image with labels - virtual void getLabels( OutputArray labels_out ) const; + virtual void getLabels( OutputArray labels_out ) const CV_OVERRIDE; // get mask image with contour - virtual void getLabelContourMask( OutputArray image, bool thick_line = true ) const; + virtual void getLabelContourMask( OutputArray image, bool thick_line = true ) const CV_OVERRIDE; // enforce connectivity over labels - virtual void enforceLabelConnectivity( int min_element_size = 25 ); + virtual void enforceLabelConnectivity( int min_element_size = 25 ) CV_OVERRIDE; protected: @@ -840,7 +840,7 @@ struct SeedNormInvoker : ParallelLoopBody clustersize = _clustersize; } - void operator ()(const cv::Range& range) const + void operator ()(const cv::Range& range) const CV_OVERRIDE { for (int k = range.start; k < range.end; ++k) { @@ -1009,7 +1009,7 @@ struct SLICOGrowInvoker : ParallelLoopBody nr_channels = _nr_channels; } - void operator ()(const cv::Range& range) const + void operator ()(const cv::Range& range) const CV_OVERRIDE { int cols = klabels->cols; int rows = klabels->rows; @@ -1221,7 +1221,7 @@ struct SLICGrowInvoker : ParallelLoopBody nr_channels = _nr_channels; } - void operator ()(const cv::Range& range) const + void operator ()(const cv::Range& range) const CV_OVERRIDE { for (int y = range.start; y < range.end; ++y) { diff --git a/modules/ximgproc/src/sparse_match_interpolators.cpp b/modules/ximgproc/src/sparse_match_interpolators.cpp index 5be3c46e5..a29650265 100644 --- a/modules/ximgproc/src/sparse_match_interpolators.cpp +++ b/modules/ximgproc/src/sparse_match_interpolators.cpp @@ -69,11 +69,11 @@ struct node node(short l,float d): dist(d), label(l) {} }; -class EdgeAwareInterpolatorImpl : public EdgeAwareInterpolator +class EdgeAwareInterpolatorImpl CV_FINAL : public EdgeAwareInterpolator { public: static Ptr create(); - void interpolate(InputArray from_image, InputArray from_points, InputArray to_image, InputArray to_points, OutputArray dense_flow); + void interpolate(InputArray from_image, InputArray from_points, InputArray to_image, InputArray to_points, OutputArray dense_flow) CV_OVERRIDE; protected: int w,h; @@ -115,7 +115,7 @@ protected: int stripe_sz; GetKNNMatches_ParBody(EdgeAwareInterpolatorImpl& _inst, int _num_stripes); - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; struct RansacInterpolation_ParBody : public ParallelLoopBody @@ -130,22 +130,22 @@ protected: int inc; RansacInterpolation_ParBody(EdgeAwareInterpolatorImpl& _inst, Mat* _transforms, float* _weighted_inlier_nums, float* _eps, SparseMatch* _matches, int _num_stripes, int _inc); - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; public: - void setK(int _k) {k=_k;} - int getK() {return k;} - void setSigma(float _sigma) {sigma=_sigma;} - float getSigma() {return sigma;} - void setLambda(float _lambda) {lambda=_lambda;} - float getLambda() {return lambda;} - void setUsePostProcessing(bool _use_post_proc) {use_post_proc=_use_post_proc;} - bool getUsePostProcessing() {return use_post_proc;} - void setFGSLambda(float _lambda) {fgs_lambda=_lambda;} - float getFGSLambda() {return fgs_lambda;} - void setFGSSigma(float _sigma) {fgs_sigma = _sigma;} - float getFGSSigma() {return fgs_sigma;} + void setK(int _k) CV_OVERRIDE {k=_k;} + int getK() CV_OVERRIDE {return k;} + void setSigma(float _sigma) CV_OVERRIDE {sigma=_sigma;} + float getSigma() CV_OVERRIDE {return sigma;} + void setLambda(float _lambda) CV_OVERRIDE {lambda=_lambda;} + float getLambda() CV_OVERRIDE {return lambda;} + void setUsePostProcessing(bool _use_post_proc) CV_OVERRIDE {use_post_proc=_use_post_proc;} + bool getUsePostProcessing() CV_OVERRIDE {return use_post_proc;} + void setFGSLambda(float _lambda) CV_OVERRIDE {fgs_lambda=_lambda;} + float getFGSLambda() CV_OVERRIDE {return fgs_lambda;} + void setFGSSigma(float _sigma) CV_OVERRIDE {fgs_sigma = _sigma;} + float getFGSSigma() CV_OVERRIDE {return fgs_sigma;} }; void EdgeAwareInterpolatorImpl::init() diff --git a/modules/ximgproc/src/structured_edge_detection.cpp b/modules/ximgproc/src/structured_edge_detection.cpp index f8d3cd6b8..795dd8d67 100644 --- a/modules/ximgproc/src/structured_edge_detection.cpp +++ b/modules/ximgproc/src/structured_edge_detection.cpp @@ -281,7 +281,7 @@ public: { } - void operator()(const cv::Range &range) const + void operator()(const cv::Range &range) const CV_OVERRIDE { for (int x = range.start; x < range.end; x++) { @@ -359,7 +359,7 @@ public: * \param gradNum : __rf.options.numberOfGradientOrientations */ virtual void getFeatures(const Mat &src, Mat &features, const int gnrmRad, const int gsmthRad, - const int shrink, const int outNum, const int gradNum) const + const int shrink, const int outNum, const int gradNum) const CV_OVERRIDE { cv::Mat luvImg = rgb2luv(src); @@ -524,7 +524,7 @@ public: * \param _dst : destination image (grayscale, float, in [0;1]) * where edges are drawn */ - void detectEdges(cv::InputArray _src, cv::OutputArray _dst) const + void detectEdges(cv::InputArray _src, cv::OutputArray _dst) const CV_OVERRIDE { CV_Assert( _src.type() == CV_32FC3 ); @@ -556,7 +556,7 @@ public: * \param dst : orientation image. * \param r : filter radius. */ - void computeOrientation(cv::InputArray _src, cv::OutputArray _dst) const + void computeOrientation(cv::InputArray _src, cv::OutputArray _dst) const CV_OVERRIDE { CV_Assert( _src.type() == CV_32FC1 ); @@ -596,7 +596,7 @@ public: * \param m : multiplier for conservative suppression. * \param isParallel: enables/disables parallel computing. */ - void edgesNms(cv::InputArray edge_image, cv::InputArray orientation_image, cv::OutputArray _dst, int r, int s, float m, bool isParallel) const + void edgesNms(cv::InputArray edge_image, cv::InputArray orientation_image, cv::OutputArray _dst, int r, int s, float m, bool isParallel) const CV_OVERRIDE { CV_Assert(edge_image.type() == CV_32FC1); CV_Assert(orientation_image.type() == CV_32FC1); diff --git a/modules/ximgproc/test/test_adaptive_manifold_ref_impl.cpp b/modules/ximgproc/test/test_adaptive_manifold_ref_impl.cpp index dfb57c40a..f1e9d1beb 100644 --- a/modules/ximgproc/test/test_adaptive_manifold_ref_impl.cpp +++ b/modules/ximgproc/test/test_adaptive_manifold_ref_impl.cpp @@ -4,19 +4,19 @@ /* * The MIT License(MIT) - * + * * Copyright(c) 2013 Vladislav Vinogradov - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files(the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions : - * + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR @@ -149,12 +149,18 @@ using namespace cv::ximgproc; void collectGarbage(); - CV_IMPL_PROPERTY(double, SigmaS, sigma_s_) - CV_IMPL_PROPERTY(double, SigmaR, sigma_r_) - CV_IMPL_PROPERTY(int, TreeHeight, tree_height_) - CV_IMPL_PROPERTY(int, PCAIterations, num_pca_iterations_) - CV_IMPL_PROPERTY(bool, AdjustOutliers, adjust_outliers_) - CV_IMPL_PROPERTY(bool, UseRNG, useRNG) + inline double getSigmaS() const CV_OVERRIDE { return sigma_s_; } + inline void setSigmaS(double val) CV_OVERRIDE { sigma_s_ = val; } + inline double getSigmaR() const CV_OVERRIDE { return sigma_r_; } + inline void setSigmaR(double val) CV_OVERRIDE { sigma_r_ = val; } + inline int getTreeHeight() const CV_OVERRIDE { return tree_height_; } + inline void setTreeHeight(int val) CV_OVERRIDE { tree_height_ = val; } + inline int getPCAIterations() const CV_OVERRIDE { return num_pca_iterations_; } + inline void setPCAIterations(int val) CV_OVERRIDE { num_pca_iterations_ = val; } + inline bool getAdjustOutliers() const CV_OVERRIDE { return adjust_outliers_; } + inline void setAdjustOutliers(bool val) CV_OVERRIDE { adjust_outliers_ = val; } + inline bool getUseRNG() const CV_OVERRIDE { return useRNG; } + inline void setUseRNG(bool val) CV_OVERRIDE { useRNG = val; } protected: bool adjust_outliers_; @@ -930,7 +936,7 @@ using namespace cv::ximgproc; Ptr createAMFilterRefImpl(double sigma_s, double sigma_r, bool adjust_outliers) { Ptr amf(new AdaptiveManifoldFilterRefImpl()); - + amf->setSigmaS(sigma_s); amf->setSigmaR(sigma_r); amf->setAdjustOutliers(adjust_outliers); diff --git a/modules/xobjdetect/src/feature_evaluator.hpp b/modules/xobjdetect/src/feature_evaluator.hpp index 2b5920233..879e75f09 100644 --- a/modules/xobjdetect/src/feature_evaluator.hpp +++ b/modules/xobjdetect/src/feature_evaluator.hpp @@ -111,8 +111,8 @@ public: enum { HAAR = 0, LBP = 1, HOG = 2 }; CvFeatureParams(); virtual void init( const CvFeatureParams& fp ); - virtual void write( cv::FileStorage &fs ) const; - virtual bool read( const cv::FileNode &node ); + virtual void write( cv::FileStorage &fs ) const CV_OVERRIDE; + virtual bool read( const cv::FileNode &node ) CV_OVERRIDE; static cv::Ptr create(); int maxCatCount; // 0 in case of numerical features int featSize; // 1 in case of simple features (HAAR, LBP) and N_BINS(9)*N_CELLS(4) in case of Dalal's HOG features diff --git a/modules/xobjdetect/src/lbpfeatures.h b/modules/xobjdetect/src/lbpfeatures.h index 0fc564a8b..8f28a8382 100644 --- a/modules/xobjdetect/src/lbpfeatures.h +++ b/modules/xobjdetect/src/lbpfeatures.h @@ -64,15 +64,15 @@ class CvLBPEvaluator : public CvFeatureEvaluator public: virtual ~CvLBPEvaluator() {} virtual void init(const CvFeatureParams *_featureParams, - int _maxSampleCount, cv::Size _winSize ); - virtual void setImage(const cv::Mat& img, uchar clsLabel, int idx, const std::vector &feature_ind); - virtual void setWindow(const cv::Point& p) + int _maxSampleCount, cv::Size _winSize ) CV_OVERRIDE; + virtual void setImage(const cv::Mat& img, uchar clsLabel, int idx, const std::vector &feature_ind) CV_OVERRIDE; + virtual void setWindow(const cv::Point& p) CV_OVERRIDE { cur_sum = sum.rowRange(p.y, p.y + winSize.height).colRange(p.x, p.x + winSize.width); } - virtual float operator()(int featureIdx) + virtual float operator()(int featureIdx) CV_OVERRIDE { return (float)features[featureIdx].calc( cur_sum ); } - virtual void writeFeatures( cv::FileStorage &fs, const cv::Mat& featureMap ) const; + virtual void writeFeatures( cv::FileStorage &fs, const cv::Mat& featureMap ) const CV_OVERRIDE; protected: - virtual void generateFeatures(); + virtual void generateFeatures() CV_OVERRIDE; class Feature { diff --git a/modules/xobjdetect/src/wbdetector.hpp b/modules/xobjdetect/src/wbdetector.hpp index 631a4232b..71972aae9 100644 --- a/modules/xobjdetect/src/wbdetector.hpp +++ b/modules/xobjdetect/src/wbdetector.hpp @@ -52,19 +52,19 @@ namespace cv namespace xobjdetect { -class WBDetectorImpl : public WBDetector { +class WBDetectorImpl CV_FINAL : public WBDetector { public: - virtual void read(const FileNode &node); - virtual void write(FileStorage &fs) const; + virtual void read(const FileNode &node) CV_OVERRIDE; + virtual void write(FileStorage &fs) const CV_OVERRIDE; virtual void train( const std::string& pos_samples, - const std::string& neg_imgs); + const std::string& neg_imgs) CV_OVERRIDE; virtual void detect( const Mat& img, std::vector &bboxes, - std::vector &confidences); + std::vector &confidences) CV_OVERRIDE; private: WaldBoost boost_; diff --git a/modules/xphoto/src/bm3d_denoising_invoker_step1.hpp b/modules/xphoto/src/bm3d_denoising_invoker_step1.hpp index ab214e198..ec5303c18 100644 --- a/modules/xphoto/src/bm3d_denoising_invoker_step1.hpp +++ b/modules/xphoto/src/bm3d_denoising_invoker_step1.hpp @@ -67,7 +67,7 @@ public: const float &beta); virtual ~Bm3dDenoisingInvokerStep1(); - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; private: // Unimplemented operator in order to satisfy compiler warning. @@ -514,4 +514,4 @@ inline void Bm3dDenoisingInvokerStep1::calcDistSumsForAllEleme } // namespace xphoto } // namespace cv -#endif \ No newline at end of file +#endif diff --git a/modules/xphoto/src/bm3d_denoising_invoker_step2.hpp b/modules/xphoto/src/bm3d_denoising_invoker_step2.hpp index 835a61ee1..0662b7228 100644 --- a/modules/xphoto/src/bm3d_denoising_invoker_step2.hpp +++ b/modules/xphoto/src/bm3d_denoising_invoker_step2.hpp @@ -68,7 +68,7 @@ public: const float &beta); virtual ~Bm3dDenoisingInvokerStep2(); - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; private: // Unimplemented operator in order to satisfy compiler warning. @@ -537,4 +537,4 @@ inline void Bm3dDenoisingInvokerStep2::calcDistSumsForAllEleme } // namespace xphoto } // namespace cv -#endif \ No newline at end of file +#endif diff --git a/modules/xphoto/src/dct_image_denoising.cpp b/modules/xphoto/src/dct_image_denoising.cpp index 89e8af017..c43bbb43c 100644 --- a/modules/xphoto/src/dct_image_denoising.cpp +++ b/modules/xphoto/src/dct_image_denoising.cpp @@ -68,7 +68,7 @@ namespace xphoto grayDctDenoisingInvoker(const Mat &src, std::vector &patches, const double sigma, const int psize); ~grayDctDenoisingInvoker(){}; - void operator() (const Range &range) const; + void operator() (const Range &range) const CV_OVERRIDE; protected: const Mat &src; diff --git a/modules/xphoto/src/grayworld_white_balance.cpp b/modules/xphoto/src/grayworld_white_balance.cpp index 9d38c2675..d3b5b0ea5 100644 --- a/modules/xphoto/src/grayworld_white_balance.cpp +++ b/modules/xphoto/src/grayworld_white_balance.cpp @@ -49,16 +49,16 @@ namespace xphoto void calculateChannelSums(uint &sumB, uint &sumG, uint &sumR, uchar *src_data, int src_len, float thresh); void calculateChannelSums(uint64 &sumB, uint64 &sumG, uint64 &sumR, ushort *src_data, int src_len, float thresh); -class GrayworldWBImpl : public GrayworldWB +class GrayworldWBImpl CV_FINAL : public GrayworldWB { private: float thresh; public: GrayworldWBImpl() { thresh = 0.9f; } - float getSaturationThreshold() const { return thresh; } - void setSaturationThreshold(float val) { thresh = val; } - void balanceWhite(InputArray _src, OutputArray _dst) + float getSaturationThreshold() const CV_OVERRIDE { return thresh; } + void setSaturationThreshold(float val) CV_OVERRIDE { thresh = val; } + void balanceWhite(InputArray _src, OutputArray _dst) CV_OVERRIDE { CV_Assert(!_src.empty()); CV_Assert(_src.isContinuous()); diff --git a/modules/xphoto/src/learning_based_color_balance.cpp b/modules/xphoto/src/learning_based_color_balance.cpp index d63c603a1..ad2407029 100644 --- a/modules/xphoto/src/learning_based_color_balance.cpp +++ b/modules/xphoto/src/learning_based_color_balance.cpp @@ -126,16 +126,16 @@ class LearningBasedWBImpl : public LearningBasedWB } } - int getRangeMaxVal() const { return range_max_val; } - void setRangeMaxVal(int val) { range_max_val = val; } + int getRangeMaxVal() const CV_OVERRIDE { return range_max_val; } + void setRangeMaxVal(int val) CV_OVERRIDE { range_max_val = val; } - float getSaturationThreshold() const { return saturation_thresh; } - void setSaturationThreshold(float val) { saturation_thresh = val; } + float getSaturationThreshold() const CV_OVERRIDE { return saturation_thresh; } + void setSaturationThreshold(float val) CV_OVERRIDE { saturation_thresh = val; } - int getHistBinNum() const { return hist_bin_num; } - void setHistBinNum(int val) { hist_bin_num = val; } + int getHistBinNum() const CV_OVERRIDE { return hist_bin_num; } + void setHistBinNum(int val) CV_OVERRIDE { hist_bin_num = val; } - void extractSimpleFeatures(InputArray _src, OutputArray _dst) + void extractSimpleFeatures(InputArray _src, OutputArray _dst) CV_OVERRIDE { CV_Assert(!_src.empty()); CV_Assert(_src.isContinuous()); @@ -149,7 +149,7 @@ class LearningBasedWBImpl : public LearningBasedWB Mat(dst).convertTo(_dst, CV_32F); } - void balanceWhite(InputArray _src, OutputArray _dst) + void balanceWhite(InputArray _src, OutputArray _dst) CV_OVERRIDE { CV_Assert(!_src.empty()); CV_Assert(_src.isContinuous()); diff --git a/modules/xphoto/src/photomontage.hpp b/modules/xphoto/src/photomontage.hpp index 2994fe5f0..2f790b488 100644 --- a/modules/xphoto/src/photomontage.hpp +++ b/modules/xphoto/src/photomontage.hpp @@ -98,7 +98,7 @@ private: ParallelExpansion(Photomontage *_main) : main(_main){} ~ParallelExpansion(){}; - void operator () (const cv::Range &range) const + void operator () (const cv::Range &range) const CV_OVERRIDE { for (int i = range.start; i <= range.end - 1; ++i) main->distances[i] = main->singleExpansion(i); diff --git a/modules/xphoto/src/simple_color_balance.cpp b/modules/xphoto/src/simple_color_balance.cpp index e357dd741..af8aaa083 100644 --- a/modules/xphoto/src/simple_color_balance.cpp +++ b/modules/xphoto/src/simple_color_balance.cpp @@ -136,7 +136,7 @@ void balanceWhiteSimple(std::vector > &src, Mat &dst, const float inputM cv::merge(src, dst); } -class SimpleWBImpl : public SimpleWB +class SimpleWBImpl CV_FINAL : public SimpleWB { private: float inputMin, inputMax, outputMin, outputMax, p; @@ -151,22 +151,22 @@ class SimpleWBImpl : public SimpleWB p = 2.0f; } - float getInputMin() const { return inputMin; } - void setInputMin(float val) { inputMin = val; } + float getInputMin() const CV_OVERRIDE { return inputMin; } + void setInputMin(float val) CV_OVERRIDE { inputMin = val; } - float getInputMax() const { return inputMax; } - void setInputMax(float val) { inputMax = val; } + float getInputMax() const CV_OVERRIDE { return inputMax; } + void setInputMax(float val) CV_OVERRIDE { inputMax = val; } - float getOutputMin() const { return outputMin; } - void setOutputMin(float val) { outputMin = val; } + float getOutputMin() const CV_OVERRIDE { return outputMin; } + void setOutputMin(float val) CV_OVERRIDE { outputMin = val; } - float getOutputMax() const { return outputMax; } - void setOutputMax(float val) { outputMax = val; } + float getOutputMax() const CV_OVERRIDE { return outputMax; } + void setOutputMax(float val) CV_OVERRIDE { outputMax = val; } - float getP() const { return p; } - void setP(float val) { p = val; } + float getP() const CV_OVERRIDE { return p; } + void setP(float val) CV_OVERRIDE { p = val; } - void balanceWhite(InputArray _src, OutputArray _dst) + void balanceWhite(InputArray _src, OutputArray _dst) CV_OVERRIDE { CV_Assert(!_src.empty()); CV_Assert(_src.depth() == CV_8U || _src.depth() == CV_16S || _src.depth() == CV_32S || _src.depth() == CV_32F);