diff --git a/3rdparty/openexr/CMakeLists.txt b/3rdparty/openexr/CMakeLists.txt index 730b9a0d7e..5472b6df73 100644 --- a/3rdparty/openexr/CMakeLists.txt +++ b/3rdparty/openexr/CMakeLists.txt @@ -44,6 +44,7 @@ source_group("Src" FILES ${lib_srcs}) ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused -Wsign-compare -Wundef -Wmissing-declarations -Wuninitialized -Wswitch -Wparentheses -Warray-bounds -Wextra -Wdeprecated-declarations -Wmisleading-indentation -Wdeprecated + -Wsuggest-override -Winconsistent-missing-override ) ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4099 /wd4100 /wd4101 /wd4127 /wd4189 /wd4245 /wd4305 /wd4389 /wd4512 /wd4701 /wd4702 /wd4706 /wd4800) # vs2005 ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4334) # vs2005 Win64 diff --git a/3rdparty/protobuf/CMakeLists.txt b/3rdparty/protobuf/CMakeLists.txt index f5ca6f1fff..e506fe9642 100644 --- a/3rdparty/protobuf/CMakeLists.txt +++ b/3rdparty/protobuf/CMakeLists.txt @@ -20,6 +20,7 @@ else() -Wundef -Wtautological-undefined-compare -Wignored-qualifiers -Wextra -Wunused-function -Wunused-const-variable -Wshorten-64-to-32 -Wno-invalid-offsetof -Wenum-compare-switch + -Wsuggest-override -Winconsistent-missing-override ) endif() if(CV_ICC) diff --git a/apps/interactive-calibration/frameProcessor.hpp b/apps/interactive-calibration/frameProcessor.hpp index 222b83143f..6fd788dc7f 100644 --- a/apps/interactive-calibration/frameProcessor.hpp +++ b/apps/interactive-calibration/frameProcessor.hpp @@ -61,10 +61,10 @@ protected: public: CalibProcessor(cv::Ptr data, captureParameters& capParams); - virtual cv::Mat processFrame(const cv::Mat& frame); - virtual bool isProcessed() const; - virtual void resetState(); - ~CalibProcessor(); + virtual cv::Mat processFrame(const cv::Mat& frame) CV_OVERRIDE; + virtual bool isProcessed() const CV_OVERRIDE; + virtual void resetState() CV_OVERRIDE; + ~CalibProcessor() CV_OVERRIDE; }; enum visualisationMode {Grid, Window}; @@ -84,9 +84,9 @@ protected: void drawGridPoints(const cv::Mat& frame); public: ShowProcessor(cv::Ptr data, cv::Ptr controller, TemplateType board); - virtual cv::Mat processFrame(const cv::Mat& frame); - virtual bool isProcessed() const; - virtual void resetState(); + virtual cv::Mat processFrame(const cv::Mat& frame) CV_OVERRIDE; + virtual bool isProcessed() const CV_OVERRIDE; + virtual void resetState() CV_OVERRIDE; void setVisualizationMode(visualisationMode mode); void switchVisualizationMode(); @@ -95,7 +95,7 @@ public: void switchUndistort(); void setUndistort(bool isEnabled); - ~ShowProcessor(); + ~ShowProcessor() CV_OVERRIDE; }; } diff --git a/apps/traincascade/CMakeLists.txt b/apps/traincascade/CMakeLists.txt index e4d65483c3..96b9781067 100644 --- a/apps/traincascade/CMakeLists.txt +++ b/apps/traincascade/CMakeLists.txt @@ -8,7 +8,9 @@ endif() project(traincascade) set(the_target opencv_traincascade) -ocv_warnings_disable(CMAKE_CXX_FLAGS -Woverloaded-virtual) +ocv_warnings_disable(CMAKE_CXX_FLAGS -Woverloaded-virtual + -Winconsistent-missing-override -Wsuggest-override +) ocv_target_include_directories(${the_target} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv") ocv_target_include_modules_recurse(${the_target} ${OPENCV_TRAINCASCADE_DEPS}) diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake index f4974b3cf5..ae22437e8a 100644 --- a/cmake/OpenCVCompilerOptions.cmake +++ b/cmake/OpenCVCompilerOptions.cmake @@ -103,6 +103,13 @@ if(CV_GCC OR CV_CLANG) add_extra_compiler_option(-Wsign-promo) add_extra_compiler_option(-Wuninitialized) add_extra_compiler_option(-Winit-self) + if(HAVE_CXX11) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + add_extra_compiler_option(-Wsuggest-override) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + add_extra_compiler_option(-Winconsistent-missing-override) + endif() + endif() if(ENABLE_NOISY_WARNINGS) add_extra_compiler_option(-Wcast-align) diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake index 5114affa1a..16543fe7e0 100644 --- a/cmake/OpenCVFindProtobuf.cmake +++ b/cmake/OpenCVFindProtobuf.cmake @@ -51,7 +51,7 @@ else() add_library(libprotobuf UNKNOWN IMPORTED) set_target_properties(libprotobuf PROPERTIES IMPORTED_LOCATION "${Protobuf_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${Protobuf_INCLUDE_DIR}" + INTERFACE_INCLUDE_SYSTEM_DIRECTORIES "${Protobuf_INCLUDE_DIR}" ) get_protobuf_version(Protobuf_VERSION "${Protobuf_INCLUDE_DIR}") endif() diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake index a2d23ff05d..c804fba29f 100644 --- a/cmake/OpenCVUtils.cmake +++ b/cmake/OpenCVUtils.cmake @@ -565,6 +565,24 @@ macro(ocv_append_build_options var_prefix pkg_prefix) endforeach() endmacro() +function(ocv_append_source_files_cxx_compiler_options files_var) + set(__flags "${ARGN}") + ocv_check_flag_support(CXX "${__flags}" __HAVE_COMPILER_OPTIONS_VAR "") + if(${__HAVE_COMPILER_OPTIONS_VAR}) + foreach(source ${${files_var}}) + if("${source}" MATCHES "\\.(cpp|cc|cxx)$") + get_source_file_property(flags "${source}" COMPILE_FLAGS) + if(flags) + set(flags "${flags} ${__flags}") + else() + set(flags "${__flags}") + endif() + set_source_files_properties("${source}" PROPERTIES COMPILE_FLAGS "${flags}") + endif() + endforeach() + endif() +endfunction() + # Usage is similar to CMake 'pkg_check_modules' command # It additionally controls HAVE_${define} and ${define}_${modname}_FOUND variables macro(ocv_check_modules define) diff --git a/modules/calib3d/src/five-point.cpp b/modules/calib3d/src/five-point.cpp index 19472d49ff..79d9609f11 100644 --- a/modules/calib3d/src/five-point.cpp +++ b/modules/calib3d/src/five-point.cpp @@ -34,10 +34,10 @@ namespace cv { -class EMEstimatorCallback : public PointSetRegistrator::Callback +class EMEstimatorCallback CV_FINAL : public PointSetRegistrator::Callback { public: - int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const + int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const CV_OVERRIDE { Mat q1 = _m1.getMat(), q2 = _m2.getMat(); Mat Q1 = q1.reshape(1, (int)q1.total()); @@ -370,7 +370,7 @@ protected: } - void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const + void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const CV_OVERRIDE { Mat X1 = _m1.getMat(), X2 = _m2.getMat(), model = _model.getMat(); const Point2d* x1ptr = X1.ptr(); diff --git a/modules/calib3d/src/fundam.cpp b/modules/calib3d/src/fundam.cpp index 693dc949da..e4fa98a1f2 100644 --- a/modules/calib3d/src/fundam.cpp +++ b/modules/calib3d/src/fundam.cpp @@ -59,10 +59,10 @@ namespace cv * where \f$\lambda \in \mathbb{R} \f$. * */ -class HomographyEstimatorCallback : public PointSetRegistrator::Callback +class HomographyEstimatorCallback CV_FINAL : public PointSetRegistrator::Callback { public: - bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const + bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const CV_OVERRIDE { Mat ms1 = _ms1.getMat(), ms2 = _ms2.getMat(); if( haveCollinearPoints(ms1, count) || haveCollinearPoints(ms2, count) ) @@ -113,7 +113,7 @@ public: * 2 columns 1 channel * @param _model, CV_64FC1, 3x3, normalized, i.e., the last element is 1 */ - int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const + int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const CV_OVERRIDE { Mat m1 = _m1.getMat(), m2 = _m2.getMat(); int i, count = m1.checkVector(2); @@ -188,7 +188,7 @@ public: * @param _model CV_64FC1, 3x3 * @param _err, output, CV_32FC1, square of the L2 norm */ - void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const + void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const CV_OVERRIDE { Mat m1 = _m1.getMat(), m2 = _m2.getMat(), model = _model.getMat(); int i, count = m1.checkVector(2); @@ -211,7 +211,7 @@ public: }; -class HomographyRefineCallback : public LMSolver::Callback +class HomographyRefineCallback CV_FINAL : public LMSolver::Callback { public: HomographyRefineCallback(InputArray _src, InputArray _dst) @@ -220,7 +220,7 @@ public: dst = _dst.getMat(); } - bool compute(InputArray _param, OutputArray _err, OutputArray _Jac) const + bool compute(InputArray _param, OutputArray _err, OutputArray _Jac) const CV_OVERRIDE { int i, count = src.checkVector(2); Mat param = _param.getMat(); @@ -700,16 +700,16 @@ static int run8Point( const Mat& _m1, const Mat& _m2, Mat& _fmatrix ) } -class FMEstimatorCallback : public PointSetRegistrator::Callback +class FMEstimatorCallback CV_FINAL : public PointSetRegistrator::Callback { public: - bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const + bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const CV_OVERRIDE { Mat ms1 = _ms1.getMat(), ms2 = _ms2.getMat(); return !haveCollinearPoints(ms1, count) && !haveCollinearPoints(ms2, count); } - int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const + int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const CV_OVERRIDE { double f[9*3]; Mat m1 = _m1.getMat(), m2 = _m2.getMat(); @@ -725,7 +725,7 @@ public: return n; } - void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const + void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const CV_OVERRIDE { Mat __m1 = _m1.getMat(), __m2 = _m2.getMat(), __model = _model.getMat(); int i, count = __m1.checkVector(2); diff --git a/modules/calib3d/src/homography_decomp.cpp b/modules/calib3d/src/homography_decomp.cpp index 3ee2cdbc87..252da7967b 100644 --- a/modules/calib3d/src/homography_decomp.cpp +++ b/modules/calib3d/src/homography_decomp.cpp @@ -99,25 +99,25 @@ private: cv::Matx33d _Hnorm; }; -class HomographyDecompZhang : public HomographyDecomp { +class HomographyDecompZhang CV_FINAL : public HomographyDecomp { public: HomographyDecompZhang():HomographyDecomp() {} virtual ~HomographyDecompZhang() {} private: - virtual void decompose(std::vector& camMotions); + virtual void decompose(std::vector& camMotions) CV_OVERRIDE; bool findMotionFrom_tstar_n(const cv::Vec3d& tstar, const cv::Vec3d& n, CameraMotion& motion); }; -class HomographyDecompInria : public HomographyDecomp { +class HomographyDecompInria CV_FINAL : public HomographyDecomp { public: HomographyDecompInria():HomographyDecomp() {} virtual ~HomographyDecompInria() {} private: - virtual void decompose(std::vector& camMotions); + virtual void decompose(std::vector& camMotions) CV_OVERRIDE; double oppositeOfMinor(const cv::Matx33d& M, const int row, const int col); void findRmatFrom_tstar_n(const cv::Vec3d& tstar, const cv::Vec3d& n, const double v, cv::Matx33d& R); }; diff --git a/modules/calib3d/src/levmarq.cpp b/modules/calib3d/src/levmarq.cpp index ad4be0ee6d..0bec8680c6 100644 --- a/modules/calib3d/src/levmarq.cpp +++ b/modules/calib3d/src/levmarq.cpp @@ -77,7 +77,7 @@ namespace cv { -class LMSolverImpl : public LMSolver +class LMSolverImpl CV_FINAL : public LMSolver { public: LMSolverImpl() : maxIters(100) { init(); } @@ -89,7 +89,7 @@ public: printInterval = 0; } - int run(InputOutputArray _param0) const + int run(InputOutputArray _param0) const CV_OVERRIDE { Mat param0 = _param0.getMat(), x, xd, r, rd, J, A, Ap, v, temp_d, d; int ptype = param0.type(); @@ -198,7 +198,7 @@ public: return iter; } - void setCallback(const Ptr& _cb) { cb = _cb; } + void setCallback(const Ptr& _cb) CV_OVERRIDE { cb = _cb; } Ptr cb; diff --git a/modules/calib3d/src/ptsetreg.cpp b/modules/calib3d/src/ptsetreg.cpp index f64a4e4362..e26e67dc3e 100644 --- a/modules/calib3d/src/ptsetreg.cpp +++ b/modules/calib3d/src/ptsetreg.cpp @@ -161,7 +161,7 @@ public: return i == modelPoints && iters < maxAttempts; } - bool run(InputArray _m1, InputArray _m2, OutputArray _model, OutputArray _mask) const + bool run(InputArray _m1, InputArray _m2, OutputArray _model, OutputArray _mask) const CV_OVERRIDE { bool result = false; Mat m1 = _m1.getMat(), m2 = _m2.getMat(); @@ -257,7 +257,7 @@ public: return result; } - void setCallback(const Ptr& _cb) { cb = _cb; } + void setCallback(const Ptr& _cb) CV_OVERRIDE { cb = _cb; } Ptr cb; int modelPoints; @@ -274,7 +274,7 @@ public: int _modelPoints=0, double _confidence=0.99, int _maxIters=1000) : RANSACPointSetRegistrator(_cb, _modelPoints, 0, _confidence, _maxIters) {} - bool run(InputArray _m1, InputArray _m2, OutputArray _model, OutputArray _mask) const + bool run(InputArray _m1, InputArray _m2, OutputArray _model, OutputArray _mask) const CV_OVERRIDE { const double outlierRatio = 0.45; bool result = false; @@ -412,7 +412,7 @@ Ptr createLMeDSPointSetRegistrator(const Ptr(); @@ -450,7 +450,7 @@ public: return 1; } - void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const + void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const CV_OVERRIDE { Mat m1 = _m1.getMat(), m2 = _m2.getMat(), model = _model.getMat(); const Point3f* from = m1.ptr(); @@ -477,7 +477,7 @@ public: } } - bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const + bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const CV_OVERRIDE { const float threshold = 0.996f; Mat ms1 = _ms1.getMat(), ms2 = _ms2.getMat(); @@ -527,7 +527,7 @@ public: class Affine2DEstimatorCallback : public PointSetRegistrator::Callback { public: - int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const + int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const CV_OVERRIDE { Mat m1 = _m1.getMat(), m2 = _m2.getMat(); const Point2f* from = m1.ptr(); @@ -587,7 +587,7 @@ public: return 1; } - void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const + void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const CV_OVERRIDE { Mat m1 = _m1.getMat(), m2 = _m2.getMat(), model = _model.getMat(); const Point2f* from = m1.ptr(); @@ -616,7 +616,7 @@ public: } } - bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const + bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const CV_OVERRIDE { Mat ms1 = _ms1.getMat(); Mat ms2 = _ms2.getMat(); @@ -640,7 +640,7 @@ public: class AffinePartial2DEstimatorCallback : public Affine2DEstimatorCallback { public: - int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const + int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const CV_OVERRIDE { Mat m1 = _m1.getMat(), m2 = _m2.getMat(); const Point2f* from = m1.ptr(); @@ -696,7 +696,7 @@ public: dst = _dst.getMat(); } - bool compute(InputArray _param, OutputArray _err, OutputArray _Jac) const + bool compute(InputArray _param, OutputArray _err, OutputArray _Jac) const CV_OVERRIDE { int i, count = src.checkVector(2); Mat param = _param.getMat(); @@ -754,7 +754,7 @@ public: dst = _dst.getMat(); } - bool compute(InputArray _param, OutputArray _err, OutputArray _Jac) const + bool compute(InputArray _param, OutputArray _err, OutputArray _Jac) const CV_OVERRIDE { int i, count = src.checkVector(2); Mat param = _param.getMat(); diff --git a/modules/calib3d/src/rho.cpp b/modules/calib3d/src/rho.cpp index b42eace1ba..3989ebb861 100644 --- a/modules/calib3d/src/rho.cpp +++ b/modules/calib3d/src/rho.cpp @@ -336,9 +336,9 @@ struct RHO_HEST_REFC : RHO_HEST{ ~RHO_HEST_REFC(); /* Methods to implement external interface */ - inline int initialize(void); - inline void finalize(void); - inline int ensureCapacity(unsigned N, double beta); + inline int initialize(void) CV_OVERRIDE; + inline void finalize(void) CV_OVERRIDE; + inline int ensureCapacity(unsigned N, double beta) CV_OVERRIDE; unsigned rhoHest(const float* src, /* Source points */ const float* dst, /* Destination points */ char* inl, /* Inlier mask */ @@ -351,7 +351,8 @@ struct RHO_HEST_REFC : RHO_HEST{ double beta, /* Works: 0.35 */ unsigned flags, /* Works: 0 */ const float* guessH, /* Extrinsic guess, NULL if none provided */ - float* finalH); /* Final result. */ + float* finalH /* Final result. */ + ) CV_OVERRIDE; diff --git a/modules/calib3d/src/solvepnp.cpp b/modules/calib3d/src/solvepnp.cpp index 0f4687c3f7..78426210b9 100644 --- a/modules/calib3d/src/solvepnp.cpp +++ b/modules/calib3d/src/solvepnp.cpp @@ -169,7 +169,7 @@ bool solvePnP( InputArray _opoints, InputArray _ipoints, return result; } -class PnPRansacCallback : public PointSetRegistrator::Callback +class PnPRansacCallback CV_FINAL : public PointSetRegistrator::Callback { public: @@ -181,7 +181,7 @@ public: /* Pre: True */ /* Post: compute _model with given points and return number of found models */ - int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const + int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const CV_OVERRIDE { Mat opoints = _m1.getMat(), ipoints = _m2.getMat(); @@ -197,7 +197,7 @@ public: /* Pre: True */ /* Post: fill _err with projection errors */ - void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const + void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const CV_OVERRIDE { Mat opoints = _m1.getMat(), ipoints = _m2.getMat(), model = _model.getMat(); diff --git a/modules/calib3d/src/stereobm.cpp b/modules/calib3d/src/stereobm.cpp index 2501934f4b..b3498c66d1 100644 --- a/modules/calib3d/src/stereobm.cpp +++ b/modules/calib3d/src/stereobm.cpp @@ -889,7 +889,7 @@ struct PrefilterInvoker : public ParallelLoopBody 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++ ) { @@ -974,7 +974,7 @@ struct FindStereoCorrespInvoker : public ParallelLoopBody #endif } - void operator()( const Range& range ) const + void operator()(const Range& range) const CV_OVERRIDE { int cols = left->cols, rows = left->rows; int _row0 = std::min(cvRound(range.start * rows / nstripes), rows); @@ -1046,7 +1046,7 @@ protected: bool useSIMD; }; -class StereoBMImpl : public StereoBM +class StereoBMImpl CV_FINAL : public StereoBM { public: StereoBMImpl() @@ -1059,7 +1059,7 @@ public: params = StereoBMParams(_numDisparities, _SADWindowSize); } - void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr ) + void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr ) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -1201,49 +1201,49 @@ public: disp.convertTo(disp0, disp0.type(), 1./(1 << disp_shift), 0); } - int getMinDisparity() const { return params.minDisparity; } - void setMinDisparity(int minDisparity) { params.minDisparity = minDisparity; } + int getMinDisparity() const CV_OVERRIDE { return params.minDisparity; } + void setMinDisparity(int minDisparity) CV_OVERRIDE { params.minDisparity = minDisparity; } - int getNumDisparities() const { return params.numDisparities; } - void setNumDisparities(int numDisparities) { params.numDisparities = numDisparities; } + int getNumDisparities() const CV_OVERRIDE { return params.numDisparities; } + void setNumDisparities(int numDisparities) CV_OVERRIDE { params.numDisparities = numDisparities; } - int getBlockSize() const { return params.SADWindowSize; } - void setBlockSize(int blockSize) { params.SADWindowSize = blockSize; } + int getBlockSize() const CV_OVERRIDE { return params.SADWindowSize; } + void setBlockSize(int blockSize) CV_OVERRIDE { params.SADWindowSize = blockSize; } - int getSpeckleWindowSize() const { return params.speckleWindowSize; } - void setSpeckleWindowSize(int speckleWindowSize) { params.speckleWindowSize = speckleWindowSize; } + int getSpeckleWindowSize() const CV_OVERRIDE { return params.speckleWindowSize; } + void setSpeckleWindowSize(int speckleWindowSize) CV_OVERRIDE { params.speckleWindowSize = speckleWindowSize; } - int getSpeckleRange() const { return params.speckleRange; } - void setSpeckleRange(int speckleRange) { params.speckleRange = speckleRange; } + int getSpeckleRange() const CV_OVERRIDE { return params.speckleRange; } + void setSpeckleRange(int speckleRange) CV_OVERRIDE { params.speckleRange = speckleRange; } - int getDisp12MaxDiff() const { return params.disp12MaxDiff; } - void setDisp12MaxDiff(int disp12MaxDiff) { params.disp12MaxDiff = disp12MaxDiff; } + int getDisp12MaxDiff() const CV_OVERRIDE { return params.disp12MaxDiff; } + void setDisp12MaxDiff(int disp12MaxDiff) CV_OVERRIDE { params.disp12MaxDiff = disp12MaxDiff; } - int getPreFilterType() const { return params.preFilterType; } - void setPreFilterType(int preFilterType) { params.preFilterType = preFilterType; } + int getPreFilterType() const CV_OVERRIDE { return params.preFilterType; } + void setPreFilterType(int preFilterType) CV_OVERRIDE { params.preFilterType = preFilterType; } - int getPreFilterSize() const { return params.preFilterSize; } - void setPreFilterSize(int preFilterSize) { params.preFilterSize = preFilterSize; } + int getPreFilterSize() const CV_OVERRIDE { return params.preFilterSize; } + void setPreFilterSize(int preFilterSize) CV_OVERRIDE { params.preFilterSize = preFilterSize; } - int getPreFilterCap() const { return params.preFilterCap; } - void setPreFilterCap(int preFilterCap) { params.preFilterCap = preFilterCap; } + int getPreFilterCap() const CV_OVERRIDE { return params.preFilterCap; } + void setPreFilterCap(int preFilterCap) CV_OVERRIDE { params.preFilterCap = preFilterCap; } - int getTextureThreshold() const { return params.textureThreshold; } - void setTextureThreshold(int textureThreshold) { params.textureThreshold = textureThreshold; } + int getTextureThreshold() const CV_OVERRIDE { return params.textureThreshold; } + void setTextureThreshold(int textureThreshold) CV_OVERRIDE { params.textureThreshold = textureThreshold; } - int getUniquenessRatio() const { return params.uniquenessRatio; } - void setUniquenessRatio(int uniquenessRatio) { params.uniquenessRatio = uniquenessRatio; } + int getUniquenessRatio() const CV_OVERRIDE { return params.uniquenessRatio; } + void setUniquenessRatio(int uniquenessRatio) CV_OVERRIDE { params.uniquenessRatio = uniquenessRatio; } - int getSmallerBlockSize() const { return 0; } - void setSmallerBlockSize(int) {} + int getSmallerBlockSize() const CV_OVERRIDE { return 0; } + void setSmallerBlockSize(int) CV_OVERRIDE {} - Rect getROI1() const { return params.roi1; } - void setROI1(Rect roi1) { params.roi1 = roi1; } + Rect getROI1() const CV_OVERRIDE { return params.roi1; } + void setROI1(Rect roi1) CV_OVERRIDE { params.roi1 = roi1; } - Rect getROI2() const { return params.roi2; } - void setROI2(Rect roi2) { params.roi2 = roi2; } + Rect getROI2() const CV_OVERRIDE { return params.roi2; } + void setROI2(Rect roi2) CV_OVERRIDE { params.roi2 = roi2; } - void write(FileStorage& fs) const + void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name_ @@ -1260,7 +1260,7 @@ public: << "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/calib3d/src/stereosgbm.cpp b/modules/calib3d/src/stereosgbm.cpp index d1a4a6afc1..b6489bf0e2 100644 --- a/modules/calib3d/src/stereosgbm.cpp +++ b/modules/calib3d/src/stereosgbm.cpp @@ -871,7 +871,7 @@ struct CalcVerticalSums: public ParallelLoopBody useSIMD = hasSIMD128(); } - void operator()( const Range& range ) const + void operator()(const Range& range) const CV_OVERRIDE { static const CostType MAX_COST = SHRT_MAX; static const int ALIGN = 16; @@ -1152,7 +1152,7 @@ struct CalcHorizontalSums: public ParallelLoopBody useSIMD = hasSIMD128(); } - void operator()( const Range& range ) const + void operator()(const Range& range) const CV_OVERRIDE { int y1 = range.start, y2 = range.end; size_t auxBufsSize = LrSize * sizeof(CostType) + width*(sizeof(CostType) + sizeof(DispType)) + 32; @@ -1542,7 +1542,7 @@ struct SGBM3WayMainLoop : public ParallelLoopBody SGBM3WayMainLoop(Mat *_buffers, const Mat& _img1, const Mat& _img2, Mat* _dst_disp, const StereoSGBMParams& params, PixType* _clipTab, int _nstripes, int _stripe_overlap); void getRawMatchingCost(CostType* C, CostType* hsumBuf, CostType* pixDiff, PixType* tmpBuf, int y, int src_start_idx) const; - void operator () (const Range& range) const; + void operator () (const Range& range) const CV_OVERRIDE; }; SGBM3WayMainLoop::SGBM3WayMainLoop(Mat *_buffers, const Mat& _img1, const Mat& _img2, Mat* _dst_disp, const StereoSGBMParams& params, PixType* _clipTab, int _nstripes, int _stripe_overlap): @@ -2128,7 +2128,7 @@ static void computeDisparity3WaySGBM( const Mat& img1, const Mat& img2, delete[] dst_disp; } -class StereoSGBMImpl : public StereoSGBM +class StereoSGBMImpl CV_FINAL : public StereoSGBM { public: StereoSGBMImpl() @@ -2147,7 +2147,7 @@ public: _mode ); } - void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr ) + void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr ) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -2172,40 +2172,40 @@ public: StereoMatcher::DISP_SCALE*params.speckleRange, buffer); } - int getMinDisparity() const { return params.minDisparity; } - void setMinDisparity(int minDisparity) { params.minDisparity = minDisparity; } + int getMinDisparity() const CV_OVERRIDE { return params.minDisparity; } + void setMinDisparity(int minDisparity) CV_OVERRIDE { params.minDisparity = minDisparity; } - int getNumDisparities() const { return params.numDisparities; } - void setNumDisparities(int numDisparities) { params.numDisparities = numDisparities; } + int getNumDisparities() const CV_OVERRIDE { return params.numDisparities; } + void setNumDisparities(int numDisparities) CV_OVERRIDE { params.numDisparities = numDisparities; } - int getBlockSize() const { return params.SADWindowSize; } - void setBlockSize(int blockSize) { params.SADWindowSize = blockSize; } + int getBlockSize() const CV_OVERRIDE { return params.SADWindowSize; } + void setBlockSize(int blockSize) CV_OVERRIDE { params.SADWindowSize = blockSize; } - int getSpeckleWindowSize() const { return params.speckleWindowSize; } - void setSpeckleWindowSize(int speckleWindowSize) { params.speckleWindowSize = speckleWindowSize; } + int getSpeckleWindowSize() const CV_OVERRIDE { return params.speckleWindowSize; } + void setSpeckleWindowSize(int speckleWindowSize) CV_OVERRIDE { params.speckleWindowSize = speckleWindowSize; } - int getSpeckleRange() const { return params.speckleRange; } - void setSpeckleRange(int speckleRange) { params.speckleRange = speckleRange; } + int getSpeckleRange() const CV_OVERRIDE { return params.speckleRange; } + void setSpeckleRange(int speckleRange) CV_OVERRIDE { params.speckleRange = speckleRange; } - int getDisp12MaxDiff() const { return params.disp12MaxDiff; } - void setDisp12MaxDiff(int disp12MaxDiff) { params.disp12MaxDiff = disp12MaxDiff; } + int getDisp12MaxDiff() const CV_OVERRIDE { return params.disp12MaxDiff; } + void setDisp12MaxDiff(int disp12MaxDiff) CV_OVERRIDE { params.disp12MaxDiff = disp12MaxDiff; } - int getPreFilterCap() const { return params.preFilterCap; } - void setPreFilterCap(int preFilterCap) { params.preFilterCap = preFilterCap; } + int getPreFilterCap() const CV_OVERRIDE { return params.preFilterCap; } + void setPreFilterCap(int preFilterCap) CV_OVERRIDE { params.preFilterCap = preFilterCap; } - int getUniquenessRatio() const { return params.uniquenessRatio; } - void setUniquenessRatio(int uniquenessRatio) { params.uniquenessRatio = uniquenessRatio; } + int getUniquenessRatio() const CV_OVERRIDE { return params.uniquenessRatio; } + void setUniquenessRatio(int uniquenessRatio) CV_OVERRIDE { params.uniquenessRatio = uniquenessRatio; } - int getP1() const { return params.P1; } - void setP1(int P1) { params.P1 = P1; } + int getP1() const CV_OVERRIDE { return params.P1; } + void setP1(int P1) CV_OVERRIDE { params.P1 = P1; } - int getP2() const { return params.P2; } - void setP2(int P2) { params.P2 = P2; } + int getP2() const CV_OVERRIDE { return params.P2; } + void setP2(int P2) CV_OVERRIDE { 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 { writeFormat(fs); fs << "name" << name_ @@ -2222,7 +2222,7 @@ public: << "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/core/include/opencv2/core.hpp b/modules/core/include/opencv2/core.hpp index b5beb7d2ea..216a8bcc92 100644 --- a/modules/core/include/opencv2/core.hpp +++ b/modules/core/include/opencv2/core.hpp @@ -124,7 +124,7 @@ public: /*! \return the error description and the context as a text string. */ - virtual const char *what() const throw(); + virtual const char *what() const throw() CV_OVERRIDE; void formatMessage(); String msg; ///< the formatted error message diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h index c073d652af..a87ced09d7 100644 --- a/modules/core/include/opencv2/core/cvdef.h +++ b/modules/core/include/opencv2/core/cvdef.h @@ -453,6 +453,30 @@ Cv64suf; #endif +/****************************************************************************************\ +* C++11 override / final * +\****************************************************************************************/ + +#ifndef CV_OVERRIDE +# ifdef CV_CXX11 +# define CV_OVERRIDE override +# endif +#endif +#ifndef CV_OVERRIDE +# define CV_OVERRIDE +#endif + +#ifndef CV_FINAL +# ifdef CV_CXX11 +# define CV_FINAL final +# endif +#endif +#ifndef CV_FINAL +# define CV_FINAL +#endif + + + // Integer types portatibility #ifdef OPENCV_STDINT_HEADER #include OPENCV_STDINT_HEADER diff --git a/modules/core/include/opencv2/core/private.hpp b/modules/core/include/opencv2/core/private.hpp index 5f4ffceeef..351b95b61d 100644 --- a/modules/core/include/opencv2/core/private.hpp +++ b/modules/core/include/opencv2/core/private.hpp @@ -165,6 +165,8 @@ template T* allocSingleton(size_t count) { return static_cast(fastMalloc(sizeof(T) * count)); } } +#if 1 // TODO: Remove in OpenCV 4.x + // property implementation macros #define CV_IMPL_PROPERTY_RO(type, name, member) \ @@ -187,6 +189,8 @@ T* allocSingleton(size_t count) { return static_cast(fastMalloc(sizeof(T) * #define CV_WRAP_SAME_PROPERTY(type, name, internal_obj) CV_WRAP_PROPERTY(type, name, name, internal_obj) #define CV_WRAP_SAME_PROPERTY_S(type, name, internal_obj) CV_WRAP_PROPERTY_S(type, name, name, internal_obj) +#endif + /****************************************************************************************\ * Structures and macros for integration with IPP * \****************************************************************************************/ @@ -233,8 +237,15 @@ T* allocSingleton(size_t count) { return static_cast(fastMalloc(sizeof(T) * #include "ipp.h" #endif #ifdef HAVE_IPP_IW +# if defined(__OPENCV_BUILD) && defined(__GNUC__) && __GNUC__ >= 5 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wsuggest-override" +# endif #include "iw++/iw.hpp" #include "iw/iw_ll.h" +# if defined(__OPENCV_BUILD) && defined(__GNUC__) && __GNUC__ >= 5 +# pragma GCC diagnostic pop +# endif #endif #if IPP_VERSION_X100 >= 201700 diff --git a/modules/core/include/opencv2/core/ptr.inl.hpp b/modules/core/include/opencv2/core/ptr.inl.hpp index 3c095a1f58..466f6342ec 100644 --- a/modules/core/include/opencv2/core/ptr.inl.hpp +++ b/modules/core/include/opencv2/core/ptr.inl.hpp @@ -89,12 +89,12 @@ private: }; template -struct PtrOwnerImpl : PtrOwner +struct PtrOwnerImpl CV_FINAL : PtrOwner { PtrOwnerImpl(Y* p, D d) : owned(p), deleter(d) {} - void deleteSelf() + void deleteSelf() CV_OVERRIDE { deleter(owned); delete this; diff --git a/modules/core/include/opencv2/core/utility.hpp b/modules/core/include/opencv2/core/utility.hpp index 00bb68cce3..d7211d05bf 100644 --- a/modules/core/include/opencv2/core/utility.hpp +++ b/modules/core/include/opencv2/core/utility.hpp @@ -524,7 +524,7 @@ public: m_functor(functor) { } - virtual void operator() (const cv::Range& range) const + virtual void operator() (const cv::Range& range) const CV_OVERRIDE { m_functor(range); } @@ -558,7 +558,8 @@ void Mat::forEach_impl(const Functor& operation) { virtual ~PixelOperationWrapper(){} // ! Overloaded virtual operator // convert range call to row call. - virtual void operator()(const Range &range) const { + virtual void operator()(const Range &range) const CV_OVERRIDE + { const int DIMS = mat->dims; const int COLS = mat->size[DIMS - 1]; if (DIMS <= 2) { @@ -711,8 +712,8 @@ public: inline void cleanup() { TLSDataContainer::cleanup(); } private: - virtual void* createDataInstance() const {return new T;} // Wrapper to allocate data by template - virtual void deleteDataInstance(void* pData) const {delete (T*)pData;} // Wrapper to release data by template + virtual void* createDataInstance() const CV_OVERRIDE {return new T;} // Wrapper to allocate data by template + virtual void deleteDataInstance(void* pData) const CV_OVERRIDE {delete (T*)pData;} // Wrapper to release data by template // Disable TLS copy operations TLSData(TLSData &) {} diff --git a/modules/core/src/batch_distance.cpp b/modules/core/src/batch_distance.cpp index c59ff78a07..807b7f0285 100644 --- a/modules/core/src/batch_distance.cpp +++ b/modules/core/src/batch_distance.cpp @@ -176,7 +176,7 @@ struct BatchDistInvoker : public ParallelLoopBody func = _func; } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { AutoBuffer buf(src2->rows); int* bufptr = buf; diff --git a/modules/core/src/bufferpool.impl.hpp b/modules/core/src/bufferpool.impl.hpp index 18a90e0691..0dcb31ac74 100644 --- a/modules/core/src/bufferpool.impl.hpp +++ b/modules/core/src/bufferpool.impl.hpp @@ -17,10 +17,10 @@ public: DummyBufferPoolController() { } virtual ~DummyBufferPoolController() { } - virtual size_t getReservedSize() const { return (size_t)-1; } - virtual size_t getMaxReservedSize() const { return (size_t)-1; } - virtual void setMaxReservedSize(size_t size) { (void)size; } - virtual void freeAllReservedBuffers() { } + virtual size_t getReservedSize() const CV_OVERRIDE { return (size_t)-1; } + virtual size_t getMaxReservedSize() const CV_OVERRIDE { return (size_t)-1; } + virtual void setMaxReservedSize(size_t size) CV_OVERRIDE { (void)size; } + virtual void freeAllReservedBuffers() CV_OVERRIDE { } }; } // namespace diff --git a/modules/core/src/conjugate_gradient.cpp b/modules/core/src/conjugate_gradient.cpp index 3e6cffbbb2..400a5ab3a8 100644 --- a/modules/core/src/conjugate_gradient.cpp +++ b/modules/core/src/conjugate_gradient.cpp @@ -68,15 +68,15 @@ namespace cv #define SEC_METHOD_ITERATIONS 4 #define INITIAL_SEC_METHOD_SIGMA 0.1 - class ConjGradSolverImpl : public ConjGradSolver + class ConjGradSolverImpl CV_FINAL : public ConjGradSolver { public: - Ptr getFunction() const; - void setFunction(const Ptr& f); - TermCriteria getTermCriteria() const; + Ptr getFunction() const CV_OVERRIDE; + void setFunction(const Ptr& f) CV_OVERRIDE; + TermCriteria getTermCriteria() const CV_OVERRIDE; ConjGradSolverImpl(); - void setTermCriteria(const TermCriteria& termcrit); - double minimize(InputOutputArray x); + void setTermCriteria(const TermCriteria& termcrit) CV_OVERRIDE; + double minimize(InputOutputArray x) CV_OVERRIDE; protected: Ptr _Function; TermCriteria _termcrit; diff --git a/modules/core/src/downhill_simplex.cpp b/modules/core/src/downhill_simplex.cpp index a830d02812..15d6469465 100644 --- a/modules/core/src/downhill_simplex.cpp +++ b/modules/core/src/downhill_simplex.cpp @@ -140,7 +140,7 @@ multiple lines in three dimensions as not all lines intersect in three dimension namespace cv { -class DownhillSolverImpl : public DownhillSolver +class DownhillSolverImpl CV_FINAL : public DownhillSolver { public: DownhillSolverImpl() @@ -149,8 +149,8 @@ public: _step=Mat_(); } - void getInitStep(OutputArray step) const { _step.copyTo(step); } - void setInitStep(InputArray step) + void getInitStep(OutputArray step) const CV_OVERRIDE { _step.copyTo(step); } + void setInitStep(InputArray step) CV_OVERRIDE { // set dimensionality and make a deep copy of step Mat m = step.getMat(); @@ -161,13 +161,13 @@ public: transpose(m, _step); } - Ptr getFunction() const { return _Function; } + Ptr getFunction() const CV_OVERRIDE { return _Function; } - void setFunction(const Ptr& f) { _Function=f; } + void setFunction(const Ptr& f) CV_OVERRIDE { _Function=f; } - TermCriteria getTermCriteria() const { return _termcrit; } + TermCriteria getTermCriteria() const CV_OVERRIDE { return _termcrit; } - void setTermCriteria( const TermCriteria& termcrit ) + void setTermCriteria( const TermCriteria& termcrit ) CV_OVERRIDE { CV_Assert( termcrit.type == (TermCriteria::MAX_ITER + TermCriteria::EPS) && termcrit.epsilon > 0 && @@ -175,7 +175,7 @@ public: _termcrit=termcrit; } - double minimize( InputOutputArray x_ ) + double minimize( InputOutputArray x_ ) CV_OVERRIDE { dprintf(("hi from minimize\n")); CV_Assert( !_Function.empty() ); diff --git a/modules/core/src/dxt.cpp b/modules/core/src/dxt.cpp index d7374e2388..a161f86885 100644 --- a/modules/core/src/dxt.cpp +++ b/modules/core/src/dxt.cpp @@ -1562,7 +1562,7 @@ public: *ok = true; } - virtual void operator()(const Range& range) const + virtual void operator()(const Range& range) const CV_OVERRIDE { IppStatus status; Ipp8u* pBuffer = 0; @@ -1643,7 +1643,7 @@ public: *ok = true; } - virtual void operator()(const Range& range) const + virtual void operator()(const Range& range) const CV_OVERRIDE { IppStatus status; Ipp8u* pBuffer = 0; @@ -2607,7 +2607,7 @@ inline DftDims determineDims(int rows, int cols, bool isRowWise, bool isContinuo return InvalidDim; } -class OcvDftImpl : public hal::DFT2D +class OcvDftImpl CV_FINAL : public hal::DFT2D { protected: Ptr contextA; @@ -2779,7 +2779,7 @@ public: } } - void apply(const uchar * src, size_t src_step, uchar * dst, size_t dst_step) + void apply(const uchar * src, size_t src_step, uchar * dst, size_t dst_step) CV_OVERRIDE { #if defined USE_IPP_DFT if (useIpp) @@ -3039,7 +3039,7 @@ protected: } }; -class OcvDftBasicImpl : public hal::DFT1D +class OcvDftBasicImpl CV_FINAL : public hal::DFT1D { public: OcvDftOptions opt; @@ -3194,7 +3194,7 @@ public: } } - void apply(const uchar *src, uchar *dst) + void apply(const uchar *src, uchar *dst) CV_OVERRIDE { opt.dft_func(opt, src, dst); } @@ -3214,7 +3214,7 @@ struct ReplacementDFT1D : public hal::DFT1D isInitialized = (res == CV_HAL_ERROR_OK); return isInitialized; } - void apply(const uchar *src, uchar *dst) + void apply(const uchar *src, uchar *dst) CV_OVERRIDE { if (isInitialized) { @@ -3244,7 +3244,7 @@ struct ReplacementDFT2D : public hal::DFT2D isInitialized = (res == CV_HAL_ERROR_OK); return isInitialized; } - void apply(const uchar *src, size_t src_step, uchar *dst, size_t dst_step) + void apply(const uchar *src, size_t src_step, uchar *dst, size_t dst_step) CV_OVERRIDE { if (isInitialized) { @@ -3809,7 +3809,7 @@ public: *ok = true; } - virtual void operator()(const Range& range) const + virtual void operator()(const Range& range) const CV_OVERRIDE { if(*ok == false) return; @@ -4048,7 +4048,7 @@ static bool ippi_DCT_32f(const uchar * src, size_t src_step, uchar * dst, size_t namespace cv { -class OcvDctImpl : public hal::DCT2D +class OcvDctImpl CV_FINAL : public hal::DCT2D { public: OcvDftOptions opt; @@ -4100,7 +4100,7 @@ public: end_stage = 1; } } - void apply(const uchar *src, size_t src_step, uchar *dst, size_t dst_step) + void apply(const uchar *src, size_t src_step, uchar *dst, size_t dst_step) CV_OVERRIDE { CV_IPP_RUN(IPP_VERSION_X100 >= 700 && depth == CV_32F, ippi_DCT_32f(src, src_step, dst, dst_step, width, height, isInverse, isRowTransform)) @@ -4196,7 +4196,7 @@ struct ReplacementDCT2D : public hal::DCT2D isInitialized = (res == CV_HAL_ERROR_OK); return isInitialized; } - void apply(const uchar *src_data, size_t src_step, uchar *dst_data, size_t dst_step) + void apply(const uchar *src_data, size_t src_step, uchar *dst_data, size_t dst_step) CV_OVERRIDE { if (isInitialized) { diff --git a/modules/core/src/kmeans.cpp b/modules/core/src/kmeans.cpp index 9613971d6b..6b1a110c1f 100644 --- a/modules/core/src/kmeans.cpp +++ b/modules/core/src/kmeans.cpp @@ -65,7 +65,7 @@ public: tdist2(tdist2_), data(data_), dist(dist_), ci(ci_) { } - void operator()( const cv::Range& range ) const + void operator()( const cv::Range& range ) const CV_OVERRIDE { CV_TRACE_FUNCTION(); const int begin = range.start; @@ -171,7 +171,7 @@ public: { } - void operator()( const Range& range ) const + void operator()(const Range& range) const CV_OVERRIDE { CV_TRACE_FUNCTION(); const int begin = range.start; diff --git a/modules/core/src/lut.cpp b/modules/core/src/lut.cpp index fb6386524a..71f06ea5b2 100644 --- a/modules/core/src/lut.cpp +++ b/modules/core/src/lut.cpp @@ -328,7 +328,7 @@ public: *ok = (func != NULL); } - void operator()( const cv::Range& range ) const + void operator()( const cv::Range& range ) const CV_OVERRIDE { CV_DbgAssert(*ok); diff --git a/modules/core/src/matrix.cpp b/modules/core/src/matrix.cpp index 8984dc99ec..f9c4044614 100644 --- a/modules/core/src/matrix.cpp +++ b/modules/core/src/matrix.cpp @@ -123,11 +123,11 @@ BufferPoolController* MatAllocator::getBufferPoolController(const char* id) cons return &dummy; } -class StdMatAllocator : public MatAllocator +class StdMatAllocator CV_FINAL : public MatAllocator { public: UMatData* allocate(int dims, const int* sizes, int type, - void* data0, size_t* step, int /*flags*/, UMatUsageFlags /*usageFlags*/) const + void* data0, size_t* step, int /*flags*/, UMatUsageFlags /*usageFlags*/) const CV_OVERRIDE { size_t total = CV_ELEM_SIZE(type); for( int i = dims-1; i >= 0; i-- ) @@ -154,13 +154,13 @@ public: return u; } - bool allocate(UMatData* u, int /*accessFlags*/, UMatUsageFlags /*usageFlags*/) const + bool allocate(UMatData* u, int /*accessFlags*/, UMatUsageFlags /*usageFlags*/) const CV_OVERRIDE { if(!u) return false; return true; } - void deallocate(UMatData* u) const + void deallocate(UMatData* u) const CV_OVERRIDE { if(!u) return; diff --git a/modules/core/src/matrix_expressions.cpp b/modules/core/src/matrix_expressions.cpp index 5287bf585e..88d471f383 100644 --- a/modules/core/src/matrix_expressions.cpp +++ b/modules/core/src/matrix_expressions.cpp @@ -14,53 +14,53 @@ namespace cv { -class MatOp_Identity : public MatOp +class MatOp_Identity CV_FINAL : public MatOp { public: MatOp_Identity() {} virtual ~MatOp_Identity() {} - bool elementWise(const MatExpr& /*expr*/) const { return true; } - void assign(const MatExpr& expr, Mat& m, int type=-1) const; + bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return true; } + void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE; static void makeExpr(MatExpr& res, const Mat& m); }; static MatOp_Identity g_MatOp_Identity; -class MatOp_AddEx : public MatOp +class MatOp_AddEx CV_FINAL : public MatOp { public: MatOp_AddEx() {} virtual ~MatOp_AddEx() {} - bool elementWise(const MatExpr& /*expr*/) const { return true; } - void assign(const MatExpr& expr, Mat& m, int type=-1) const; + bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return true; } + void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE; - void add(const MatExpr& e1, const Scalar& s, MatExpr& res) const; - void subtract(const Scalar& s, const MatExpr& expr, MatExpr& res) const; - void multiply(const MatExpr& e1, double s, MatExpr& res) const; - void divide(double s, const MatExpr& e, MatExpr& res) const; + void add(const MatExpr& e1, const Scalar& s, MatExpr& res) const CV_OVERRIDE; + void subtract(const Scalar& s, const MatExpr& expr, MatExpr& res) const CV_OVERRIDE; + void multiply(const MatExpr& e1, double s, MatExpr& res) const CV_OVERRIDE; + void divide(double s, const MatExpr& e, MatExpr& res) const CV_OVERRIDE; - void transpose(const MatExpr& e1, MatExpr& res) const; - void abs(const MatExpr& expr, MatExpr& res) const; + void transpose(const MatExpr& e1, MatExpr& res) const CV_OVERRIDE; + void abs(const MatExpr& expr, MatExpr& res) const CV_OVERRIDE; static void makeExpr(MatExpr& res, const Mat& a, const Mat& b, double alpha, double beta, const Scalar& s=Scalar()); }; static MatOp_AddEx g_MatOp_AddEx; -class MatOp_Bin : public MatOp +class MatOp_Bin CV_FINAL : public MatOp { public: MatOp_Bin() {} virtual ~MatOp_Bin() {} - bool elementWise(const MatExpr& /*expr*/) const { return true; } - void assign(const MatExpr& expr, Mat& m, int type=-1) const; + bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return true; } + void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE; - void multiply(const MatExpr& e1, double s, MatExpr& res) const; - void divide(double s, const MatExpr& e, MatExpr& res) const; + void multiply(const MatExpr& e1, double s, MatExpr& res) const CV_OVERRIDE; + void divide(double s, const MatExpr& e, MatExpr& res) const CV_OVERRIDE; static void makeExpr(MatExpr& res, char op, const Mat& a, const Mat& b, double scale=1); static void makeExpr(MatExpr& res, char op, const Mat& a, const Scalar& s); @@ -68,14 +68,14 @@ public: static MatOp_Bin g_MatOp_Bin; -class MatOp_Cmp : public MatOp +class MatOp_Cmp CV_FINAL : public MatOp { public: MatOp_Cmp() {} virtual ~MatOp_Cmp() {} - bool elementWise(const MatExpr& /*expr*/) const { return true; } - void assign(const MatExpr& expr, Mat& m, int type=-1) const; + bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return true; } + void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE; static void makeExpr(MatExpr& res, int cmpop, const Mat& a, const Mat& b); static void makeExpr(MatExpr& res, int cmpop, const Mat& a, double alpha); @@ -83,20 +83,20 @@ public: static MatOp_Cmp g_MatOp_Cmp; -class MatOp_GEMM : public MatOp +class MatOp_GEMM CV_FINAL : public MatOp { public: MatOp_GEMM() {} virtual ~MatOp_GEMM() {} - bool elementWise(const MatExpr& /*expr*/) const { return false; } - void assign(const MatExpr& expr, Mat& m, int type=-1) const; + bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return false; } + void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE; - void add(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const; - void subtract(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const; - void multiply(const MatExpr& e, double s, MatExpr& res) const; + void add(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const CV_OVERRIDE; + void subtract(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const CV_OVERRIDE; + void multiply(const MatExpr& e, double s, MatExpr& res) const CV_OVERRIDE; - void transpose(const MatExpr& expr, MatExpr& res) const; + void transpose(const MatExpr& expr, MatExpr& res) const CV_OVERRIDE; static void makeExpr(MatExpr& res, int flags, const Mat& a, const Mat& b, double alpha=1, const Mat& c=Mat(), double beta=1); @@ -104,63 +104,63 @@ public: static MatOp_GEMM g_MatOp_GEMM; -class MatOp_Invert : public MatOp +class MatOp_Invert CV_FINAL : public MatOp { public: MatOp_Invert() {} virtual ~MatOp_Invert() {} - bool elementWise(const MatExpr& /*expr*/) const { return false; } - void assign(const MatExpr& expr, Mat& m, int type=-1) const; + bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return false; } + void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE; - void matmul(const MatExpr& expr1, const MatExpr& expr2, MatExpr& res) const; + void matmul(const MatExpr& expr1, const MatExpr& expr2, MatExpr& res) const CV_OVERRIDE; static void makeExpr(MatExpr& res, int method, const Mat& m); }; static MatOp_Invert g_MatOp_Invert; -class MatOp_T : public MatOp +class MatOp_T CV_FINAL : public MatOp { public: MatOp_T() {} virtual ~MatOp_T() {} - bool elementWise(const MatExpr& /*expr*/) const { return false; } - void assign(const MatExpr& expr, Mat& m, int type=-1) const; + bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return false; } + void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE; - void multiply(const MatExpr& e1, double s, MatExpr& res) const; - void transpose(const MatExpr& expr, MatExpr& res) const; + void multiply(const MatExpr& e1, double s, MatExpr& res) const CV_OVERRIDE; + void transpose(const MatExpr& expr, MatExpr& res) const CV_OVERRIDE; static void makeExpr(MatExpr& res, const Mat& a, double alpha=1); }; static MatOp_T g_MatOp_T; -class MatOp_Solve : public MatOp +class MatOp_Solve CV_FINAL : public MatOp { public: MatOp_Solve() {} virtual ~MatOp_Solve() {} - bool elementWise(const MatExpr& /*expr*/) const { return false; } - void assign(const MatExpr& expr, Mat& m, int type=-1) const; + bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return false; } + void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE; static void makeExpr(MatExpr& res, int method, const Mat& a, const Mat& b); }; static MatOp_Solve g_MatOp_Solve; -class MatOp_Initializer : public MatOp +class MatOp_Initializer CV_FINAL : public MatOp { public: MatOp_Initializer() {} virtual ~MatOp_Initializer() {} - bool elementWise(const MatExpr& /*expr*/) const { return false; } - void assign(const MatExpr& expr, Mat& m, int type=-1) const; + bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return false; } + void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE; - void multiply(const MatExpr& e, double s, MatExpr& res) const; + void multiply(const MatExpr& e, double s, MatExpr& res) const CV_OVERRIDE; static void makeExpr(MatExpr& res, int method, Size sz, int type, double alpha=1); static void makeExpr(MatExpr& res, int method, int ndims, const int* sizes, int type, double alpha=1); diff --git a/modules/core/src/ocl.cpp b/modules/core/src/ocl.cpp index e17464e3cb..cc659302e7 100644 --- a/modules/core/src/ocl.cpp +++ b/modules/core/src/ocl.cpp @@ -4178,7 +4178,7 @@ public: CV_Assert(reservedEntries_.empty()); } public: - virtual T allocate(size_t size) + virtual T allocate(size_t size) CV_OVERRIDE { AutoLock locker(mutex_); BufferEntry entry; @@ -4193,7 +4193,7 @@ public: } return entry.clBuffer_; } - virtual void release(T buffer) + virtual void release(T buffer) CV_OVERRIDE { AutoLock locker(mutex_); BufferEntry entry; @@ -4210,9 +4210,9 @@ public: } } - virtual size_t getReservedSize() const { return currentReservedSize; } - virtual size_t getMaxReservedSize() const { return maxReservedSize; } - virtual void setMaxReservedSize(size_t size) + virtual size_t getReservedSize() const CV_OVERRIDE { return currentReservedSize; } + virtual size_t getMaxReservedSize() const CV_OVERRIDE { return maxReservedSize; } + virtual void setMaxReservedSize(size_t size) CV_OVERRIDE { AutoLock locker(mutex_); size_t oldMaxReservedSize = maxReservedSize; @@ -4236,7 +4236,7 @@ public: _checkSizeOfReservedEntries(); } } - virtual void freeAllReservedBuffers() + virtual void freeAllReservedBuffers() CV_OVERRIDE { AutoLock locker(mutex_); typename std::list::const_iterator i = reservedEntries_.begin(); @@ -4257,7 +4257,7 @@ struct CLBufferEntry CLBufferEntry() : clBuffer_((cl_mem)NULL), capacity_(0) { } }; -class OpenCLBufferPoolImpl : public OpenCLBufferPoolBaseImpl +class OpenCLBufferPoolImpl CV_FINAL : public OpenCLBufferPoolBaseImpl { public: typedef struct CLBufferEntry BufferEntry; @@ -4303,7 +4303,7 @@ struct CLSVMBufferEntry size_t capacity_; CLSVMBufferEntry() : clBuffer_(NULL), capacity_(0) { } }; -class OpenCLSVMBufferPoolImpl : public OpenCLBufferPoolBaseImpl +class OpenCLSVMBufferPoolImpl CV_FINAL : public OpenCLBufferPoolBaseImpl { public: typedef struct CLSVMBufferEntry BufferEntry; @@ -4465,7 +4465,7 @@ private: #define CV_OPENCL_DATA_PTR_ALIGNMENT 16 #endif -class OpenCLAllocator : public MatAllocator +class OpenCLAllocator CV_FINAL : public MatAllocator { mutable OpenCLBufferPoolImpl bufferPool; mutable OpenCLBufferPoolImpl bufferPoolHostPtr; @@ -4525,7 +4525,7 @@ public: } UMatData* allocate(int dims, const int* sizes, int type, - void* data, size_t* step, int flags, UMatUsageFlags usageFlags) const + void* data, size_t* step, int flags, UMatUsageFlags usageFlags) const CV_OVERRIDE { if(!useOpenCL()) return defaultAllocate(dims, sizes, type, data, step, flags, usageFlags); @@ -4589,7 +4589,7 @@ public: return u; } - bool allocate(UMatData* u, int accessFlags, UMatUsageFlags usageFlags) const + bool allocate(UMatData* u, int accessFlags, UMatUsageFlags usageFlags) const CV_OVERRIDE { if(!u) return false; @@ -4721,7 +4721,7 @@ public: } }*/ - void deallocate(UMatData* u) const + void deallocate(UMatData* u) const CV_OVERRIDE { if(!u) return; @@ -4905,7 +4905,7 @@ public: } // synchronized call (external UMatDataAutoLock, see UMat::getMat) - void map(UMatData* u, int accessFlags) const + void map(UMatData* u, int accessFlags) const CV_OVERRIDE { CV_Assert(u && u->handle); @@ -4988,7 +4988,7 @@ public: } } - void unmap(UMatData* u) const + void unmap(UMatData* u) const CV_OVERRIDE { if(!u) return; @@ -5133,7 +5133,7 @@ public: void download(UMatData* u, void* dstptr, int dims, const size_t sz[], const size_t srcofs[], const size_t srcstep[], - const size_t dststep[]) const + const size_t dststep[]) const CV_OVERRIDE { if(!u) return; @@ -5256,7 +5256,7 @@ public: void upload(UMatData* u, const void* srcptr, int dims, const size_t sz[], const size_t dstofs[], const size_t dststep[], - const size_t srcstep[]) const + const size_t srcstep[]) const CV_OVERRIDE { if(!u) return; @@ -5408,7 +5408,7 @@ public: void copy(UMatData* src, UMatData* dst, int dims, const size_t sz[], const size_t srcofs[], const size_t srcstep[], - const size_t dstofs[], const size_t dststep[], bool _sync) const + const size_t dstofs[], const size_t dststep[], bool _sync) const CV_OVERRIDE { if(!src || !dst) return; @@ -5596,7 +5596,7 @@ public: } } - BufferPoolController* getBufferPoolController(const char* id) const { + BufferPoolController* getBufferPoolController(const char* id) const CV_OVERRIDE { #ifdef HAVE_OPENCL_SVM if ((svm::checkForceSVMUmatUsage() && (id == NULL || strcmp(id, "OCL") == 0)) || (id != NULL && strcmp(id, "SVM") == 0)) { diff --git a/modules/core/src/out.cpp b/modules/core/src/out.cpp index 77c55aba82..9f28654358 100644 --- a/modules/core/src/out.cpp +++ b/modules/core/src/out.cpp @@ -45,7 +45,7 @@ namespace cv { - class FormattedImpl : public Formatted + class FormattedImpl CV_FINAL : public Formatted { enum { STATE_PROLOGUE, STATE_EPILOGUE, STATE_INTERLUDE, STATE_ROW_OPEN, STATE_ROW_CLOSE, STATE_CN_OPEN, STATE_CN_CLOSE, STATE_VALUE, STATE_FINISHED, @@ -119,12 +119,12 @@ namespace cv } } - void reset() + void reset() CV_OVERRIDE { state = STATE_PROLOGUE; } - const char* next() + const char* next() CV_OVERRIDE { switch(state) { @@ -258,17 +258,17 @@ namespace cv public: FormatterBase() : prec32f(8), prec64f(16), multiline(true) {} - void set32fPrecision(int p) + void set32fPrecision(int p) CV_OVERRIDE { prec32f = p; } - void set64fPrecision(int p) + void set64fPrecision(int p) CV_OVERRIDE { prec64f = p; } - void setMultiline(bool ml) + void setMultiline(bool ml) CV_OVERRIDE { multiline = ml; } @@ -279,11 +279,11 @@ namespace cv int multiline; }; - class DefaultFormatter : public FormatterBase + class DefaultFormatter CV_FINAL : public FormatterBase { public: - Ptr format(const Mat& mtx) const + Ptr format(const Mat& mtx) const CV_OVERRIDE { char braces[5] = {'\0', '\0', ';', '\0', '\0'}; return makePtr("[", "]", mtx, &*braces, @@ -291,11 +291,11 @@ namespace cv } }; - class MatlabFormatter : public FormatterBase + class MatlabFormatter CV_FINAL : public FormatterBase { public: - Ptr format(const Mat& mtx) const + Ptr format(const Mat& mtx) const CV_OVERRIDE { char braces[5] = {'\0', '\0', ';', '\0', '\0'}; return makePtr("", "", mtx, &*braces, @@ -303,11 +303,11 @@ namespace cv } }; - class PythonFormatter : public FormatterBase + class PythonFormatter CV_FINAL : public FormatterBase { public: - Ptr format(const Mat& mtx) const + Ptr format(const Mat& mtx) const CV_OVERRIDE { char braces[5] = {'[', ']', ',', '[', ']'}; if (mtx.cols == 1) @@ -317,11 +317,11 @@ namespace cv } }; - class NumpyFormatter : public FormatterBase + class NumpyFormatter CV_FINAL : public FormatterBase { public: - Ptr format(const Mat& mtx) const + Ptr format(const Mat& mtx) const CV_OVERRIDE { static const char* numpyTypes[] = { @@ -336,11 +336,11 @@ namespace cv } }; - class CSVFormatter : public FormatterBase + class CSVFormatter CV_FINAL : public FormatterBase { public: - Ptr format(const Mat& mtx) const + Ptr format(const Mat& mtx) const CV_OVERRIDE { char braces[5] = {'\0', '\0', '\0', '\0', '\0'}; return makePtr(String(), @@ -349,11 +349,11 @@ namespace cv } }; - class CFormatter : public FormatterBase + class CFormatter CV_FINAL : public FormatterBase { public: - Ptr format(const Mat& mtx) const + Ptr format(const Mat& mtx) const CV_OVERRIDE { char braces[5] = {'\0', '\0', ',', '\0', '\0'}; return makePtr("{", "}", mtx, &*braces, diff --git a/modules/core/src/parallel.cpp b/modules/core/src/parallel.cpp index 7ef2fdc5ed..5b5e859689 100644 --- a/modules/core/src/parallel.cpp +++ b/modules/core/src/parallel.cpp @@ -238,7 +238,7 @@ namespace ~ParallelLoopBodyWrapper() { } - void operator()(const cv::Range& sr) const + void operator()(const cv::Range& sr) const CV_OVERRIDE { #ifdef OPENCV_TRACE // TODO CV_TRACE_NS::details::setCurrentRegion(rootRegion); diff --git a/modules/core/src/trace.cpp b/modules/core/src/trace.cpp index a8fd26db05..dc15bd31d2 100644 --- a/modules/core/src/trace.cpp +++ b/modules/core/src/trace.cpp @@ -726,7 +726,7 @@ void TraceManagerThreadLocal::dumpStack(std::ostream& out, bool onlyFunctions) c out << ss.str(); } -class AsyncTraceStorage : public TraceStorage +class AsyncTraceStorage CV_FINAL : public TraceStorage { mutable std::ofstream out; public: @@ -744,7 +744,7 @@ public: out.close(); } - bool put(const TraceMessage& msg) const + bool put(const TraceMessage& msg) const CV_OVERRIDE { if (msg.hasError) return false; @@ -754,7 +754,7 @@ public: } }; -class SyncTraceStorage : public TraceStorage +class SyncTraceStorage CV_FINAL : public TraceStorage { mutable std::ofstream out; mutable cv::Mutex mutex; @@ -774,7 +774,7 @@ public: out.close(); } - bool put(const TraceMessage& msg) const + bool put(const TraceMessage& msg) const CV_OVERRIDE { if (msg.hasError) return false; diff --git a/modules/cudalegacy/src/calib3d.cpp b/modules/cudalegacy/src/calib3d.cpp index 7d8c816fa0..96c23fc06d 100644 --- a/modules/cudalegacy/src/calib3d.cpp +++ b/modules/cudalegacy/src/calib3d.cpp @@ -160,7 +160,7 @@ namespace num_points(num_points_), subset_size(subset_size_), rot_matrices(rot_matrices_), transl_vectors(transl_vectors_) {} - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { // Input data for generation of the current hypothesis std::vector subset_indices(subset_size); diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt index 9f77f7a1a9..fbcdd78308 100644 --- a/modules/dnn/CMakeLists.txt +++ b/modules/dnn/CMakeLists.txt @@ -87,6 +87,11 @@ if(WITH_INF_ENGINE AND HAVE_INF_ENGINE) endif() ocv_module_include_directories(${include_dirs}) +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + ocv_append_source_files_cxx_compiler_options(fw_srcs "-Wno-suggest-override") # GCC +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + ocv_append_source_files_cxx_compiler_options(fw_srcs "-Wno-inconsistent-missing-override") # Clang +endif() ocv_glob_module_sources(${sources_options} SOURCES ${fw_srcs}) ocv_create_module(${libs}) ocv_add_samples() diff --git a/modules/dnn/include/opencv2/dnn/all_layers.hpp b/modules/dnn/include/opencv2/dnn/all_layers.hpp index e6c8e9f297..2cdf70086c 100644 --- a/modules/dnn/include/opencv2/dnn/all_layers.hpp +++ b/modules/dnn/include/opencv2/dnn/all_layers.hpp @@ -152,8 +152,8 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN * (i.e. @f$ x_{t}^{stream} @f$ is stored inside @p input[0][stream, ...]). */ - int inputNameToIndex(String inputName); - int outputNameToIndex(const String& outputName); + int inputNameToIndex(String inputName) CV_OVERRIDE; + int outputNameToIndex(const String& outputName) CV_OVERRIDE; }; /** @brief Classical recurrent layer diff --git a/modules/dnn/src/caffe/caffe_io.hpp b/modules/dnn/src/caffe/caffe_io.hpp index b8a1b257c2..544db1c3ed 100644 --- a/modules/dnn/src/caffe/caffe_io.hpp +++ b/modules/dnn/src/caffe/caffe_io.hpp @@ -91,7 +91,15 @@ #define __OPENCV_DNN_CAFFE_IO_HPP__ #ifdef HAVE_PROTOBUF +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" +#endif #include "opencv-caffe.pb.h" +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic pop +#endif + namespace caffe { using namespace opencv_caffe; } // avoid massive renames from caffe proto package namespace cv { diff --git a/modules/dnn/src/dnn.cpp b/modules/dnn/src/dnn.cpp index d5ceeba3b9..611e35e386 100644 --- a/modules/dnn/src/dnn.cpp +++ b/modules/dnn/src/dnn.cpp @@ -283,12 +283,12 @@ public: ~OpenCLBackendWrapper() {} // Copies data from device to a host memory. - virtual void copyToHost() + virtual void copyToHost() CV_OVERRIDE { umat.copyTo(*host); } - virtual void setHostDirty() + virtual void setHostDirty() CV_OVERRIDE { hostDirty = true; }; @@ -395,11 +395,11 @@ struct LayerData //fake layer containing network input blobs struct DataLayer : public Layer { - void finalize(const std::vector&, std::vector&) {} - void forward(std::vector&, std::vector&, std::vector &) {} - void forward(InputArrayOfArrays inputs, OutputArrayOfArrays outputs, OutputArrayOfArrays internals) {} + void finalize(const std::vector&, std::vector&) CV_OVERRIDE {} + void forward(std::vector&, std::vector&, std::vector &) CV_OVERRIDE {} + void forward(InputArrayOfArrays inputs, OutputArrayOfArrays outputs, OutputArrayOfArrays internals) CV_OVERRIDE {} - int outputNameToIndex(const String& tgtName) + int outputNameToIndex(const String& tgtName) CV_OVERRIDE { int idx = (int)(std::find(outNames.begin(), outNames.end(), tgtName) - outNames.begin()); return (idx < (int)outNames.size()) ? idx : -1; @@ -413,7 +413,7 @@ struct DataLayer : public Layer bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() == requiredOutputs); outputs.assign(inputs.begin(), inputs.end()); diff --git a/modules/dnn/src/layers/batch_norm_layer.cpp b/modules/dnn/src/layers/batch_norm_layer.cpp index fb79d1f806..df4e553309 100644 --- a/modules/dnn/src/layers/batch_norm_layer.cpp +++ b/modules/dnn/src/layers/batch_norm_layer.cpp @@ -23,7 +23,7 @@ namespace cv namespace dnn { -class BatchNormLayerImpl : public BatchNormLayer +class BatchNormLayerImpl CV_FINAL : public BatchNormLayer { public: Mat weights_, bias_; @@ -90,7 +90,7 @@ public: } } - void getScaleShift(Mat& scale, Mat& shift) const + void getScaleShift(Mat& scale, Mat& shift) const CV_OVERRIDE { scale = weights_; shift = bias_; @@ -99,7 +99,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { if (!useGlobalStats && inputs[0][0] != 1) CV_Error(Error::StsNotImplemented, "Batch normalization in training mode with batch size > 1"); @@ -107,7 +107,7 @@ public: return true; } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_HALIDE && haveHalide() || @@ -176,7 +176,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -188,7 +188,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -219,7 +219,7 @@ public: } } - virtual Ptr tryAttach(const Ptr& node) + virtual Ptr tryAttach(const Ptr& node) CV_OVERRIDE { switch (node->backendId) { @@ -251,7 +251,7 @@ public: return Ptr(); } - virtual Ptr initHalide(const std::vector > &inputs) + virtual Ptr initHalide(const std::vector > &inputs) CV_OVERRIDE { #ifdef HAVE_HALIDE Halide::Buffer input = halideBuffer(inputs[0]); @@ -278,7 +278,7 @@ public: } #endif // HAVE_HALIDE - virtual Ptr initInfEngine(const std::vector >&) + virtual Ptr initInfEngine(const std::vector >&) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE InferenceEngine::LayerParams lp; @@ -296,7 +296,7 @@ public: } virtual int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const + const std::vector &outputs) const CV_OVERRIDE { (void)outputs; // suppress unused variable warning diff --git a/modules/dnn/src/layers/blank_layer.cpp b/modules/dnn/src/layers/blank_layer.cpp index c5568b0d58..1ed17bb357 100644 --- a/modules/dnn/src/layers/blank_layer.cpp +++ b/modules/dnn/src/layers/blank_layer.cpp @@ -45,7 +45,7 @@ namespace cv { namespace dnn { -class BlankLayerImpl : public BlankLayer +class BlankLayerImpl CV_FINAL : public BlankLayer { public: BlankLayerImpl(const LayerParams& params) @@ -56,7 +56,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { Layer::getMemoryShapes(inputs, requiredOutputs, outputs, internals); return true; @@ -83,7 +83,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -95,7 +95,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); diff --git a/modules/dnn/src/layers/concat_layer.cpp b/modules/dnn/src/layers/concat_layer.cpp index fd55e7c24a..172d0a076c 100644 --- a/modules/dnn/src/layers/concat_layer.cpp +++ b/modules/dnn/src/layers/concat_layer.cpp @@ -54,7 +54,7 @@ namespace cv namespace dnn { -class ConcatLayerImpl : public ConcatLayer +class ConcatLayerImpl CV_FINAL : public ConcatLayer { public: ConcatLayerImpl(const LayerParams& params) @@ -67,7 +67,7 @@ public: virtual bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() > 0); outputs.resize(1, inputs[0]); @@ -101,7 +101,7 @@ public: return false; } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_HALIDE && haveHalide() && axis == 1 && !padding || // By channels @@ -157,7 +157,7 @@ public: ChannelConcatInvoker() : inputs(0), output(0), nstripes(0) {} - void operator()(const Range& r) const + void operator()(const Range& r) const CV_OVERRIDE { size_t planeSize = (size_t)output->size[2]*output->size[3]; size_t nch = chptrs.size(); @@ -230,7 +230,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -242,7 +242,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -278,7 +278,7 @@ public: } } - virtual Ptr initHalide(const std::vector > &input) + virtual Ptr initHalide(const std::vector > &input) CV_OVERRIDE { #ifdef HAVE_HALIDE std::vector > inputBuffers = halideBuffers(input); @@ -301,7 +301,7 @@ public: return Ptr(); } - virtual Ptr initInfEngine(const std::vector >& inputs) + virtual Ptr initInfEngine(const std::vector >& inputs) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE InferenceEngine::DataPtr input = infEngineDataNode(inputs[0]); diff --git a/modules/dnn/src/layers/convolution_layer.cpp b/modules/dnn/src/layers/convolution_layer.cpp index 84841bf43f..6da843809e 100644 --- a/modules/dnn/src/layers/convolution_layer.cpp +++ b/modules/dnn/src/layers/convolution_layer.cpp @@ -79,14 +79,14 @@ public: adjustPad.height < stride.height); } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_HALIDE && haveHalide() || backendId == DNN_BACKEND_INFERENCE_ENGINE && haveInfEngine(); } - void finalize(const std::vector &inputs, std::vector &outputs) + void finalize(const std::vector &inputs, std::vector &outputs) CV_OVERRIDE { CV_Assert(inputs.size() > 0); @@ -123,7 +123,7 @@ public: virtual void applyHalideScheduler(Ptr& node, const std::vector &inputs, const std::vector &outputs, - int targetId) const + int targetId) const CV_OVERRIDE { #ifdef HAVE_HALIDE if (targetId != DNN_TARGET_CPU) @@ -165,7 +165,7 @@ public: #define IS_POWER_LAYER(layer) \ (!layer.empty() && !layer->type.compare("Power")) //TODO: simultaneously convolution and bias addition for cache optimization -class ConvolutionLayerImpl : public BaseConvolutionLayerImpl +class ConvolutionLayerImpl CV_FINAL : public BaseConvolutionLayerImpl { public: enum { VEC_ALIGN = 8, DFT_TYPE = CV_32F }; @@ -194,7 +194,7 @@ public: #endif } - MatShape computeColRowShape(const MatShape &inpShape, const MatShape &outShape) const + MatShape computeColRowShape(const MatShape &inpShape, const MatShape &outShape) const CV_OVERRIDE { Size out(outShape[3], outShape[2]); int inpGroupCn = blobs[0].size[1]; @@ -205,7 +205,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(blobs.size() != 0); CV_Assert(!hasBias() || blobs[1].total() == (size_t)blobs[0].size[0]); @@ -239,7 +239,7 @@ public: return false; } - virtual void finalize(const std::vector &inputs, std::vector &outputs) + virtual void finalize(const std::vector &inputs, std::vector &outputs) CV_OVERRIDE { BaseConvolutionLayerImpl::finalize(inputs, outputs); @@ -278,7 +278,7 @@ public: #endif } - bool setActivation(const Ptr& layer) + bool setActivation(const Ptr& layer) CV_OVERRIDE { activ = layer; if (activ.empty()) @@ -312,7 +312,7 @@ public: return !activ.empty(); } - virtual bool tryFuse(Ptr& top) + virtual bool tryFuse(Ptr& top) CV_OVERRIDE { Mat w, b; top->getScaleShift(w, b); @@ -357,7 +357,7 @@ public: biasvec[outCn] = biasvec[outCn+1] = biasvec[outCn-1]; } - virtual Ptr initHalide(const std::vector > &inputs) + virtual Ptr initHalide(const std::vector > &inputs) CV_OVERRIDE { #ifdef HAVE_HALIDE Halide::Buffer inputBuffer = halideBuffer(inputs[0]); @@ -405,7 +405,7 @@ public: return Ptr(); } - virtual Ptr initInfEngine(const std::vector > &inputs) + virtual Ptr initInfEngine(const std::vector > &inputs) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE InferenceEngine::DataPtr input = infEngineDataNode(inputs[0]); @@ -517,7 +517,7 @@ public: parallel_for_(Range(0, nstripes), p, nstripes); } - virtual void operator ()(const Range &r0) const + virtual void operator ()(const Range &r0) const CV_OVERRIDE { const int valign = ConvolutionLayerImpl::VEC_ALIGN; int ngroups = ngroups_, batchSize = input_->size[0]*ngroups; @@ -937,7 +937,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -949,7 +949,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -993,7 +993,7 @@ public: } virtual int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const + const std::vector &outputs) const CV_OVERRIDE { CV_Assert(inputs.size() == outputs.size()); @@ -1007,7 +1007,7 @@ public: } }; -class DeConvolutionLayerImpl : public BaseConvolutionLayerImpl +class DeConvolutionLayerImpl CV_FINAL : public BaseConvolutionLayerImpl { public: Mat weightsMat, biasesMat; @@ -1016,7 +1016,7 @@ public: DeConvolutionLayerImpl(const LayerParams& params) : BaseConvolutionLayerImpl(params) {} - MatShape computeColRowShape(const MatShape &inpShape, const MatShape &outShape) const + MatShape computeColRowShape(const MatShape &inpShape, const MatShape &outShape) const CV_OVERRIDE { int inpCn = inpShape[1]; int inpH = inpShape[2]; @@ -1031,7 +1031,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(!hasBias() || blobs[1].total() == (size_t)numOutput); CV_Assert(inputs.size() != 0); @@ -1080,7 +1080,7 @@ public: return false; } - void finalize(const std::vector &inputs, std::vector &outputs) + void finalize(const std::vector &inputs, std::vector &outputs) CV_OVERRIDE { BaseConvolutionLayerImpl::finalize(inputs, outputs); getConvPoolPaddings(Size(outputs[0].size[3], outputs[0].size[2]), @@ -1102,7 +1102,7 @@ public: useAVX512 = CV_CPU_HAS_SUPPORT_AVX512_SKX; } - void operator()(const Range& range_) const + void operator()(const Range& range_) const CV_OVERRIDE { int stripeSize = (int)alignSize((b_->cols + nstripes_ - 1)/nstripes_, 16); Range range(range_.start*stripeSize, std::min(range_.end*stripeSize, b_->cols)); @@ -1277,7 +1277,7 @@ public: parallel_for_(Range(0, nstripes), t, nstripes); } - virtual void operator ()(const Range &r) const + virtual void operator ()(const Range &r) const CV_OVERRIDE { const float* data_col_ = data_col; float* data_im_ = data_im; @@ -1423,7 +1423,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -1435,7 +1435,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -1489,7 +1489,7 @@ public: } } - virtual Ptr initHalide(const std::vector > &inputs) + virtual Ptr initHalide(const std::vector > &inputs) CV_OVERRIDE { #ifdef HAVE_HALIDE Halide::Buffer inputBuffer = halideBuffer(inputs[0]); @@ -1543,7 +1543,7 @@ public: } virtual int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const + const std::vector &outputs) const CV_OVERRIDE { CV_Assert(inputs.size() == outputs.size()); diff --git a/modules/dnn/src/layers/crop_layer.cpp b/modules/dnn/src/layers/crop_layer.cpp index 0d43487376..8b56f6f439 100644 --- a/modules/dnn/src/layers/crop_layer.cpp +++ b/modules/dnn/src/layers/crop_layer.cpp @@ -48,7 +48,7 @@ namespace cv namespace dnn { -class CropLayerImpl : public CropLayer +class CropLayerImpl CV_FINAL : public CropLayer { public: CropLayerImpl(const LayerParams& params) @@ -67,7 +67,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() == 2); @@ -83,7 +83,7 @@ public: return false; } - void finalize(const std::vector &inputs, std::vector &outputs) + void finalize(const std::vector &inputs, std::vector &outputs) CV_OVERRIDE { CV_Assert(2 == inputs.size()); @@ -119,7 +119,7 @@ public: } } - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -127,7 +127,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); diff --git a/modules/dnn/src/layers/detection_output_layer.cpp b/modules/dnn/src/layers/detection_output_layer.cpp index dcce8422ba..c6b711f841 100644 --- a/modules/dnn/src/layers/detection_output_layer.cpp +++ b/modules/dnn/src/layers/detection_output_layer.cpp @@ -93,7 +93,7 @@ static inline float caffe_norm_box_overlap(const util::NormalizedBBox& a, const } // namespace -class DetectionOutputLayerImpl : public DetectionOutputLayer +class DetectionOutputLayerImpl CV_FINAL : public DetectionOutputLayer { public: unsigned _numClasses; @@ -193,7 +193,7 @@ public: setParamsFrom(params); } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_INFERENCE_ENGINE && haveInfEngine() && !_locPredTransposed; @@ -202,7 +202,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() >= 3); CV_Assert(inputs[0][0] == inputs[1][0]); @@ -367,7 +367,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -379,7 +379,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -862,7 +862,7 @@ public: } } - virtual Ptr initInfEngine(const std::vector >&) + virtual Ptr initInfEngine(const std::vector >&) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE InferenceEngine::LayerParams lp; diff --git a/modules/dnn/src/layers/elementwise_layers.cpp b/modules/dnn/src/layers/elementwise_layers.cpp index 44c8567acf..1b8b2c7935 100644 --- a/modules/dnn/src/layers/elementwise_layers.cpp +++ b/modules/dnn/src/layers/elementwise_layers.cpp @@ -82,7 +82,7 @@ public: nstripes_ = nstripes; } - void operator()(const Range &r) const + void operator()(const Range &r) const CV_OVERRIDE { int nstripes = nstripes_, nsamples = 1, outCn = 1; size_t planeSize = 1; @@ -113,14 +113,14 @@ public: ElementWiseLayer(const Func &f=Func()) : run_parallel(false) { func = f; } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_HALIDE && haveHalide() || backendId == DNN_BACKEND_INFERENCE_ENGINE && haveInfEngine() && this->type != "Sigmoid"; } - virtual Ptr tryAttach(const Ptr& node) + virtual Ptr tryAttach(const Ptr& node) CV_OVERRIDE { switch (node->backendId) { @@ -140,7 +140,7 @@ public: return Ptr(); } - virtual Ptr initHalide(const std::vector > &inputs) + virtual Ptr initHalide(const std::vector > &inputs) CV_OVERRIDE { #ifdef HAVE_HALIDE Halide::Buffer input = halideBuffer(inputs[0]); @@ -152,7 +152,7 @@ public: return Ptr(); } - virtual Ptr initInfEngine(const std::vector >&) + virtual Ptr initInfEngine(const std::vector >&) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE InferenceEngine::LayerParams lp; @@ -166,13 +166,13 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { Layer::getMemoryShapes(inputs, requiredOutputs, outputs, internals); return true; } - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); @@ -183,7 +183,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); @@ -200,13 +200,13 @@ public: } } - void forwardSlice(const float* src, float* dst, int len, size_t planeSize, int cn0, int cn1) const + void forwardSlice(const float* src, float* dst, int len, size_t planeSize, int cn0, int cn1) const CV_OVERRIDE { func.apply(src, dst, len, planeSize, cn0, cn1); } virtual int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const + const std::vector &outputs) const CV_OVERRIDE { long flops = 0; for (int i = 0; i < outputs.size(); i++) diff --git a/modules/dnn/src/layers/eltwise_layer.cpp b/modules/dnn/src/layers/eltwise_layer.cpp index 01c1f2f4be..58a651e628 100644 --- a/modules/dnn/src/layers/eltwise_layer.cpp +++ b/modules/dnn/src/layers/eltwise_layer.cpp @@ -54,7 +54,7 @@ namespace cv namespace dnn { -class EltwiseLayerImpl : public EltwiseLayer +class EltwiseLayerImpl CV_FINAL : public EltwiseLayer { public: enum EltwiseOp @@ -94,7 +94,7 @@ public: } } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_HALIDE && haveHalide() || @@ -104,7 +104,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() >= 2); CV_Assert(coeffs.size() == 0 || coeffs.size() == inputs.size()); @@ -178,7 +178,7 @@ public: parallel_for_(Range(0, nstripes), p, nstripes); } - void operator()(const Range& r) const + void operator()(const Range& r) const CV_OVERRIDE { size_t total = dst->size[0]*planeSize; size_t stripeSize = (total + nstripes - 1)/nstripes; @@ -338,7 +338,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -350,7 +350,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -361,7 +361,7 @@ public: coeffs, op, activ.get(), nstripes); } - virtual Ptr initHalide(const std::vector > &input) + virtual Ptr initHalide(const std::vector > &input) CV_OVERRIDE { #ifdef HAVE_HALIDE Halide::Var x("x"), y("y"), c("c"), n("n"); @@ -407,7 +407,7 @@ public: return Ptr(); } - virtual Ptr initInfEngine(const std::vector >&) + virtual Ptr initInfEngine(const std::vector >&) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE InferenceEngine::LayerParams lp; @@ -429,7 +429,7 @@ public: } virtual int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const + const std::vector &outputs) const CV_OVERRIDE { (void)outputs; // suppress unused variable warning CV_Assert(inputs.size()); @@ -439,7 +439,7 @@ public: return flops; } - bool setActivation(const Ptr& layer) + bool setActivation(const Ptr& layer) CV_OVERRIDE { activ = layer; return !activ.empty(); diff --git a/modules/dnn/src/layers/flatten_layer.cpp b/modules/dnn/src/layers/flatten_layer.cpp index dd46b86e69..1df1681a46 100644 --- a/modules/dnn/src/layers/flatten_layer.cpp +++ b/modules/dnn/src/layers/flatten_layer.cpp @@ -52,7 +52,7 @@ namespace cv namespace dnn { -class FlattenLayerImpl : public FlattenLayer +class FlattenLayerImpl CV_FINAL : public FlattenLayer { public: FlattenLayerImpl(const LayerParams ¶ms) @@ -62,7 +62,7 @@ public: setParamsFrom(params); } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_INFERENCE_ENGINE && haveInfEngine(); @@ -71,7 +71,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() > 0); for (size_t i = 1; i < inputs.size(); i++) @@ -135,7 +135,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -148,7 +148,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -160,7 +160,7 @@ public: } } - virtual Ptr initInfEngine(const std::vector >&) + virtual Ptr initInfEngine(const std::vector >&) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE InferenceEngine::LayerParams lp; diff --git a/modules/dnn/src/layers/fully_connected_layer.cpp b/modules/dnn/src/layers/fully_connected_layer.cpp index f00d9cfae8..68ca1b4f5f 100644 --- a/modules/dnn/src/layers/fully_connected_layer.cpp +++ b/modules/dnn/src/layers/fully_connected_layer.cpp @@ -56,7 +56,7 @@ namespace cv namespace dnn { -class FullyConnectedLayerImpl : public InnerProductLayer +class FullyConnectedLayerImpl CV_FINAL : public InnerProductLayer { public: enum { VEC_ALIGN = 8 }; @@ -106,7 +106,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &) const + std::vector &) const CV_OVERRIDE { CV_Assert(inputs.size() == 1); CV_Assert(1 <= blobs.size() && blobs.size() <= 2); @@ -125,14 +125,14 @@ public: return false; } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_HALIDE && haveHalide() && axis == 1 || backendId == DNN_BACKEND_INFERENCE_ENGINE && haveInfEngine() && axis == 1; } - virtual bool setActivation(const Ptr& layer) + virtual bool setActivation(const Ptr& layer) CV_OVERRIDE { activ = layer; return !activ.empty(); @@ -168,7 +168,7 @@ public: parallel_for_(Range(0, nstripes), p, nstripes); } - void operator()(const Range& r) const + void operator()(const Range& r) const CV_OVERRIDE { int valign = FullyConnectedLayerImpl::VEC_ALIGN; int nsamples = srcMat->rows; @@ -267,7 +267,7 @@ public: }; #ifdef HAVE_OPENCL - void finalize(const std::vector &inputs, std::vector &outputs) + void finalize(const std::vector &inputs, std::vector &outputs) CV_OVERRIDE { innerProductOp.release(); } @@ -348,7 +348,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -360,7 +360,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &input, std::vector &output, std::vector &) + void forward(std::vector &input, std::vector &output, std::vector &) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -378,7 +378,7 @@ public: } } - virtual Ptr initHalide(const std::vector > &inputs) + virtual Ptr initHalide(const std::vector > &inputs) CV_OVERRIDE { #ifdef HAVE_HALIDE int inW, inH, inC, inN, outC = blobs[0].size[0]; @@ -402,7 +402,7 @@ public: return Ptr(); } - virtual Ptr initInfEngine(const std::vector >&) + virtual Ptr initInfEngine(const std::vector >&) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE InferenceEngine::LayerParams lp; @@ -421,7 +421,7 @@ public: } virtual int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const + const std::vector &outputs) const CV_OVERRIDE { (void)inputs; // suppress unused variable warning long flops = 0; diff --git a/modules/dnn/src/layers/lrn_layer.cpp b/modules/dnn/src/layers/lrn_layer.cpp index 34b022fbb4..25eb1540b1 100644 --- a/modules/dnn/src/layers/lrn_layer.cpp +++ b/modules/dnn/src/layers/lrn_layer.cpp @@ -59,7 +59,7 @@ namespace cv namespace dnn { -class LRNLayerImpl : public LRNLayer +class LRNLayerImpl CV_FINAL : public LRNLayer { public: LRNLayerImpl(const LayerParams& params) @@ -88,7 +88,7 @@ public: Ptr > lrnOp; #endif - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_HALIDE && haveHalide() || @@ -96,7 +96,7 @@ public: } #ifdef HAVE_OPENCL - void finalize(const std::vector &inputs, std::vector &outputs) + void finalize(const std::vector &inputs, std::vector &outputs) CV_OVERRIDE { lrnOp.release(); } @@ -139,7 +139,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -153,7 +153,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -196,7 +196,7 @@ public: planeSize_ = planeSize; nsamples_ = nsamples; nstripes_ = nstripes; } - void operator()(const Range& r) const + void operator()(const Range& r) const CV_OVERRIDE { int nsamples = nsamples_, nstripes = nstripes_; size_t planeSize = planeSize_, planeSize_n = planeSize * nsamples; @@ -303,7 +303,7 @@ public: } } - virtual Ptr initHalide(const std::vector > &inputs) + virtual Ptr initHalide(const std::vector > &inputs) CV_OVERRIDE { #ifdef HAVE_HALIDE float alphaSize = alpha; @@ -347,7 +347,7 @@ public: virtual void applyHalideScheduler(Ptr& node, const std::vector &inputs, const std::vector &outputs, - int targetId) const + int targetId) const CV_OVERRIDE { #ifdef HAVE_HALIDE if (targetId != DNN_TARGET_CPU) @@ -376,7 +376,7 @@ public: #endif // HAVE_HALIDE } - virtual Ptr initInfEngine(const std::vector >&) + virtual Ptr initInfEngine(const std::vector >&) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE InferenceEngine::LayerParams lp; @@ -396,7 +396,7 @@ public: } virtual int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const + const std::vector &outputs) const CV_OVERRIDE { (void)outputs; // suppress unused variable warning CV_Assert(inputs.size() > 0); diff --git a/modules/dnn/src/layers/max_unpooling_layer.cpp b/modules/dnn/src/layers/max_unpooling_layer.cpp index 8b7c96f2fc..09509dfb4f 100644 --- a/modules/dnn/src/layers/max_unpooling_layer.cpp +++ b/modules/dnn/src/layers/max_unpooling_layer.cpp @@ -21,7 +21,7 @@ namespace cv namespace dnn { -class MaxUnpoolLayerImpl : public MaxUnpoolLayer +class MaxUnpoolLayerImpl CV_FINAL : public MaxUnpoolLayer { public: MaxUnpoolLayerImpl(const LayerParams& params) @@ -32,7 +32,7 @@ public: poolStride = Size(params.get("pool_stride_w"), params.get("pool_stride_h")); } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_HALIDE && haveHalide() && @@ -42,7 +42,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() == 2); CV_Assert(total(inputs[0]) == total(inputs[1])); @@ -57,7 +57,7 @@ public: return false; } - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -65,7 +65,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -117,7 +117,7 @@ public: } } - virtual Ptr initHalide(const std::vector > &input) + virtual Ptr initHalide(const std::vector > &input) CV_OVERRIDE { #ifdef HAVE_HALIDE // Meaningless operation if false because if kernel > stride diff --git a/modules/dnn/src/layers/mvn_layer.cpp b/modules/dnn/src/layers/mvn_layer.cpp index 09993a3c04..f948c718c2 100644 --- a/modules/dnn/src/layers/mvn_layer.cpp +++ b/modules/dnn/src/layers/mvn_layer.cpp @@ -54,7 +54,7 @@ namespace cv namespace dnn { -class MVNLayerImpl : public MVNLayer +class MVNLayerImpl CV_FINAL : public MVNLayer { public: MVNLayerImpl(const LayerParams& params) @@ -71,7 +71,7 @@ public: Mat scale, shift; bool fuse_batch_norm; - virtual bool tryFuse(Ptr& top) + virtual bool tryFuse(Ptr& top) CV_OVERRIDE { if (preferableTarget == DNN_TARGET_OPENCL && !fuse_batch_norm) { @@ -85,7 +85,7 @@ public: Ptr activ_relu; float relu_slope; bool fuse_relu; - bool setActivation(const Ptr& layer) + bool setActivation(const Ptr& layer) CV_OVERRIDE { if (!layer.empty() && preferableTarget == DNN_TARGET_OPENCL) { @@ -244,7 +244,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -256,7 +256,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -295,7 +295,7 @@ public: } virtual int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const + const std::vector &outputs) const CV_OVERRIDE { (void)outputs; // suppress unused variable warning long flops = 0; diff --git a/modules/dnn/src/layers/normalize_bbox_layer.cpp b/modules/dnn/src/layers/normalize_bbox_layer.cpp index 54b8c145c5..5772aad91c 100644 --- a/modules/dnn/src/layers/normalize_bbox_layer.cpp +++ b/modules/dnn/src/layers/normalize_bbox_layer.cpp @@ -45,7 +45,7 @@ namespace cv { namespace dnn { -class NormalizeBBoxLayerImpl : public NormalizeBBoxLayer +class NormalizeBBoxLayerImpl CV_FINAL : public NormalizeBBoxLayer { public: NormalizeBBoxLayerImpl(const LayerParams& params) @@ -60,7 +60,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() == 1); Layer::getMemoryShapes(inputs, requiredOutputs, outputs, internals); @@ -140,7 +140,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -152,7 +152,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); diff --git a/modules/dnn/src/layers/padding_layer.cpp b/modules/dnn/src/layers/padding_layer.cpp index 4934524909..7c2cb0cbd0 100644 --- a/modules/dnn/src/layers/padding_layer.cpp +++ b/modules/dnn/src/layers/padding_layer.cpp @@ -19,7 +19,7 @@ namespace cv namespace dnn { -class PaddingLayerImpl : public PaddingLayer +class PaddingLayerImpl CV_FINAL : public PaddingLayer { public: PaddingLayerImpl(const LayerParams ¶ms) @@ -45,7 +45,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() == 1); const MatShape& inpShape = inputs[0]; @@ -61,7 +61,7 @@ public: return false; } - void finalize(const std::vector &inputs, std::vector &outputs) + void finalize(const std::vector &inputs, std::vector &outputs) CV_OVERRIDE { // Compute dstRanges. const MatSize& inpShape = inputs[0]->size; @@ -85,13 +85,13 @@ public: dstRanges.push_back(Range::all()); } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_HALIDE && haveHalide() && dstRanges.size() == 4; } - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -99,7 +99,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -145,7 +145,7 @@ public: CV_Error(Error::StsNotImplemented, "Unknown padding type: " + paddingType); } - virtual Ptr initHalide(const std::vector > &inputs) + virtual Ptr initHalide(const std::vector > &inputs) CV_OVERRIDE { #ifdef HAVE_HALIDE int inW, inH, inC, inN; diff --git a/modules/dnn/src/layers/permute_layer.cpp b/modules/dnn/src/layers/permute_layer.cpp index 2bf73f2524..85ce8837bc 100644 --- a/modules/dnn/src/layers/permute_layer.cpp +++ b/modules/dnn/src/layers/permute_layer.cpp @@ -54,7 +54,7 @@ namespace cv { namespace dnn { -class PermuteLayerImpl : public PermuteLayer +class PermuteLayerImpl CV_FINAL : public PermuteLayer { public: void checkCurrentOrder(int currentOrder) @@ -116,7 +116,7 @@ public: checkNeedForPermutation(); } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_INFERENCE_ENGINE && haveInfEngine(); @@ -125,7 +125,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { if(!_needsPermute) { @@ -172,7 +172,7 @@ public: _count = _oldStride[0] * shapeBefore[0]; } - void finalize(const std::vector &inputs, std::vector &outputs) + void finalize(const std::vector &inputs, std::vector &outputs) CV_OVERRIDE { if(!_needsPermute) { @@ -230,7 +230,7 @@ public: PermuteInvoker() : inp(0), out(0), order(0), nstripes(0) {} - void operator()(const Range& r) const + void operator()(const Range& r) const CV_OVERRIDE { int n0 = out->size[0], n1 = out->size[1], n2 = out->size[2], n3 = out->size[3]; @@ -308,7 +308,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -320,7 +320,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -380,7 +380,7 @@ public: } } - virtual Ptr initInfEngine(const std::vector >&) + virtual Ptr initInfEngine(const std::vector >&) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE InferenceEngine::LayerParams lp; diff --git a/modules/dnn/src/layers/pooling_layer.cpp b/modules/dnn/src/layers/pooling_layer.cpp index 8e6215eef8..0cb4e65943 100644 --- a/modules/dnn/src/layers/pooling_layer.cpp +++ b/modules/dnn/src/layers/pooling_layer.cpp @@ -64,7 +64,7 @@ static inline int roundRoiSize(float v) return (int)(v + (v >= 0.f ? 0.5f : -0.5f)); } -class PoolingLayerImpl : public PoolingLayer +class PoolingLayerImpl CV_FINAL : public PoolingLayer { public: PoolingLayerImpl(const LayerParams& params) @@ -114,7 +114,7 @@ public: Ptr > poolOp; #endif - void finalize(const std::vector &inputs, std::vector &outputs) + void finalize(const std::vector &inputs, std::vector &outputs) CV_OVERRIDE { CV_Assert(!inputs.empty()); @@ -133,7 +133,7 @@ public: #endif } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_HALIDE && haveHalide() && @@ -184,7 +184,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -196,7 +196,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -221,7 +221,7 @@ public: } } - virtual Ptr initHalide(const std::vector > &inputs) + virtual Ptr initHalide(const std::vector > &inputs) CV_OVERRIDE { if (type == MAX) return initMaxPoolingHalide(inputs); @@ -231,7 +231,7 @@ public: return Ptr(); } - virtual Ptr initInfEngine(const std::vector >&) + virtual Ptr initInfEngine(const std::vector >&) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE InferenceEngine::LayerParams lp; @@ -313,7 +313,7 @@ public: parallel_for_(Range(0, nstripes), p, nstripes); } - void operator()(const Range& r) const + void operator()(const Range& r) const CV_OVERRIDE { int channels = dst->size[1], width = dst->size[3], height = dst->size[2]; int inp_width = src->size[3], inp_height = src->size[2]; @@ -752,7 +752,7 @@ public: virtual void applyHalideScheduler(Ptr& node, const std::vector &inputs, const std::vector &outputs, - int targetId) const + int targetId) const CV_OVERRIDE { #ifdef HAVE_HALIDE if (targetId != DNN_TARGET_CPU) @@ -801,7 +801,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() != 0); Size in(inputs[0][3], inputs[0][2]), out; @@ -858,7 +858,7 @@ public: } virtual int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const + const std::vector &outputs) const CV_OVERRIDE { (void)inputs; // suppress unused variable warning long flops = 0; diff --git a/modules/dnn/src/layers/prior_box_layer.cpp b/modules/dnn/src/layers/prior_box_layer.cpp index 73a4afbaf7..eaa029eafa 100644 --- a/modules/dnn/src/layers/prior_box_layer.cpp +++ b/modules/dnn/src/layers/prior_box_layer.cpp @@ -56,7 +56,7 @@ namespace cv namespace dnn { -class PriorBoxLayerImpl : public PriorBoxLayer +class PriorBoxLayerImpl CV_FINAL : public PriorBoxLayer { public: static bool getParameterDict(const LayerParams ¶ms, @@ -266,7 +266,7 @@ public: } } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_INFERENCE_ENGINE && haveInfEngine() && !_explicitSizes; @@ -275,7 +275,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(!inputs.empty()); @@ -385,7 +385,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -397,7 +397,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -476,7 +476,7 @@ public: } } - virtual Ptr initInfEngine(const std::vector >&) + virtual Ptr initInfEngine(const std::vector >&) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE InferenceEngine::LayerParams lp; @@ -516,7 +516,7 @@ public: } virtual int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const + const std::vector &outputs) const CV_OVERRIDE { (void)outputs; // suppress unused variable warning long flops = 0; diff --git a/modules/dnn/src/layers/proposal_layer.cpp b/modules/dnn/src/layers/proposal_layer.cpp index 8fee7fa727..a4c0ecf342 100644 --- a/modules/dnn/src/layers/proposal_layer.cpp +++ b/modules/dnn/src/layers/proposal_layer.cpp @@ -9,7 +9,7 @@ namespace cv { namespace dnn { -class ProposalLayerImpl : public ProposalLayer +class ProposalLayerImpl CV_FINAL : public ProposalLayer { public: ProposalLayerImpl(const LayerParams& params) @@ -85,7 +85,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { // We need to allocate the following blobs: // - output priors from PriorBoxLayer @@ -127,7 +127,7 @@ public: return false; } - void finalize(const std::vector &inputs, std::vector &outputs) + void finalize(const std::vector &inputs, std::vector &outputs) CV_OVERRIDE { std::vector layerInputs; std::vector layerOutputs; @@ -222,7 +222,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -234,7 +234,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); diff --git a/modules/dnn/src/layers/recurrent_layers.cpp b/modules/dnn/src/layers/recurrent_layers.cpp index cfccc191b8..71e36914de 100644 --- a/modules/dnn/src/layers/recurrent_layers.cpp +++ b/modules/dnn/src/layers/recurrent_layers.cpp @@ -80,7 +80,7 @@ static void sigmoid(const Mat &src, Mat &dst) cv::pow(1 + dst, -1, dst); } -class LSTMLayerImpl : public LSTMLayer +class LSTMLayerImpl CV_FINAL : public LSTMLayer { int numTimeStamps, numSamples; bool allocated; @@ -137,25 +137,25 @@ public: outTailShape.clear(); } - void setUseTimstampsDim(bool use) + void setUseTimstampsDim(bool use) CV_OVERRIDE { CV_Assert(!allocated); useTimestampDim = use; } - void setProduceCellOutput(bool produce) + void setProduceCellOutput(bool produce) CV_OVERRIDE { CV_Assert(!allocated); produceCellOutput = produce; } - void setOutShape(const MatShape &outTailShape_) + void setOutShape(const MatShape &outTailShape_) CV_OVERRIDE { CV_Assert(!allocated || total(outTailShape) == total(outTailShape_)); outTailShape = outTailShape_; } - void setWeights(const Mat &Wh, const Mat &Wx, const Mat &bias) + void setWeights(const Mat &Wh, const Mat &Wx, const Mat &bias) CV_OVERRIDE { CV_Assert(Wh.dims == 2 && Wx.dims == 2); CV_Assert(Wh.rows == Wx.rows); @@ -172,7 +172,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(!usePeephole && blobs.size() == 3 || usePeephole && blobs.size() == 6); CV_Assert(inputs.size() == 1); @@ -217,7 +217,7 @@ public: return false; } - void finalize(const std::vector &input, std::vector &output) + void finalize(const std::vector &input, std::vector &output) CV_OVERRIDE { CV_Assert(!usePeephole && blobs.size() == 3 || usePeephole && blobs.size() == 6); CV_Assert(input.size() == 1); @@ -252,7 +252,7 @@ public: allocated = true; } - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -260,7 +260,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &input, std::vector &output, std::vector &internals) + void forward(std::vector &input, std::vector &output, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -384,12 +384,12 @@ public: produceH = false; } - void setProduceHiddenOutput(bool produce = false) + void setProduceHiddenOutput(bool produce = false) CV_OVERRIDE { produceH = produce; } - void setWeights(const Mat &W_xh, const Mat &b_h, const Mat &W_hh, const Mat &W_ho, const Mat &b_o) + void setWeights(const Mat &W_xh, const Mat &b_h, const Mat &W_hh, const Mat &W_ho, const Mat &b_o) CV_OVERRIDE { CV_Assert(W_hh.dims == 2 && W_xh.dims == 2); CV_Assert(W_hh.size[0] == W_xh.size[0] && W_hh.size[0] == W_hh.size[1] && (int)b_h.total() == W_xh.size[0]); @@ -407,7 +407,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() >= 1 && inputs.size() <= 2); @@ -433,7 +433,7 @@ public: return false; } - void finalize(const std::vector &input, std::vector &output) + void finalize(const std::vector &input, std::vector &output) CV_OVERRIDE { CV_Assert(input.size() >= 1 && input.size() <= 2); @@ -473,7 +473,7 @@ public: } } - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -481,7 +481,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &input, std::vector &output, std::vector &internals) + void forward(std::vector &input, std::vector &output, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); diff --git a/modules/dnn/src/layers/region_layer.cpp b/modules/dnn/src/layers/region_layer.cpp index 181d8fd9bb..0e4635ecbe 100644 --- a/modules/dnn/src/layers/region_layer.cpp +++ b/modules/dnn/src/layers/region_layer.cpp @@ -54,7 +54,7 @@ namespace cv namespace dnn { -class RegionLayerImpl : public RegionLayer +class RegionLayerImpl CV_FINAL : public RegionLayer { public: int coords, classes, anchors, classfix; @@ -85,7 +85,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() > 0); CV_Assert(inputs[0][3] == (1 + coords + classes)*anchors); @@ -93,7 +93,7 @@ public: return false; } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT; } @@ -185,7 +185,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -197,7 +197,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -312,7 +312,7 @@ public: } virtual int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const + const std::vector &outputs) const CV_OVERRIDE { (void)outputs; // suppress unused variable warning diff --git a/modules/dnn/src/layers/reorg_layer.cpp b/modules/dnn/src/layers/reorg_layer.cpp index b5e1149497..a34264f931 100644 --- a/modules/dnn/src/layers/reorg_layer.cpp +++ b/modules/dnn/src/layers/reorg_layer.cpp @@ -54,7 +54,7 @@ namespace cv namespace dnn { -class ReorgLayerImpl : public ReorgLayer +class ReorgLayerImpl CV_FINAL : public ReorgLayer { int reorgStride; public: @@ -70,7 +70,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() > 0); outputs = std::vector(inputs.size(), shape( @@ -85,7 +85,7 @@ public: return false; } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT; } @@ -129,7 +129,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -141,7 +141,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -174,7 +174,7 @@ public: } virtual int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const + const std::vector &outputs) const CV_OVERRIDE { (void)outputs; // suppress unused variable warning diff --git a/modules/dnn/src/layers/reshape_layer.cpp b/modules/dnn/src/layers/reshape_layer.cpp index 906e340411..f33ed423de 100644 --- a/modules/dnn/src/layers/reshape_layer.cpp +++ b/modules/dnn/src/layers/reshape_layer.cpp @@ -144,7 +144,7 @@ static void computeShapeByReshapeMask(const MatShape &srcShape, } -class ReshapeLayerImpl : public ReshapeLayer +class ReshapeLayerImpl CV_FINAL : public ReshapeLayer { public: ReshapeLayerImpl(const LayerParams& params) @@ -166,7 +166,7 @@ public: } } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_INFERENCE_ENGINE && haveInfEngine(); @@ -175,7 +175,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { outputs.clear(); @@ -214,7 +214,7 @@ public: return true; } - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -226,7 +226,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -239,7 +239,7 @@ public: } } - virtual Ptr initInfEngine(const std::vector >&) + virtual Ptr initInfEngine(const std::vector >&) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE InferenceEngine::LayerParams lp; diff --git a/modules/dnn/src/layers/resize_nearest_neighbor_layer.cpp b/modules/dnn/src/layers/resize_nearest_neighbor_layer.cpp index 2ad5ba3b3a..4b871bff67 100644 --- a/modules/dnn/src/layers/resize_nearest_neighbor_layer.cpp +++ b/modules/dnn/src/layers/resize_nearest_neighbor_layer.cpp @@ -10,7 +10,7 @@ namespace cv { namespace dnn { -class ResizeNearestNeighborLayerImpl : public ResizeNearestNeighborLayer +class ResizeNearestNeighborLayerImpl CV_FINAL : public ResizeNearestNeighborLayer { public: ResizeNearestNeighborLayerImpl(const LayerParams& params) @@ -27,7 +27,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() == 1, inputs[0].size() == 4); outputs.resize(1, inputs[0]); @@ -37,7 +37,7 @@ public: return (outputs[0][2] == inputs[0][2]) && (outputs[0][3] == inputs[0][3]); } - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -45,7 +45,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); diff --git a/modules/dnn/src/layers/scale_layer.cpp b/modules/dnn/src/layers/scale_layer.cpp index d32ab56d07..464e3850a8 100644 --- a/modules/dnn/src/layers/scale_layer.cpp +++ b/modules/dnn/src/layers/scale_layer.cpp @@ -20,7 +20,7 @@ namespace cv namespace dnn { -class ScaleLayerImpl : public ScaleLayer +class ScaleLayerImpl CV_FINAL : public ScaleLayer { public: ScaleLayerImpl(const LayerParams& params) @@ -33,21 +33,21 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() == 2 && blobs.empty() || blobs.size() == 1 + hasBias); outputs.assign(1, inputs[0]); return true; } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_HALIDE && haveHalide() || backendId == DNN_BACKEND_INFERENCE_ENGINE && haveInfEngine(); } - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -55,7 +55,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -117,7 +117,7 @@ public: } } - virtual Ptr tryAttach(const Ptr& node) + virtual Ptr tryAttach(const Ptr& node) CV_OVERRIDE { switch (node->backendId) { @@ -150,7 +150,7 @@ public: return Ptr(); } - virtual Ptr initHalide(const std::vector > &inputs) + virtual Ptr initHalide(const std::vector > &inputs) CV_OVERRIDE { #ifdef HAVE_HALIDE Halide::Buffer input = halideBuffer(inputs[0]); @@ -183,7 +183,7 @@ public: } #endif // HAVE_HALIDE - virtual Ptr initInfEngine(const std::vector >&) + virtual Ptr initInfEngine(const std::vector >&) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE InferenceEngine::LayerParams lp; @@ -201,14 +201,14 @@ public: return Ptr(); } - void getScaleShift(Mat& scale, Mat& shift) const + void getScaleShift(Mat& scale, Mat& shift) const CV_OVERRIDE { scale = !blobs.empty() ? blobs[0] : Mat(); shift = hasBias ? blobs[1] : Mat(); } virtual int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const + const std::vector &outputs) const CV_OVERRIDE { (void)outputs; // suppress unused variable warning long flops = 0; diff --git a/modules/dnn/src/layers/shift_layer.cpp b/modules/dnn/src/layers/shift_layer.cpp index e0bea5ff90..fbbdcb1ea9 100644 --- a/modules/dnn/src/layers/shift_layer.cpp +++ b/modules/dnn/src/layers/shift_layer.cpp @@ -18,7 +18,7 @@ namespace cv namespace dnn { -class ShiftLayerImpl : public ShiftLayer +class ShiftLayerImpl CV_FINAL : public ShiftLayer { public: ShiftLayerImpl(const LayerParams ¶ms) @@ -27,7 +27,7 @@ public: CV_Assert(blobs.size() == 1); } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_INFERENCE_ENGINE && haveInfEngine(); @@ -36,14 +36,14 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { Layer::getMemoryShapes(inputs, requiredOutputs, outputs, internals); internals.assign(1, shape(1, total(inputs[0], 2))); return true; } - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -51,7 +51,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - virtual void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + virtual void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -90,7 +90,7 @@ public: } } - virtual Ptr tryAttach(const Ptr& node) + virtual Ptr tryAttach(const Ptr& node) CV_OVERRIDE { switch (node->backendId) { @@ -111,7 +111,7 @@ public: return Ptr(); } - virtual Ptr initInfEngine(const std::vector >&) + virtual Ptr initInfEngine(const std::vector >&) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE // Inference Engine has no layer just for biases. Create a linear @@ -136,14 +136,14 @@ public: return Ptr(); } - void getScaleShift(Mat& scale, Mat& shift) const + void getScaleShift(Mat& scale, Mat& shift) const CV_OVERRIDE { scale = Mat(); shift = blobs[0]; } virtual int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const + const std::vector &outputs) const CV_OVERRIDE { (void)outputs; // suppress unused variable warning long flops = 0; diff --git a/modules/dnn/src/layers/slice_layer.cpp b/modules/dnn/src/layers/slice_layer.cpp index 728d571dce..222ebf6be8 100644 --- a/modules/dnn/src/layers/slice_layer.cpp +++ b/modules/dnn/src/layers/slice_layer.cpp @@ -53,7 +53,7 @@ namespace cv namespace dnn { -class SliceLayerImpl : public SliceLayer +class SliceLayerImpl CV_FINAL : public SliceLayer { public: SliceLayerImpl(const LayerParams& params) @@ -110,7 +110,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() == 1); MatShape inpShape = inputs[0]; @@ -137,7 +137,7 @@ public: return false; } - void finalize(const std::vector &inputs, std::vector &outputs) + void finalize(const std::vector &inputs, std::vector &outputs) CV_OVERRIDE { CV_Assert(inputs.size() == 1); const MatSize& inpShape = inputs[0]->size; @@ -217,7 +217,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -229,7 +229,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); diff --git a/modules/dnn/src/layers/softmax_layer.cpp b/modules/dnn/src/layers/softmax_layer.cpp index 944173f7b1..171215341b 100644 --- a/modules/dnn/src/layers/softmax_layer.cpp +++ b/modules/dnn/src/layers/softmax_layer.cpp @@ -58,7 +58,7 @@ namespace cv namespace dnn { -class SoftMaxLayerImpl : public SoftmaxLayer +class SoftMaxLayerImpl CV_FINAL : public SoftmaxLayer { public: @@ -76,7 +76,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { bool inplace = Layer::getMemoryShapes(inputs, requiredOutputs, outputs, internals); MatShape shape = inputs[0]; @@ -86,7 +86,7 @@ public: return inplace; } - virtual bool supportBackend(int backendId) + virtual bool supportBackend(int backendId) CV_OVERRIDE { return backendId == DNN_BACKEND_DEFAULT || backendId == DNN_BACKEND_HALIDE && haveHalide() && axisRaw == 1 || @@ -94,7 +94,7 @@ public: } #ifdef HAVE_OPENCL - virtual void finalize(const std::vector &inputs, std::vector &outputs) + virtual void finalize(const std::vector &inputs, std::vector &outputs) CV_OVERRIDE { softmaxOp.release(); } @@ -190,7 +190,7 @@ public: } #endif - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -202,7 +202,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -290,7 +290,7 @@ public: } } - virtual Ptr initHalide(const std::vector > &inputs) + virtual Ptr initHalide(const std::vector > &inputs) CV_OVERRIDE { #ifdef HAVE_HALIDE Halide::Buffer inputBuffer = halideBuffer(inputs[0]); @@ -315,7 +315,7 @@ public: return Ptr(); } - virtual Ptr initInfEngine(const std::vector >&) + virtual Ptr initInfEngine(const std::vector >&) CV_OVERRIDE { #ifdef HAVE_INF_ENGINE InferenceEngine::LayerParams lp; @@ -330,7 +330,7 @@ public: } int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const + const std::vector &outputs) const CV_OVERRIDE { (void)outputs; // suppress unused variable warning int64 flops = 0; diff --git a/modules/dnn/src/layers/split_layer.cpp b/modules/dnn/src/layers/split_layer.cpp index 3da4cb27e7..f3ba67450b 100644 --- a/modules/dnn/src/layers/split_layer.cpp +++ b/modules/dnn/src/layers/split_layer.cpp @@ -48,7 +48,7 @@ namespace cv namespace dnn { -class SplitLayerImpl : public SplitLayer +class SplitLayerImpl CV_FINAL : public SplitLayer { public: SplitLayerImpl(const LayerParams ¶ms) @@ -69,7 +69,7 @@ public: bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const + std::vector &internals) const CV_OVERRIDE { CV_Assert(inputs.size() == 1); @@ -78,7 +78,7 @@ public: return false; } - void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) + void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); @@ -86,7 +86,7 @@ public: Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr); } - void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); diff --git a/modules/dnn/src/op_halide.hpp b/modules/dnn/src/op_halide.hpp index 07983ff41a..2f5313abf7 100644 --- a/modules/dnn/src/op_halide.hpp +++ b/modules/dnn/src/op_halide.hpp @@ -9,7 +9,14 @@ #define __OPENCV_DNN_OP_HALIDE_HPP__ #ifdef HAVE_HALIDE +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" +#endif #include +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic pop +#endif #endif // HAVE_HALIDE namespace cv @@ -55,11 +62,11 @@ namespace dnn HalideBackendWrapper(const Ptr& base, const MatShape& shape); - ~HalideBackendWrapper(); + ~HalideBackendWrapper() CV_OVERRIDE; - virtual void copyToHost(); + virtual void copyToHost() CV_OVERRIDE; - virtual void setHostDirty(); + virtual void setHostDirty() CV_OVERRIDE; Halide::Buffer buffer; diff --git a/modules/dnn/src/op_inf_engine.cpp b/modules/dnn/src/op_inf_engine.cpp index c43b2b3596..b180ec1b55 100644 --- a/modules/dnn/src/op_inf_engine.cpp +++ b/modules/dnn/src/op_inf_engine.cpp @@ -131,6 +131,10 @@ void InfEngineBackendNet::getOutputsInfo(InferenceEngine::OutputsDataMap &output { outputs_ = outputs; } +void InfEngineBackendNet::getOutputsInfo(InferenceEngine::OutputsDataMap &outputs_) const noexcept +{ + outputs_ = outputs; +} // Returns input references that aren't connected to internal outputs. void InfEngineBackendNet::getInputsInfo(InferenceEngine::InputsDataMap &inputs_) noexcept diff --git a/modules/dnn/src/op_inf_engine.hpp b/modules/dnn/src/op_inf_engine.hpp index ead02c370e..438463586c 100644 --- a/modules/dnn/src/op_inf_engine.hpp +++ b/modules/dnn/src/op_inf_engine.hpp @@ -9,7 +9,14 @@ #define __OPENCV_DNN_OP_INF_ENGINE_HPP__ #ifdef HAVE_INF_ENGINE +#if defined(__GNUC__) && __GNUC__ >= 5 +//#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" +#endif #include +#if defined(__GNUC__) && __GNUC__ >= 5 +//#pragma GCC diagnostic pop +#endif #endif // HAVE_INF_ENGINE namespace cv { namespace dnn { @@ -23,41 +30,43 @@ public: InfEngineBackendNet(InferenceEngine::CNNNetwork& net); - virtual void Release() noexcept; + virtual void Release() noexcept CV_OVERRIDE; - virtual InferenceEngine::Precision getPrecision() noexcept; + virtual InferenceEngine::Precision getPrecision() noexcept CV_OVERRIDE; - virtual void getOutputsInfo(InferenceEngine::OutputsDataMap &out) noexcept; + virtual void getOutputsInfo(InferenceEngine::OutputsDataMap &out) noexcept /*CV_OVERRIDE*/; - virtual void getInputsInfo(InferenceEngine::InputsDataMap &inputs) noexcept; + virtual void getOutputsInfo(InferenceEngine::OutputsDataMap &out) const noexcept /*CV_OVERRIDE*/; - virtual void getInputsInfo(InferenceEngine::InputsDataMap &inputs) const noexcept; + virtual void getInputsInfo(InferenceEngine::InputsDataMap &inputs) noexcept /*CV_OVERRIDE*/; - virtual InferenceEngine::InputInfo::Ptr getInput(const std::string &inputName) noexcept; + virtual void getInputsInfo(InferenceEngine::InputsDataMap &inputs) const noexcept /*CV_OVERRIDE*/; - virtual void getName(char *pName, size_t len) noexcept; + virtual InferenceEngine::InputInfo::Ptr getInput(const std::string &inputName) noexcept CV_OVERRIDE; - virtual size_t layerCount() noexcept; + virtual void getName(char *pName, size_t len) noexcept CV_OVERRIDE; - virtual InferenceEngine::DataPtr& getData(const char *dname) noexcept; + virtual size_t layerCount() noexcept CV_OVERRIDE; - virtual void addLayer(const InferenceEngine::CNNLayerPtr &layer) noexcept; + virtual InferenceEngine::DataPtr& getData(const char *dname) noexcept CV_OVERRIDE; + + virtual void addLayer(const InferenceEngine::CNNLayerPtr &layer) noexcept CV_OVERRIDE; virtual InferenceEngine::StatusCode addOutput(const std::string &layerName, size_t outputIndex = 0, - InferenceEngine::ResponseDesc *resp = nullptr) noexcept; + InferenceEngine::ResponseDesc *resp = nullptr) noexcept CV_OVERRIDE; virtual InferenceEngine::StatusCode getLayerByName(const char *layerName, InferenceEngine::CNNLayerPtr &out, - InferenceEngine::ResponseDesc *resp) noexcept; + InferenceEngine::ResponseDesc *resp) noexcept CV_OVERRIDE; - virtual void setTargetDevice(InferenceEngine::TargetDevice device) noexcept; + virtual void setTargetDevice(InferenceEngine::TargetDevice device) noexcept CV_OVERRIDE; - virtual InferenceEngine::TargetDevice getTargetDevice() noexcept; + virtual InferenceEngine::TargetDevice getTargetDevice() noexcept CV_OVERRIDE; - virtual InferenceEngine::StatusCode setBatchSize(const size_t size) noexcept; + virtual InferenceEngine::StatusCode setBatchSize(const size_t size) noexcept CV_OVERRIDE; - virtual size_t getBatchSize() const noexcept; + virtual size_t getBatchSize() const noexcept CV_OVERRIDE; void init(); @@ -99,9 +108,9 @@ public: ~InfEngineBackendWrapper(); - virtual void copyToHost(); + virtual void copyToHost() CV_OVERRIDE; - virtual void setHostDirty(); + virtual void setHostDirty() CV_OVERRIDE; InferenceEngine::DataPtr dataPtr; InferenceEngine::TBlob::Ptr blob; @@ -128,15 +137,15 @@ public: virtual bool getMemoryShapes(const std::vector &inputs, const int requiredOutputs, std::vector &outputs, - std::vector &internals) const; + std::vector &internals) const CV_OVERRIDE; virtual void forward(std::vector &input, std::vector &output, - std::vector &internals); + std::vector &internals) CV_OVERRIDE; virtual void forward(InputArrayOfArrays inputs, OutputArrayOfArrays outputs, - OutputArrayOfArrays internals); + OutputArrayOfArrays internals) CV_OVERRIDE; - virtual bool supportBackend(int backendId); + virtual bool supportBackend(int backendId) CV_OVERRIDE; private: InferenceEngine::DataPtr output; diff --git a/modules/dnn/src/tensorflow/tf_graph_simplifier.cpp b/modules/dnn/src/tensorflow/tf_graph_simplifier.cpp index 4d571df8b5..bcb806a7dd 100644 --- a/modules/dnn/src/tensorflow/tf_graph_simplifier.cpp +++ b/modules/dnn/src/tensorflow/tf_graph_simplifier.cpp @@ -214,7 +214,7 @@ public: } virtual void finalize(tensorflow::GraphDef&, tensorflow::NodeDef* fusedNode, - std::vector& inputNodes) + std::vector& inputNodes) CV_OVERRIDE { Mat epsMat = getTensorContent(inputNodes.back()->attr().at("value").tensor()); CV_Assert(epsMat.total() == 1, epsMat.type() == CV_32FC1); @@ -249,7 +249,7 @@ public: } virtual void finalize(tensorflow::GraphDef& net, tensorflow::NodeDef* fusedNode, - std::vector& inputNodes) + std::vector& inputNodes) CV_OVERRIDE { Mat epsMat = getTensorContent(inputNodes.back()->attr().at("value").tensor()); CV_Assert(epsMat.total() == 1, epsMat.type() == CV_32FC1); @@ -343,7 +343,7 @@ public: setFusedNode("Relu6", input); } - virtual bool match(const tensorflow::GraphDef& net, int nodeId, std::vector& matchedNodesIds) + virtual bool match(const tensorflow::GraphDef& net, int nodeId, std::vector& matchedNodesIds) CV_OVERRIDE { if (!Subgraph::match(net, nodeId, matchedNodesIds)) return false; @@ -378,7 +378,7 @@ public: } virtual void finalize(tensorflow::GraphDef&, tensorflow::NodeDef* fusedNode, - std::vector& inputNodes) + std::vector& inputNodes) CV_OVERRIDE { std::vector shape(numOutDims + 1); // batch size in Keras is implicit. shape[0] = -1; diff --git a/modules/dnn/src/tensorflow/tf_importer.cpp b/modules/dnn/src/tensorflow/tf_importer.cpp index 4f7e6f4839..6ea9e96a47 100644 --- a/modules/dnn/src/tensorflow/tf_importer.cpp +++ b/modules/dnn/src/tensorflow/tf_importer.cpp @@ -12,16 +12,12 @@ Implementation of Tensorflow models parser #include "../precomp.hpp" #ifdef HAVE_PROTOBUF -#include "graph.pb.h" +#include "tf_io.hpp" #include #include #include #include -#include -#include -#include -#include "tf_io.hpp" #include "tf_graph_simplifier.hpp" #endif diff --git a/modules/dnn/src/tensorflow/tf_io.cpp b/modules/dnn/src/tensorflow/tf_io.cpp index ef26b30f44..41fb1a68b2 100644 --- a/modules/dnn/src/tensorflow/tf_io.cpp +++ b/modules/dnn/src/tensorflow/tf_io.cpp @@ -23,8 +23,8 @@ Implementation of various functions which are related to Tensorflow models readi #include #include -#include "graph.pb.h" #include "tf_io.hpp" + #include "../caffe/caffe_io.hpp" #include "../caffe/glog_emulator.hpp" diff --git a/modules/dnn/src/tensorflow/tf_io.hpp b/modules/dnn/src/tensorflow/tf_io.hpp index 9466ba96a7..aeb22a6c27 100644 --- a/modules/dnn/src/tensorflow/tf_io.hpp +++ b/modules/dnn/src/tensorflow/tf_io.hpp @@ -13,8 +13,20 @@ Declaration of various functions which are related to Tensorflow models reading. #define __OPENCV_DNN_TF_IO_HPP__ #ifdef HAVE_PROTOBUF +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" +#endif #include "graph.pb.h" +#include +#include +#include +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic pop +#endif + + namespace cv { namespace dnn { diff --git a/modules/features2d/include/opencv2/features2d.hpp b/modules/features2d/include/opencv2/features2d.hpp index 06e15ac8d1..1ba4f0da26 100644 --- a/modules/features2d/include/opencv2/features2d.hpp +++ b/modules/features2d/include/opencv2/features2d.hpp @@ -208,14 +208,14 @@ public: CV_WRAP void read( const String& fileName ); - virtual void write( FileStorage&) const; + virtual void write( FileStorage&) const CV_OVERRIDE; // see corresponding cv::Algorithm method - CV_WRAP virtual void read( const FileNode&); + CV_WRAP virtual void read( const FileNode&) CV_OVERRIDE; //! Return true if detector object is empty - CV_WRAP virtual bool empty() const; - CV_WRAP virtual String getDefaultName() const; + CV_WRAP virtual bool empty() const CV_OVERRIDE; + CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; // see corresponding cv::Algorithm method CV_WRAP inline void write(const Ptr& fs, const String& name = String()) const { Algorithm::write(fs, name); } @@ -280,7 +280,7 @@ public: CV_WRAP static Ptr create(int thresh, int octaves, const std::vector &radiusList, const std::vector &numberList, float dMax=5.85f, float dMin=8.2f, const std::vector& indexChange=std::vector()); - CV_WRAP virtual String getDefaultName() const; + CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; }; /** @brief Class implementing the ORB (*oriented BRIEF*) keypoint detector and descriptor extractor @@ -355,7 +355,7 @@ public: CV_WRAP virtual void setFastThreshold(int fastThreshold) = 0; CV_WRAP virtual int getFastThreshold() const = 0; - CV_WRAP virtual String getDefaultName() const; + CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; }; /** @brief Maximally stable extremal region extractor @@ -415,7 +415,7 @@ public: CV_WRAP virtual void setPass2Only(bool f) = 0; CV_WRAP virtual bool getPass2Only() const = 0; - CV_WRAP virtual String getDefaultName() const; + CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; }; /** @overload */ @@ -471,7 +471,7 @@ public: CV_WRAP virtual void setType(int type) = 0; CV_WRAP virtual int getType() const = 0; - CV_WRAP virtual String getDefaultName() const; + CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; }; /** @overload */ @@ -526,7 +526,7 @@ public: CV_WRAP virtual void setType(int type) = 0; CV_WRAP virtual int getType() const = 0; - CV_WRAP virtual String getDefaultName() const; + CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; }; /** @brief Wrapping class for feature detection using the goodFeaturesToTrack function. : @@ -555,7 +555,7 @@ public: CV_WRAP virtual void setK(double k) = 0; CV_WRAP virtual double getK() const = 0; - CV_WRAP virtual String getDefaultName() const; + CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; }; /** @brief Class for extracting blobs from an image. : @@ -622,7 +622,7 @@ public: CV_WRAP static Ptr create(const SimpleBlobDetector::Params ¶meters = SimpleBlobDetector::Params()); - CV_WRAP virtual String getDefaultName() const; + CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; }; //! @} features2d_main @@ -679,7 +679,7 @@ public: CV_WRAP virtual void setDiffusivity(int diff) = 0; CV_WRAP virtual int getDiffusivity() const = 0; - CV_WRAP virtual String getDefaultName() const; + CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; }; /** @brief Class implementing the AKAZE keypoint detector and descriptor extractor, described in @cite ANB13. @@ -747,7 +747,7 @@ public: CV_WRAP virtual void setDiffusivity(int diff) = 0; CV_WRAP virtual int getDiffusivity() const = 0; - CV_WRAP virtual String getDefaultName() const; + CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; }; //! @} features2d_main @@ -857,11 +857,11 @@ public: /** @brief Clears the train descriptor collections. */ - CV_WRAP virtual void clear(); + CV_WRAP virtual void clear() CV_OVERRIDE; /** @brief Returns true if there are no train descriptors in the both collections. */ - CV_WRAP virtual bool empty() const; + CV_WRAP virtual bool empty() const CV_OVERRIDE; /** @brief Returns true if the descriptor matcher supports masking permissible matches. */ @@ -991,9 +991,9 @@ public: } // Reads matcher object from a file node // see corresponding cv::Algorithm method - CV_WRAP virtual void read( const FileNode& ); + CV_WRAP virtual void read( const FileNode& ) CV_OVERRIDE; // Writes matcher object to a file storage - virtual void write( FileStorage& ) const; + virtual void write( FileStorage& ) const CV_OVERRIDE; /** @brief Clones the matcher. @@ -1086,7 +1086,7 @@ public: virtual ~BFMatcher() {} - virtual bool isMaskSupported() const { return true; } + virtual bool isMaskSupported() const CV_OVERRIDE { return true; } /** @brief Brute-force matcher create method. @param normType One of NORM_L1, NORM_L2, NORM_HAMMING, NORM_HAMMING2. L1 and L2 norms are @@ -1102,12 +1102,12 @@ public: */ CV_WRAP static Ptr create( int normType=NORM_L2, bool crossCheck=false ) ; - virtual Ptr clone( bool emptyTrainData=false ) const; + virtual Ptr clone( bool emptyTrainData=false ) const CV_OVERRIDE; protected: virtual void knnMatchImpl( InputArray queryDescriptors, std::vector >& matches, int k, - InputArrayOfArrays masks=noArray(), bool compactResult=false ); + InputArrayOfArrays masks=noArray(), bool compactResult=false ) CV_OVERRIDE; virtual void radiusMatchImpl( InputArray queryDescriptors, std::vector >& matches, float maxDistance, - InputArrayOfArrays masks=noArray(), bool compactResult=false ); + InputArrayOfArrays masks=noArray(), bool compactResult=false ) CV_OVERRIDE; int normType; bool crossCheck; @@ -1128,29 +1128,29 @@ public: CV_WRAP FlannBasedMatcher( const Ptr& indexParams=makePtr(), const Ptr& searchParams=makePtr() ); - virtual void add( InputArrayOfArrays descriptors ); - virtual void clear(); + virtual void add( InputArrayOfArrays descriptors ) CV_OVERRIDE; + virtual void clear() CV_OVERRIDE; // Reads matcher object from a file node - virtual void read( const FileNode& ); + virtual void read( const FileNode& ) CV_OVERRIDE; // Writes matcher object to a file storage - virtual void write( FileStorage& ) const; + virtual void write( FileStorage& ) const CV_OVERRIDE; - virtual void train(); - virtual bool isMaskSupported() const; + virtual void train() CV_OVERRIDE; + virtual bool isMaskSupported() const CV_OVERRIDE; CV_WRAP static Ptr create(); - virtual Ptr clone( bool emptyTrainData=false ) const; + virtual Ptr clone( bool emptyTrainData=false ) const CV_OVERRIDE; protected: static void convertToDMatches( const DescriptorCollection& descriptors, const Mat& indices, const Mat& distances, std::vector >& matches ); virtual void knnMatchImpl( InputArray queryDescriptors, std::vector >& matches, int k, - InputArrayOfArrays masks=noArray(), bool compactResult=false ); + InputArrayOfArrays masks=noArray(), bool compactResult=false ) CV_OVERRIDE; virtual void radiusMatchImpl( InputArray queryDescriptors, std::vector >& matches, float maxDistance, - InputArrayOfArrays masks=noArray(), bool compactResult=false ); + InputArrayOfArrays masks=noArray(), bool compactResult=false ) CV_OVERRIDE; Ptr indexParams; Ptr searchParams; @@ -1327,8 +1327,8 @@ public: virtual ~BOWKMeansTrainer(); // Returns trained vocabulary (i.e. cluster centers). - CV_WRAP virtual Mat cluster() const; - CV_WRAP virtual Mat cluster( const Mat& descriptors ) const; + CV_WRAP virtual Mat cluster() const CV_OVERRIDE; + CV_WRAP virtual Mat cluster( const Mat& descriptors ) const CV_OVERRIDE; protected: diff --git a/modules/features2d/src/agast.cpp b/modules/features2d/src/agast.cpp index e77d556476..ab01b67805 100644 --- a/modules/features2d/src/agast.cpp +++ b/modules/features2d/src/agast.cpp @@ -7941,14 +7941,14 @@ void AGAST(InputArray _img, std::vector& keypoints, int threshold, boo AGAST(_img, keypoints, threshold, nonmax_suppression, AgastFeatureDetector::OAST_9_16); } -class AgastFeatureDetector_Impl : public AgastFeatureDetector +class AgastFeatureDetector_Impl CV_FINAL : public AgastFeatureDetector { public: AgastFeatureDetector_Impl( int _threshold, bool _nonmaxSuppression, int _type ) : threshold(_threshold), nonmaxSuppression(_nonmaxSuppression), type((short)_type) {} - void detect( InputArray _image, std::vector& keypoints, InputArray _mask ) + void detect( InputArray _image, std::vector& keypoints, InputArray _mask ) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -7986,14 +7986,14 @@ public: return 0; } - void setThreshold(int threshold_) { threshold = threshold_; } - int getThreshold() const { return threshold; } + void setThreshold(int threshold_) CV_OVERRIDE { threshold = threshold_; } + int getThreshold() const CV_OVERRIDE { return threshold; } - void setNonmaxSuppression(bool f) { nonmaxSuppression = f; } - bool getNonmaxSuppression() const { return nonmaxSuppression; } + void setNonmaxSuppression(bool f) CV_OVERRIDE { nonmaxSuppression = f; } + bool getNonmaxSuppression() const CV_OVERRIDE { return nonmaxSuppression; } - void setType(int type_) { type = type_; } - int getType() const { return type; } + void setType(int type_) CV_OVERRIDE { type = type_; } + int getType() const CV_OVERRIDE { return type; } int threshold; bool nonmaxSuppression; diff --git a/modules/features2d/src/akaze.cpp b/modules/features2d/src/akaze.cpp index c63bb74be3..d5cc25d358 100644 --- a/modules/features2d/src/akaze.cpp +++ b/modules/features2d/src/akaze.cpp @@ -72,34 +72,34 @@ namespace cv { } - virtual ~AKAZE_Impl() + virtual ~AKAZE_Impl() CV_OVERRIDE { } - void setDescriptorType(int dtype) { descriptor = dtype; } - int getDescriptorType() const { return descriptor; } + void setDescriptorType(int dtype) CV_OVERRIDE { descriptor = dtype; } + int getDescriptorType() const CV_OVERRIDE { return descriptor; } - void setDescriptorSize(int dsize) { descriptor_size = dsize; } - int getDescriptorSize() const { return descriptor_size; } + void setDescriptorSize(int dsize) CV_OVERRIDE { descriptor_size = dsize; } + int getDescriptorSize() const CV_OVERRIDE { return descriptor_size; } - void setDescriptorChannels(int dch) { descriptor_channels = dch; } - int getDescriptorChannels() const { return descriptor_channels; } + void setDescriptorChannels(int dch) CV_OVERRIDE { descriptor_channels = dch; } + int getDescriptorChannels() const CV_OVERRIDE { return descriptor_channels; } - void setThreshold(double threshold_) { threshold = (float)threshold_; } - double getThreshold() const { return threshold; } + void setThreshold(double threshold_) CV_OVERRIDE { threshold = (float)threshold_; } + double getThreshold() const CV_OVERRIDE { return threshold; } - void setNOctaves(int octaves_) { octaves = octaves_; } - int getNOctaves() const { return octaves; } + void setNOctaves(int octaves_) CV_OVERRIDE { octaves = octaves_; } + int getNOctaves() const CV_OVERRIDE { return octaves; } - void setNOctaveLayers(int octaveLayers_) { sublevels = octaveLayers_; } - int getNOctaveLayers() const { return sublevels; } + void setNOctaveLayers(int octaveLayers_) CV_OVERRIDE { sublevels = octaveLayers_; } + int getNOctaveLayers() const CV_OVERRIDE { return sublevels; } - void setDiffusivity(int diff_) { diffusivity = diff_; } - int getDiffusivity() const { return diffusivity; } + void setDiffusivity(int diff_) CV_OVERRIDE { diffusivity = diff_; } + int getDiffusivity() const CV_OVERRIDE { return diffusivity; } // returns the descriptor size in bytes - int descriptorSize() const + int descriptorSize() const CV_OVERRIDE { switch (descriptor) { @@ -127,7 +127,7 @@ namespace cv } // returns the descriptor type - int descriptorType() const + int descriptorType() const CV_OVERRIDE { switch (descriptor) { @@ -145,7 +145,7 @@ namespace cv } // returns the default norm type - int defaultNorm() const + int defaultNorm() const CV_OVERRIDE { switch (descriptor) { @@ -165,7 +165,7 @@ namespace cv void detectAndCompute(InputArray image, InputArray mask, std::vector& keypoints, OutputArray descriptors, - bool useProvidedKeypoints) + bool useProvidedKeypoints) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -204,7 +204,7 @@ namespace cv } } - void write(FileStorage& fs) const + void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "descriptor" << descriptor; @@ -216,7 +216,7 @@ namespace cv fs << "diffusivity" << diffusivity; } - void read(const FileNode& fn) + void read(const FileNode& fn) CV_OVERRIDE { descriptor = (int)fn["descriptor"]; descriptor_channels = (int)fn["descriptor_channels"]; diff --git a/modules/features2d/src/blobdetector.cpp b/modules/features2d/src/blobdetector.cpp index d3f6a6d709..ffcc431b58 100644 --- a/modules/features2d/src/blobdetector.cpp +++ b/modules/features2d/src/blobdetector.cpp @@ -64,8 +64,8 @@ public: explicit SimpleBlobDetectorImpl(const SimpleBlobDetector::Params ¶meters = SimpleBlobDetector::Params()); - 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: struct CV_EXPORTS Center @@ -75,7 +75,7 @@ protected: double confidence; }; - virtual void detect( InputArray image, std::vector& keypoints, InputArray mask=noArray() ); + virtual void detect( InputArray image, std::vector& keypoints, InputArray mask=noArray() ) CV_OVERRIDE; virtual void findBlobs(InputArray image, InputArray binaryImage, std::vector
¢ers) const; Params params; diff --git a/modules/features2d/src/brisk.cpp b/modules/features2d/src/brisk.cpp index 00810a62fd..bacea2b5a4 100644 --- a/modules/features2d/src/brisk.cpp +++ b/modules/features2d/src/brisk.cpp @@ -51,7 +51,7 @@ namespace cv { -class BRISK_Impl : public BRISK +class BRISK_Impl CV_FINAL : public BRISK { public: explicit BRISK_Impl(int thresh=30, int octaves=3, float patternScale=1.0f); @@ -65,17 +65,17 @@ public: virtual ~BRISK_Impl(); - int descriptorSize() const + int descriptorSize() const CV_OVERRIDE { return strings_; } - int descriptorType() const + int descriptorType() const CV_OVERRIDE { return CV_8U; } - int defaultNorm() const + int defaultNorm() const CV_OVERRIDE { return NORM_HAMMING; } @@ -90,7 +90,7 @@ public: void detectAndCompute( InputArray image, InputArray mask, CV_OUT std::vector& keypoints, OutputArray descriptors, - bool useProvidedKeypoints ); + bool useProvidedKeypoints ) CV_OVERRIDE; protected: @@ -151,11 +151,11 @@ private: // a layer in the Brisk detector pyramid -class CV_EXPORTS BriskLayer +class BriskLayer { public: // constructor arguments - struct CV_EXPORTS CommonParams + struct CommonParams { static const int HALFSAMPLE = 0; static const int TWOTHIRDSAMPLE = 1; @@ -223,7 +223,7 @@ private: int pixel_9_16_[25]; }; -class CV_EXPORTS BriskScaleSpace +class BriskScaleSpace { public: // construct telling the octaves number: diff --git a/modules/features2d/src/fast.avx2.cpp b/modules/features2d/src/fast.avx2.cpp index b319ae1c9f..ca0bcb9269 100644 --- a/modules/features2d/src/fast.avx2.cpp +++ b/modules/features2d/src/fast.avx2.cpp @@ -50,7 +50,7 @@ namespace cv namespace opt_AVX2 { -class FAST_t_patternSize16_AVX2_Impl: public FAST_t_patternSize16_AVX2 +class FAST_t_patternSize16_AVX2_Impl CV_FINAL: public FAST_t_patternSize16_AVX2 { public: FAST_t_patternSize16_AVX2_Impl(int _cols, int _threshold, bool _nonmax_suppression, const int* _pixel): @@ -61,7 +61,7 @@ public: threshold = std::min(std::max(_threshold, 0), 255); } - virtual void process(int &j, const uchar* &ptr, uchar* curr, int* cornerpos, int &ncorners) + virtual void process(int &j, const uchar* &ptr, uchar* curr, int* cornerpos, int &ncorners) CV_OVERRIDE { static const __m256i delta256 = _mm256_broadcastsi128_si256(_mm_set1_epi8((char)(-128))), K16_256 = _mm256_broadcastsi128_si256(_mm_set1_epi8((char)8)); const __m256i t256 = _mm256_broadcastsi128_si256(_mm_set1_epi8(t256c)); @@ -165,7 +165,7 @@ public: _mm256_zeroupper(); } - virtual ~FAST_t_patternSize16_AVX2_Impl() {}; + virtual ~FAST_t_patternSize16_AVX2_Impl() CV_OVERRIDE {}; private: int cols; diff --git a/modules/features2d/src/fast.cpp b/modules/features2d/src/fast.cpp index 0f2a0cbc9c..106e5802cd 100644 --- a/modules/features2d/src/fast.cpp +++ b/modules/features2d/src/fast.cpp @@ -515,14 +515,14 @@ void FAST(InputArray _img, std::vector& keypoints, int threshold, bool } -class FastFeatureDetector_Impl : public FastFeatureDetector +class FastFeatureDetector_Impl CV_FINAL : public FastFeatureDetector { public: FastFeatureDetector_Impl( int _threshold, bool _nonmaxSuppression, int _type ) : threshold(_threshold), nonmaxSuppression(_nonmaxSuppression), type((short)_type) {} - void detect( InputArray _image, std::vector& keypoints, InputArray _mask ) + void detect( InputArray _image, std::vector& keypoints, InputArray _mask ) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -563,14 +563,14 @@ public: return 0; } - void setThreshold(int threshold_) { threshold = threshold_; } - int getThreshold() const { return threshold; } + void setThreshold(int threshold_) CV_OVERRIDE { threshold = threshold_; } + int getThreshold() const CV_OVERRIDE { return threshold; } - void setNonmaxSuppression(bool f) { nonmaxSuppression = f; } - bool getNonmaxSuppression() const { return nonmaxSuppression; } + void setNonmaxSuppression(bool f) CV_OVERRIDE { nonmaxSuppression = f; } + bool getNonmaxSuppression() const CV_OVERRIDE { return nonmaxSuppression; } - void setType(int type_) { type = type_; } - int getType() const { return type; } + void setType(int type_) CV_OVERRIDE { type = type_; } + int getType() const CV_OVERRIDE { return type; } int threshold; bool nonmaxSuppression; diff --git a/modules/features2d/src/gftt.cpp b/modules/features2d/src/gftt.cpp index c98e17e16b..1b8010625b 100644 --- a/modules/features2d/src/gftt.cpp +++ b/modules/features2d/src/gftt.cpp @@ -44,7 +44,7 @@ namespace cv { -class GFTTDetector_Impl : public GFTTDetector +class GFTTDetector_Impl CV_FINAL : public GFTTDetector { public: GFTTDetector_Impl( int _nfeatures, double _qualityLevel, @@ -55,28 +55,28 @@ public: { } - void setMaxFeatures(int maxFeatures) { nfeatures = maxFeatures; } - int getMaxFeatures() const { return nfeatures; } + void setMaxFeatures(int maxFeatures) CV_OVERRIDE { nfeatures = maxFeatures; } + int getMaxFeatures() const CV_OVERRIDE { return nfeatures; } - void setQualityLevel(double qlevel) { qualityLevel = qlevel; } - double getQualityLevel() const { return qualityLevel; } + void setQualityLevel(double qlevel) CV_OVERRIDE { qualityLevel = qlevel; } + double getQualityLevel() const CV_OVERRIDE { return qualityLevel; } - void setMinDistance(double minDistance_) { minDistance = minDistance_; } - double getMinDistance() const { return minDistance; } + void setMinDistance(double minDistance_) CV_OVERRIDE { minDistance = minDistance_; } + double getMinDistance() const CV_OVERRIDE { return minDistance; } - void setBlockSize(int blockSize_) { blockSize = blockSize_; } - int getBlockSize() const { return blockSize; } + void setBlockSize(int blockSize_) CV_OVERRIDE { blockSize = blockSize_; } + int getBlockSize() const CV_OVERRIDE { return blockSize; } - void setGradientSize(int gradientSize_) { gradSize = gradientSize_; } - int getGradientSize() { return gradSize; } + //void setGradientSize(int gradientSize_) { gradSize = gradientSize_; } + //int getGradientSize() { return gradSize; } - void setHarrisDetector(bool val) { useHarrisDetector = val; } - bool getHarrisDetector() const { return useHarrisDetector; } + void setHarrisDetector(bool val) CV_OVERRIDE { useHarrisDetector = val; } + bool getHarrisDetector() const CV_OVERRIDE { return useHarrisDetector; } - void setK(double k_) { k = k_; } - double getK() const { return k; } + void setK(double k_) CV_OVERRIDE { k = k_; } + double getK() const CV_OVERRIDE { return k; } - void detect( InputArray _image, std::vector& keypoints, InputArray _mask ) + void detect( InputArray _image, std::vector& keypoints, InputArray _mask ) CV_OVERRIDE { CV_INSTRUMENT_REGION() diff --git a/modules/features2d/src/kaze.cpp b/modules/features2d/src/kaze.cpp index 7f2a9ad2bb..a2c5209eeb 100644 --- a/modules/features2d/src/kaze.cpp +++ b/modules/features2d/src/kaze.cpp @@ -53,7 +53,7 @@ http://www.robesafe.com/personal/pablo.alcantarilla/papers/Alcantarilla12eccv.pd namespace cv { - class KAZE_Impl : public KAZE + class KAZE_Impl CV_FINAL : public KAZE { public: KAZE_Impl(bool _extended, bool _upright, float _threshold, int _octaves, @@ -67,40 +67,40 @@ namespace cv { } - virtual ~KAZE_Impl() {} + virtual ~KAZE_Impl() CV_OVERRIDE {} - 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; } - void setThreshold(double threshold_) { threshold = (float)threshold_; } - double getThreshold() const { return threshold; } + void setThreshold(double threshold_) CV_OVERRIDE { threshold = (float)threshold_; } + double getThreshold() const CV_OVERRIDE { return threshold; } - void setNOctaves(int octaves_) { octaves = octaves_; } - int getNOctaves() const { return octaves; } + void setNOctaves(int octaves_) CV_OVERRIDE { octaves = octaves_; } + int getNOctaves() const CV_OVERRIDE { return octaves; } - void setNOctaveLayers(int octaveLayers_) { sublevels = octaveLayers_; } - int getNOctaveLayers() const { return sublevels; } + void setNOctaveLayers(int octaveLayers_) CV_OVERRIDE { sublevels = octaveLayers_; } + int getNOctaveLayers() const CV_OVERRIDE { return sublevels; } - void setDiffusivity(int diff_) { diffusivity = diff_; } - int getDiffusivity() const { return diffusivity; } + void setDiffusivity(int diff_) CV_OVERRIDE { diffusivity = diff_; } + int getDiffusivity() const CV_OVERRIDE { return diffusivity; } // returns the descriptor size in bytes - int descriptorSize() const + int descriptorSize() const CV_OVERRIDE { return extended ? 128 : 64; } // returns the descriptor type - int descriptorType() const + int descriptorType() const CV_OVERRIDE { return CV_32F; } // returns the default norm type - int defaultNorm() const + int defaultNorm() const CV_OVERRIDE { return NORM_L2; } @@ -108,7 +108,7 @@ namespace cv void detectAndCompute(InputArray image, InputArray mask, std::vector& keypoints, OutputArray descriptors, - bool useProvidedKeypoints) + bool useProvidedKeypoints) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -160,7 +160,7 @@ namespace cv } } - void write(FileStorage& fs) const + void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "extended" << (int)extended; @@ -171,7 +171,7 @@ namespace cv fs << "diffusivity" << diffusivity; } - void read(const FileNode& fn) + void read(const FileNode& fn) CV_OVERRIDE { extended = (int)fn["extended"] != 0; upright = (int)fn["upright"] != 0; diff --git a/modules/features2d/src/kaze/AKAZEFeatures.cpp b/modules/features2d/src/kaze/AKAZEFeatures.cpp index 66acc8ada7..381800eebd 100644 --- a/modules/features2d/src/kaze/AKAZEFeatures.cpp +++ b/modules/features2d/src/kaze/AKAZEFeatures.cpp @@ -237,7 +237,7 @@ public: : Lt_(&Lt), Lf_(&Lf), Lstep_(&Lstep), step_size_(step_size) {} - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { nld_step_scalar_one_lane(*Lt_, *Lf_, *Lstep_, step_size_, range.start, range.end); } @@ -603,7 +603,7 @@ public: { } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { MatType Lxx, Lxy, Lyy; @@ -725,7 +725,7 @@ public: : evolution_(&ev), keypoints_by_layers_(&kpts), dthreshold_(dthreshold) {} - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { for (int i = range.start; i < range.end; i++) { @@ -948,7 +948,7 @@ public: { } - void operator() (const Range& range) const + void operator() (const Range& range) const CV_OVERRIDE { for (int i = range.start; i < range.end; i++) { @@ -974,7 +974,7 @@ public: { } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { for (int i = range.start; i < range.end; i++) { @@ -1000,7 +1000,7 @@ public: { } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { for (int i = range.start; i < range.end; i++) { @@ -1026,7 +1026,7 @@ public: { } - void operator() (const Range& range) const + void operator() (const Range& range) const CV_OVERRIDE { for (int i = range.start; i < range.end; i++) { @@ -1053,7 +1053,7 @@ public: { } - void operator() (const Range& range) const + void operator() (const Range& range) const CV_OVERRIDE { for (int i = range.start; i < range.end; i++) { @@ -1088,7 +1088,7 @@ public: { } - void operator() (const Range& range) const + void operator() (const Range& range) const CV_OVERRIDE { for (int i = range.start; i < range.end; i++) { @@ -1119,7 +1119,7 @@ public: { } - void operator() (const Range& range) const + void operator() (const Range& range) const CV_OVERRIDE { for (int i = range.start; i < range.end; i++) { @@ -1158,7 +1158,7 @@ public: { } - void operator() (const Range& range) const + void operator() (const Range& range) const CV_OVERRIDE { for (int i = range.start; i < range.end; i++) { @@ -1448,7 +1448,7 @@ public: { } - 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/features2d/src/kaze/KAZEFeatures.cpp b/modules/features2d/src/kaze/KAZEFeatures.cpp index ab5a2c6afb..0cc52d9117 100644 --- a/modules/features2d/src/kaze/KAZEFeatures.cpp +++ b/modules/features2d/src/kaze/KAZEFeatures.cpp @@ -196,7 +196,7 @@ public: { } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { std::vector& evolution = *evolution_; for (int i = range.start; i < range.end; i++) @@ -239,7 +239,7 @@ public: { } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { std::vector& evolution = *evolution_; std::vector >& kpts_par = *kpts_par_; @@ -503,11 +503,11 @@ public: { } - void operator() (const Range& range) const + void operator() (const Range& range) const CV_OVERRIDE { - std::vector &kpts = *kpts_; - Mat &desc = *desc_; - std::vector &evolution = *evolution_; + std::vector &kpts = *kpts_; + Mat &desc = *desc_; + std::vector &evolution = *evolution_; for (int i = range.start; i < range.end; i++) { diff --git a/modules/features2d/src/kaze/nldiffusion_functions.cpp b/modules/features2d/src/kaze/nldiffusion_functions.cpp index 16b9615328..f87ca172a7 100644 --- a/modules/features2d/src/kaze/nldiffusion_functions.cpp +++ b/modules/features2d/src/kaze/nldiffusion_functions.cpp @@ -378,7 +378,7 @@ public: } - void operator()(const cv::Range& range) const + void operator()(const cv::Range& range) const CV_OVERRIDE { cv::Mat& Ld = *_Ld; const cv::Mat& c = *_c; diff --git a/modules/features2d/src/mser.cpp b/modules/features2d/src/mser.cpp index eb9248c681..f37f84a936 100755 --- a/modules/features2d/src/mser.cpp +++ b/modules/features2d/src/mser.cpp @@ -48,7 +48,7 @@ namespace cv using std::vector; -class MSER_Impl : public MSER +class MSER_Impl CV_FINAL : public MSER { public: struct Params @@ -85,19 +85,19 @@ public: explicit MSER_Impl(const Params& _params) : params(_params) {} - virtual ~MSER_Impl() {} + virtual ~MSER_Impl() CV_OVERRIDE {} - void setDelta(int delta) { params.delta = delta; } - int getDelta() const { return params.delta; } + void setDelta(int delta) CV_OVERRIDE { params.delta = delta; } + int getDelta() const CV_OVERRIDE { return params.delta; } - void setMinArea(int minArea) { params.minArea = minArea; } - int getMinArea() const { return params.minArea; } + void setMinArea(int minArea) CV_OVERRIDE { params.minArea = minArea; } + int getMinArea() const CV_OVERRIDE { return params.minArea; } - void setMaxArea(int maxArea) { params.maxArea = maxArea; } - int getMaxArea() const { return params.maxArea; } + void setMaxArea(int maxArea) CV_OVERRIDE { params.maxArea = maxArea; } + int getMaxArea() const CV_OVERRIDE { return params.maxArea; } - void setPass2Only(bool f) { params.pass2Only = f; } - bool getPass2Only() const { return params.pass2Only; } + void setPass2Only(bool f) CV_OVERRIDE { params.pass2Only = f; } + bool getPass2Only() const CV_OVERRIDE { return params.pass2Only; } enum { DIR_SHIFT = 29, NEXT_MASK = ((1< >& msers, - std::vector& bboxes ); - void detect( InputArray _src, vector& keypoints, InputArray _mask ); + std::vector& bboxes ) CV_OVERRIDE; + void detect( InputArray _src, vector& keypoints, InputArray _mask ) CV_OVERRIDE; void preprocess1( const Mat& img, int* level_size ) { diff --git a/modules/features2d/src/orb.cpp b/modules/features2d/src/orb.cpp index 722e81b96f..453ddf420d 100644 --- a/modules/features2d/src/orb.cpp +++ b/modules/features2d/src/orb.cpp @@ -651,7 +651,7 @@ static inline float getScale(int level, int firstLevel, double scaleFactor) } -class ORB_Impl : public ORB +class ORB_Impl CV_FINAL : public ORB { public: explicit ORB_Impl(int _nfeatures, float _scaleFactor, int _nlevels, int _edgeThreshold, @@ -661,43 +661,43 @@ public: scoreType(_scoreType), patchSize(_patchSize), fastThreshold(_fastThreshold) {} - void setMaxFeatures(int maxFeatures) { nfeatures = maxFeatures; } - int getMaxFeatures() const { return nfeatures; } + void setMaxFeatures(int maxFeatures) CV_OVERRIDE { nfeatures = maxFeatures; } + int getMaxFeatures() const CV_OVERRIDE { return nfeatures; } - void setScaleFactor(double scaleFactor_) { scaleFactor = scaleFactor_; } - double getScaleFactor() const { return scaleFactor; } + void setScaleFactor(double scaleFactor_) CV_OVERRIDE { scaleFactor = scaleFactor_; } + double getScaleFactor() const CV_OVERRIDE { return scaleFactor; } - void setNLevels(int nlevels_) { nlevels = nlevels_; } - int getNLevels() const { return nlevels; } + void setNLevels(int nlevels_) CV_OVERRIDE { nlevels = nlevels_; } + int getNLevels() const CV_OVERRIDE { return nlevels; } - void setEdgeThreshold(int edgeThreshold_) { edgeThreshold = edgeThreshold_; } - int getEdgeThreshold() const { return edgeThreshold; } + void setEdgeThreshold(int edgeThreshold_) CV_OVERRIDE { edgeThreshold = edgeThreshold_; } + int getEdgeThreshold() const CV_OVERRIDE { return edgeThreshold; } - void setFirstLevel(int firstLevel_) { CV_Assert(firstLevel_ >= 0); firstLevel = firstLevel_; } - int getFirstLevel() const { return firstLevel; } + void setFirstLevel(int firstLevel_) CV_OVERRIDE { CV_Assert(firstLevel_ >= 0); firstLevel = firstLevel_; } + int getFirstLevel() const CV_OVERRIDE { return firstLevel; } - void setWTA_K(int wta_k_) { wta_k = wta_k_; } - int getWTA_K() const { return wta_k; } + void setWTA_K(int wta_k_) CV_OVERRIDE { wta_k = wta_k_; } + int getWTA_K() const CV_OVERRIDE { return wta_k; } - void setScoreType(int scoreType_) { scoreType = scoreType_; } - int getScoreType() const { return scoreType; } + void setScoreType(int scoreType_) CV_OVERRIDE { scoreType = scoreType_; } + int getScoreType() const CV_OVERRIDE { return scoreType; } - void setPatchSize(int patchSize_) { patchSize = patchSize_; } - int getPatchSize() const { return patchSize; } + void setPatchSize(int patchSize_) CV_OVERRIDE { patchSize = patchSize_; } + int getPatchSize() const CV_OVERRIDE { return patchSize; } - void setFastThreshold(int fastThreshold_) { fastThreshold = fastThreshold_; } - int getFastThreshold() const { return fastThreshold; } + void setFastThreshold(int fastThreshold_) CV_OVERRIDE { fastThreshold = fastThreshold_; } + int getFastThreshold() const CV_OVERRIDE { return fastThreshold; } // returns the descriptor size in bytes - 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; // Compute the ORB_Impl features and descriptors on an image void detectAndCompute( InputArray image, InputArray mask, std::vector& keypoints, - OutputArray descriptors, bool useProvidedKeypoints=false ); + OutputArray descriptors, bool useProvidedKeypoints=false ) CV_OVERRIDE; protected: diff --git a/modules/flann/include/opencv2/flann/any.h b/modules/flann/include/opencv2/flann/any.h index e829162bb6..5b57aa3df3 100644 --- a/modules/flann/include/opencv2/flann/any.h +++ b/modules/flann/include/opencv2/flann/any.h @@ -54,50 +54,50 @@ struct base_any_policy template struct typed_base_any_policy : base_any_policy { - virtual ::size_t get_size() { return sizeof(T); } - virtual const std::type_info& type() { return typeid(T); } + virtual ::size_t get_size() CV_OVERRIDE { return sizeof(T); } + virtual const std::type_info& type() CV_OVERRIDE { return typeid(T); } }; template -struct small_any_policy : typed_base_any_policy +struct small_any_policy CV_FINAL : typed_base_any_policy { - virtual void static_delete(void**) { } - virtual void copy_from_value(void const* src, void** dest) + virtual void static_delete(void**) CV_OVERRIDE { } + virtual void copy_from_value(void const* src, void** dest) CV_OVERRIDE { new (dest) T(* reinterpret_cast(src)); } - virtual void clone(void* const* src, void** dest) { *dest = *src; } - virtual void move(void* const* src, void** dest) { *dest = *src; } - virtual void* get_value(void** src) { return reinterpret_cast(src); } - virtual const void* get_value(void* const * src) { return reinterpret_cast(src); } - virtual void print(std::ostream& out, void* const* src) { out << *reinterpret_cast(src); } + virtual void clone(void* const* src, void** dest) CV_OVERRIDE { *dest = *src; } + virtual void move(void* const* src, void** dest) CV_OVERRIDE { *dest = *src; } + virtual void* get_value(void** src) CV_OVERRIDE { return reinterpret_cast(src); } + virtual const void* get_value(void* const * src) CV_OVERRIDE { return reinterpret_cast(src); } + virtual void print(std::ostream& out, void* const* src) CV_OVERRIDE { out << *reinterpret_cast(src); } }; template -struct big_any_policy : typed_base_any_policy +struct big_any_policy CV_FINAL : typed_base_any_policy { - virtual void static_delete(void** x) + virtual void static_delete(void** x) CV_OVERRIDE { if (* x) delete (* reinterpret_cast(x)); *x = NULL; } - virtual void copy_from_value(void const* src, void** dest) + virtual void copy_from_value(void const* src, void** dest) CV_OVERRIDE { *dest = new T(*reinterpret_cast(src)); } - virtual void clone(void* const* src, void** dest) + virtual void clone(void* const* src, void** dest) CV_OVERRIDE { *dest = new T(**reinterpret_cast(src)); } - virtual void move(void* const* src, void** dest) + virtual void move(void* const* src, void** dest) CV_OVERRIDE { (*reinterpret_cast(dest))->~T(); **reinterpret_cast(dest) = **reinterpret_cast(src); } - virtual void* get_value(void** src) { return *src; } - virtual const void* get_value(void* const * src) { return *src; } - virtual void print(std::ostream& out, void* const* src) { out << *reinterpret_cast(*src); } + virtual void* get_value(void** src) CV_OVERRIDE { return *src; } + virtual const void* get_value(void* const * src) CV_OVERRIDE { return *src; } + virtual void print(std::ostream& out, void* const* src) CV_OVERRIDE { out << *reinterpret_cast(*src); } }; template<> inline void big_any_policy::print(std::ostream& out, void* const* src) diff --git a/modules/flann/include/opencv2/flann/autotuned_index.h b/modules/flann/include/opencv2/flann/autotuned_index.h index e9abbf7214..2fbc6c9afb 100644 --- a/modules/flann/include/opencv2/flann/autotuned_index.h +++ b/modules/flann/include/opencv2/flann/autotuned_index.h @@ -100,7 +100,7 @@ public: /** * Method responsible with building the index. */ - virtual void buildIndex() + virtual void buildIndex() CV_OVERRIDE { std::ostringstream stream; bestParams_ = estimateBuildParams(); @@ -124,7 +124,7 @@ public: /** * Saves the index to a stream */ - virtual void saveIndex(FILE* stream) + virtual void saveIndex(FILE* stream) CV_OVERRIDE { save_value(stream, (int)bestIndex_->getType()); bestIndex_->saveIndex(stream); @@ -134,7 +134,7 @@ public: /** * Loads the index from a stream */ - virtual void loadIndex(FILE* stream) + virtual void loadIndex(FILE* stream) CV_OVERRIDE { int index_type; @@ -151,7 +151,7 @@ public: /** * Method that searches for nearest-neighbors */ - virtual void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) + virtual void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE { int checks = get_param(searchParams,"checks",FLANN_CHECKS_AUTOTUNED); if (checks == FLANN_CHECKS_AUTOTUNED) { @@ -163,7 +163,7 @@ public: } - IndexParams getParameters() const + IndexParams getParameters() const CV_OVERRIDE { return bestIndex_->getParameters(); } @@ -182,7 +182,7 @@ public: /** * Number of features in this index. */ - virtual size_t size() const + virtual size_t size() const CV_OVERRIDE { return bestIndex_->size(); } @@ -190,7 +190,7 @@ public: /** * The length of each vector in this index. */ - virtual size_t veclen() const + virtual size_t veclen() const CV_OVERRIDE { return bestIndex_->veclen(); } @@ -198,7 +198,7 @@ public: /** * The amount of memory (in bytes) this index uses. */ - virtual int usedMemory() const + virtual int usedMemory() const CV_OVERRIDE { return bestIndex_->usedMemory(); } @@ -206,7 +206,7 @@ public: /** * Algorithm name */ - virtual flann_algorithm_t getType() const + virtual flann_algorithm_t getType() const CV_OVERRIDE { return FLANN_INDEX_AUTOTUNED; } diff --git a/modules/flann/include/opencv2/flann/composite_index.h b/modules/flann/include/opencv2/flann/composite_index.h index 527ca1ad77..5e12a177bf 100644 --- a/modules/flann/include/opencv2/flann/composite_index.h +++ b/modules/flann/include/opencv2/flann/composite_index.h @@ -101,7 +101,7 @@ public: /** * @return The index type */ - flann_algorithm_t getType() const + flann_algorithm_t getType() const CV_OVERRIDE { return FLANN_INDEX_COMPOSITE; } @@ -109,7 +109,7 @@ public: /** * @return Size of the index */ - size_t size() const + size_t size() const CV_OVERRIDE { return kdtree_index_->size(); } @@ -117,7 +117,7 @@ public: /** * \returns The dimensionality of the features in this index. */ - size_t veclen() const + size_t veclen() const CV_OVERRIDE { return kdtree_index_->veclen(); } @@ -125,7 +125,7 @@ public: /** * \returns The amount of memory (in bytes) used by the index. */ - int usedMemory() const + int usedMemory() const CV_OVERRIDE { return kmeans_index_->usedMemory() + kdtree_index_->usedMemory(); } @@ -133,7 +133,7 @@ public: /** * \brief Builds the index */ - void buildIndex() + void buildIndex() CV_OVERRIDE { Logger::info("Building kmeans tree...\n"); kmeans_index_->buildIndex(); @@ -145,7 +145,7 @@ public: * \brief Saves the index to a stream * \param stream The stream to save the index to */ - void saveIndex(FILE* stream) + void saveIndex(FILE* stream) CV_OVERRIDE { kmeans_index_->saveIndex(stream); kdtree_index_->saveIndex(stream); @@ -155,7 +155,7 @@ public: * \brief Loads the index from a stream * \param stream The stream from which the index is loaded */ - void loadIndex(FILE* stream) + void loadIndex(FILE* stream) CV_OVERRIDE { kmeans_index_->loadIndex(stream); kdtree_index_->loadIndex(stream); @@ -164,7 +164,7 @@ public: /** * \returns The index parameters */ - IndexParams getParameters() const + IndexParams getParameters() const CV_OVERRIDE { return index_params_; } @@ -172,7 +172,7 @@ public: /** * \brief Method that searches for nearest-neighbours */ - void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) + void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE { kmeans_index_->findNeighbors(result, vec, searchParams); kdtree_index_->findNeighbors(result, vec, searchParams); diff --git a/modules/flann/include/opencv2/flann/flann_base.hpp b/modules/flann/include/opencv2/flann/flann_base.hpp index f3fd4fb20f..0ffb857cc6 100644 --- a/modules/flann/include/opencv2/flann/flann_base.hpp +++ b/modules/flann/include/opencv2/flann/flann_base.hpp @@ -128,7 +128,7 @@ public: /** * Builds the index. */ - void buildIndex() + void buildIndex() CV_OVERRIDE { if (!loaded_) { nnIndex_->buildIndex(); @@ -150,7 +150,7 @@ public: * \brief Saves the index to a stream * \param stream The stream to save the index to */ - virtual void saveIndex(FILE* stream) + virtual void saveIndex(FILE* stream) CV_OVERRIDE { nnIndex_->saveIndex(stream); } @@ -159,7 +159,7 @@ public: * \brief Loads the index from a stream * \param stream The stream from which the index is loaded */ - virtual void loadIndex(FILE* stream) + virtual void loadIndex(FILE* stream) CV_OVERRIDE { nnIndex_->loadIndex(stream); } @@ -167,7 +167,7 @@ public: /** * \returns number of features in this index. */ - size_t veclen() const + size_t veclen() const CV_OVERRIDE { return nnIndex_->veclen(); } @@ -175,7 +175,7 @@ public: /** * \returns The dimensionality of the features in this index. */ - size_t size() const + size_t size() const CV_OVERRIDE { return nnIndex_->size(); } @@ -183,7 +183,7 @@ public: /** * \returns The index type (kdtree, kmeans,...) */ - flann_algorithm_t getType() const + flann_algorithm_t getType() const CV_OVERRIDE { return nnIndex_->getType(); } @@ -191,7 +191,7 @@ public: /** * \returns The amount of memory (in bytes) used by the index. */ - virtual int usedMemory() const + virtual int usedMemory() const CV_OVERRIDE { return nnIndex_->usedMemory(); } @@ -200,7 +200,7 @@ public: /** * \returns The index parameters */ - IndexParams getParameters() const + IndexParams getParameters() const CV_OVERRIDE { return nnIndex_->getParameters(); } @@ -213,7 +213,7 @@ public: * \param[in] knn Number of nearest neighbors to return * \param[in] params Search parameters */ - void knnSearch(const Matrix& queries, Matrix& indices, Matrix& dists, int knn, const SearchParams& params) + void knnSearch(const Matrix& queries, Matrix& indices, Matrix& dists, int knn, const SearchParams& params) CV_OVERRIDE { nnIndex_->knnSearch(queries, indices, dists, knn, params); } @@ -227,7 +227,7 @@ public: * \param[in] params Search parameters * \returns Number of neighbors found */ - int radiusSearch(const Matrix& query, Matrix& indices, Matrix& dists, float radius, const SearchParams& params) + int radiusSearch(const Matrix& query, Matrix& indices, Matrix& dists, float radius, const SearchParams& params) CV_OVERRIDE { return nnIndex_->radiusSearch(query, indices, dists, radius, params); } @@ -235,7 +235,7 @@ public: /** * \brief Method that searches for nearest-neighbours */ - void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) + void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE { nnIndex_->findNeighbors(result, vec, searchParams); } diff --git a/modules/flann/include/opencv2/flann/hierarchical_clustering_index.h b/modules/flann/include/opencv2/flann/hierarchical_clustering_index.h index 9d890d4d68..2a947dab6b 100644 --- a/modules/flann/include/opencv2/flann/hierarchical_clustering_index.h +++ b/modules/flann/include/opencv2/flann/hierarchical_clustering_index.h @@ -435,7 +435,7 @@ public: /** * Returns size of index. */ - size_t size() const + size_t size() const CV_OVERRIDE { return size_; } @@ -443,7 +443,7 @@ public: /** * Returns the length of an index feature. */ - size_t veclen() const + size_t veclen() const CV_OVERRIDE { return veclen_; } @@ -453,7 +453,7 @@ public: * Computes the inde memory usage * Returns: memory used by the index */ - int usedMemory() const + int usedMemory() const CV_OVERRIDE { return pool.usedMemory+pool.wastedMemory+memoryCounter; } @@ -461,7 +461,7 @@ public: /** * Builds the index */ - void buildIndex() + void buildIndex() CV_OVERRIDE { if (branching_<2) { throw FLANNException("Branching factor must be at least 2"); @@ -480,13 +480,13 @@ public: } - flann_algorithm_t getType() const + flann_algorithm_t getType() const CV_OVERRIDE { return FLANN_INDEX_HIERARCHICAL; } - void saveIndex(FILE* stream) + void saveIndex(FILE* stream) CV_OVERRIDE { save_value(stream, branching_); save_value(stream, trees_); @@ -501,7 +501,7 @@ public: } - void loadIndex(FILE* stream) + void loadIndex(FILE* stream) CV_OVERRIDE { free_elements(); @@ -544,7 +544,7 @@ public: * vec = the vector for which to search the nearest neighbors * searchParams = parameters that influence the search algorithm (checks) */ - void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) + void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE { int maxChecks = get_param(searchParams,"checks",32); @@ -569,7 +569,7 @@ public: } - IndexParams getParameters() const + IndexParams getParameters() const CV_OVERRIDE { return params; } diff --git a/modules/flann/include/opencv2/flann/kdtree_index.h b/modules/flann/include/opencv2/flann/kdtree_index.h index 3f6ee01740..c233515b40 100644 --- a/modules/flann/include/opencv2/flann/kdtree_index.h +++ b/modules/flann/include/opencv2/flann/kdtree_index.h @@ -120,7 +120,7 @@ public: /** * Builds the index */ - void buildIndex() + void buildIndex() CV_OVERRIDE { /* Construct the randomized trees. */ for (int i = 0; i < trees_; i++) { @@ -136,13 +136,13 @@ public: } - flann_algorithm_t getType() const + flann_algorithm_t getType() const CV_OVERRIDE { return FLANN_INDEX_KDTREE; } - void saveIndex(FILE* stream) + void saveIndex(FILE* stream) CV_OVERRIDE { save_value(stream, trees_); for (int i=0; i& result, const ElementType* vec, const SearchParams& searchParams) + void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE { int maxChecks = get_param(searchParams,"checks", 32); float epsError = 1+get_param(searchParams,"eps",0.0f); @@ -214,7 +214,7 @@ public: } } - IndexParams getParameters() const + IndexParams getParameters() const CV_OVERRIDE { return index_params_; } diff --git a/modules/flann/include/opencv2/flann/kdtree_single_index.h b/modules/flann/include/opencv2/flann/kdtree_single_index.h index ef1539200a..22a28d0c1a 100644 --- a/modules/flann/include/opencv2/flann/kdtree_single_index.h +++ b/modules/flann/include/opencv2/flann/kdtree_single_index.h @@ -114,7 +114,7 @@ public: /** * Builds the index */ - void buildIndex() + void buildIndex() CV_OVERRIDE { computeBoundingBox(root_bbox_); root_node_ = divideTree(0, (int)size_, root_bbox_ ); // construct the tree @@ -133,13 +133,13 @@ public: } } - flann_algorithm_t getType() const + flann_algorithm_t getType() const CV_OVERRIDE { return FLANN_INDEX_KDTREE_SINGLE; } - void saveIndex(FILE* stream) + void saveIndex(FILE* stream) CV_OVERRIDE { save_value(stream, size_); save_value(stream, dim_); @@ -154,7 +154,7 @@ public: } - void loadIndex(FILE* stream) + void loadIndex(FILE* stream) CV_OVERRIDE { load_value(stream, size_); load_value(stream, dim_); @@ -179,7 +179,7 @@ public: /** * Returns size of index. */ - size_t size() const + size_t size() const CV_OVERRIDE { return size_; } @@ -187,7 +187,7 @@ public: /** * Returns the length of an index feature. */ - size_t veclen() const + size_t veclen() const CV_OVERRIDE { return dim_; } @@ -196,7 +196,7 @@ public: * Computes the inde memory usage * Returns: memory used by the index */ - int usedMemory() const + int usedMemory() const CV_OVERRIDE { return (int)(pool_.usedMemory+pool_.wastedMemory+dataset_.rows*sizeof(int)); // pool memory and vind array memory } @@ -210,7 +210,7 @@ public: * \param[in] knn Number of nearest neighbors to return * \param[in] params Search parameters */ - void knnSearch(const Matrix& queries, Matrix& indices, Matrix& dists, int knn, const SearchParams& params) + void knnSearch(const Matrix& queries, Matrix& indices, Matrix& dists, int knn, const SearchParams& params) CV_OVERRIDE { assert(queries.cols == veclen()); assert(indices.rows >= queries.rows); @@ -225,7 +225,7 @@ public: } } - IndexParams getParameters() const + IndexParams getParameters() const CV_OVERRIDE { return index_params_; } @@ -239,7 +239,7 @@ public: * vec = the vector for which to search the nearest neighbors * maxCheck = the maximum number of restarts (in a best-bin-first manner) */ - void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) + void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE { float epsError = 1+get_param(searchParams,"eps",0.0f); diff --git a/modules/flann/include/opencv2/flann/kmeans_index.h b/modules/flann/include/opencv2/flann/kmeans_index.h index 7da4e26240..2f48e40785 100644 --- a/modules/flann/include/opencv2/flann/kmeans_index.h +++ b/modules/flann/include/opencv2/flann/kmeans_index.h @@ -266,7 +266,7 @@ public: public: - flann_algorithm_t getType() const + flann_algorithm_t getType() const CV_OVERRIDE { return FLANN_INDEX_KMEANS; } @@ -291,7 +291,7 @@ public: { } - 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; @@ -398,7 +398,7 @@ public: /** * Returns size of index. */ - size_t size() const + size_t size() const CV_OVERRIDE { return size_; } @@ -406,7 +406,7 @@ public: /** * Returns the length of an index feature. */ - size_t veclen() const + size_t veclen() const CV_OVERRIDE { return veclen_; } @@ -421,7 +421,7 @@ public: * Computes the inde memory usage * Returns: memory used by the index */ - int usedMemory() const + int usedMemory() const CV_OVERRIDE { return pool_.usedMemory+pool_.wastedMemory+memoryCounter_; } @@ -429,7 +429,7 @@ public: /** * Builds the index */ - void buildIndex() + void buildIndex() CV_OVERRIDE { if (branching_<2) { throw FLANNException("Branching factor must be at least 2"); @@ -448,7 +448,7 @@ public: } - void saveIndex(FILE* stream) + void saveIndex(FILE* stream) CV_OVERRIDE { save_value(stream, branching_); save_value(stream, iterations_); @@ -460,7 +460,7 @@ public: } - void loadIndex(FILE* stream) + void loadIndex(FILE* stream) CV_OVERRIDE { load_value(stream, branching_); load_value(stream, iterations_); @@ -495,7 +495,7 @@ public: * vec = the vector for which to search the nearest neighbors * searchParams = parameters that influence the search algorithm (checks, cb_index) */ - void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) + void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE { int maxChecks = get_param(searchParams,"checks",32); @@ -554,7 +554,7 @@ public: return clusterCount; } - IndexParams getParameters() const + IndexParams getParameters() const CV_OVERRIDE { return index_params_; } diff --git a/modules/flann/include/opencv2/flann/linear_index.h b/modules/flann/include/opencv2/flann/linear_index.h index 5aa7a5cfac..ca3f44d0cb 100644 --- a/modules/flann/include/opencv2/flann/linear_index.h +++ b/modules/flann/include/opencv2/flann/linear_index.h @@ -63,47 +63,47 @@ public: LinearIndex(const LinearIndex&); LinearIndex& operator=(const LinearIndex&); - flann_algorithm_t getType() const + flann_algorithm_t getType() const CV_OVERRIDE { return FLANN_INDEX_LINEAR; } - size_t size() const + size_t size() const CV_OVERRIDE { return dataset_.rows; } - size_t veclen() const + size_t veclen() const CV_OVERRIDE { return dataset_.cols; } - int usedMemory() const + int usedMemory() const CV_OVERRIDE { return 0; } - void buildIndex() + void buildIndex() CV_OVERRIDE { /* nothing to do here for linear search */ } - void saveIndex(FILE*) + void saveIndex(FILE*) CV_OVERRIDE { /* nothing to do here for linear search */ } - void loadIndex(FILE*) + void loadIndex(FILE*) CV_OVERRIDE { /* nothing to do here for linear search */ index_params_["algorithm"] = getType(); } - void findNeighbors(ResultSet& resultSet, const ElementType* vec, const SearchParams& /*searchParams*/) + void findNeighbors(ResultSet& resultSet, const ElementType* vec, const SearchParams& /*searchParams*/) CV_OVERRIDE { ElementType* data = dataset_.data; for (size_t i = 0; i < dataset_.rows; ++i, data += dataset_.cols) { @@ -112,7 +112,7 @@ public: } } - IndexParams getParameters() const + IndexParams getParameters() const CV_OVERRIDE { return index_params_; } diff --git a/modules/flann/include/opencv2/flann/lsh_index.h b/modules/flann/include/opencv2/flann/lsh_index.h index 4d4670ea50..42afe892ac 100644 --- a/modules/flann/include/opencv2/flann/lsh_index.h +++ b/modules/flann/include/opencv2/flann/lsh_index.h @@ -107,7 +107,7 @@ public: /** * Builds the index */ - void buildIndex() + void buildIndex() CV_OVERRIDE { tables_.resize(table_number_); for (unsigned int i = 0; i < table_number_; ++i) { @@ -119,13 +119,13 @@ public: } } - flann_algorithm_t getType() const + flann_algorithm_t getType() const CV_OVERRIDE { return FLANN_INDEX_LSH; } - void saveIndex(FILE* stream) + void saveIndex(FILE* stream) CV_OVERRIDE { save_value(stream,table_number_); save_value(stream,key_size_); @@ -133,7 +133,7 @@ public: save_value(stream, dataset_); } - void loadIndex(FILE* stream) + void loadIndex(FILE* stream) CV_OVERRIDE { load_value(stream, table_number_); load_value(stream, key_size_); @@ -151,7 +151,7 @@ public: /** * Returns size of index. */ - size_t size() const + size_t size() const CV_OVERRIDE { return dataset_.rows; } @@ -159,7 +159,7 @@ public: /** * Returns the length of an index feature. */ - size_t veclen() const + size_t veclen() const CV_OVERRIDE { return feature_size_; } @@ -168,13 +168,13 @@ public: * Computes the index memory usage * Returns: memory used by the index */ - int usedMemory() const + int usedMemory() const CV_OVERRIDE { return (int)(dataset_.rows * sizeof(int)); } - IndexParams getParameters() const + IndexParams getParameters() const CV_OVERRIDE { return index_params_; } @@ -187,7 +187,7 @@ public: * \param[in] knn Number of nearest neighbors to return * \param[in] params Search parameters */ - virtual void knnSearch(const Matrix& queries, Matrix& indices, Matrix& dists, int knn, const SearchParams& params) + virtual void knnSearch(const Matrix& queries, Matrix& indices, Matrix& dists, int knn, const SearchParams& params) CV_OVERRIDE { assert(queries.cols == veclen()); assert(indices.rows >= queries.rows); @@ -217,7 +217,7 @@ public: * vec = the vector for which to search the nearest neighbors * maxCheck = the maximum number of restarts (in a best-bin-first manner) */ - void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& /*searchParams*/) + void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& /*searchParams*/) CV_OVERRIDE { getNeighbors(vec, result); } diff --git a/modules/flann/include/opencv2/flann/result_set.h b/modules/flann/include/opencv2/flann/result_set.h index 7c09093978..5c69ac29e7 100644 --- a/modules/flann/include/opencv2/flann/result_set.h +++ b/modules/flann/include/opencv2/flann/result_set.h @@ -109,13 +109,13 @@ public: return count; } - bool full() const + bool full() const CV_OVERRIDE { return count == capacity; } - void addPoint(DistanceType dist, int index) + void addPoint(DistanceType dist, int index) CV_OVERRIDE { if (dist >= worst_distance_) return; int i; @@ -139,7 +139,7 @@ public: worst_distance_ = dists[capacity-1]; } - DistanceType worstDist() const + DistanceType worstDist() const CV_OVERRIDE { return worst_distance_; } @@ -176,13 +176,13 @@ public: return count; } - bool full() const + bool full() const CV_OVERRIDE { return count == capacity; } - void addPoint(DistanceType dist, int index) + void addPoint(DistanceType dist, int index) CV_OVERRIDE { if (dist >= worst_distance_) return; int i; @@ -215,7 +215,7 @@ public: worst_distance_ = dists[capacity-1]; } - DistanceType worstDist() const + DistanceType worstDist() const CV_OVERRIDE { return worst_distance_; } @@ -310,7 +310,7 @@ public: /** Check the status of the set * @return true if we have k NN */ - inline bool full() const + inline bool full() const CV_OVERRIDE { return is_full_; } @@ -365,7 +365,7 @@ public: * If we don't have enough neighbors, it returns the max possible value * @return */ - inline DistanceType worstDist() const + inline DistanceType worstDist() const CV_OVERRIDE { return worst_distance_; } @@ -402,7 +402,7 @@ public: * @param dist distance for that neighbor * @param index index of that neighbor */ - inline void addPoint(DistanceType dist, int index) + inline void addPoint(DistanceType dist, int index) CV_OVERRIDE { // Don't do anything if we are worse than the worst if (dist >= worst_distance_) return; @@ -422,7 +422,7 @@ public: /** Remove all elements in the set */ - void clear() + void clear() CV_OVERRIDE { dist_indices_.clear(); worst_distance_ = std::numeric_limits::max(); @@ -461,14 +461,14 @@ public: * @param dist distance for that neighbor * @param index index of that neighbor */ - void addPoint(DistanceType dist, int index) + void addPoint(DistanceType dist, int index) CV_OVERRIDE { if (dist <= radius_) dist_indices_.insert(DistIndex(dist, index)); } /** Remove all elements in the set */ - inline void clear() + inline void clear() CV_OVERRIDE { dist_indices_.clear(); } @@ -477,7 +477,7 @@ public: /** Check the status of the set * @return alwys false */ - inline bool full() const + inline bool full() const CV_OVERRIDE { return true; } @@ -486,7 +486,7 @@ public: * If we don't have enough neighbors, it returns the max possible value * @return */ - inline DistanceType worstDist() const + inline DistanceType worstDist() const CV_OVERRIDE { return radius_; } diff --git a/modules/imgcodecs/src/grfmt_bmp.hpp b/modules/imgcodecs/src/grfmt_bmp.hpp index b4443b7dcc..ccbaa9140d 100644 --- a/modules/imgcodecs/src/grfmt_bmp.hpp +++ b/modules/imgcodecs/src/grfmt_bmp.hpp @@ -58,18 +58,18 @@ enum BmpCompression // Windows Bitmap reader -class BmpDecoder : public BaseImageDecoder +class BmpDecoder CV_FINAL : public BaseImageDecoder { public: BmpDecoder(); - ~BmpDecoder(); + ~BmpDecoder() CV_OVERRIDE; - bool readData( Mat& img ); - bool readHeader(); + bool readData( Mat& img ) CV_OVERRIDE; + bool readHeader() CV_OVERRIDE; void close(); - ImageDecoder newDecoder() const; + ImageDecoder newDecoder() const CV_OVERRIDE; protected: @@ -83,15 +83,15 @@ protected: // ... writer -class BmpEncoder : public BaseImageEncoder +class BmpEncoder CV_FINAL : public BaseImageEncoder { public: BmpEncoder(); - ~BmpEncoder(); + ~BmpEncoder() CV_OVERRIDE; - bool write( const Mat& img, const std::vector& params ); + bool write( const Mat& img, const std::vector& params ) CV_OVERRIDE; - ImageEncoder newEncoder() const; + ImageEncoder newEncoder() const CV_OVERRIDE; }; } diff --git a/modules/imgcodecs/src/grfmt_exr.hpp b/modules/imgcodecs/src/grfmt_exr.hpp index 331d099f71..ec08028e22 100644 --- a/modules/imgcodecs/src/grfmt_exr.hpp +++ b/modules/imgcodecs/src/grfmt_exr.hpp @@ -63,19 +63,19 @@ using namespace Imath; /* libpng version only */ -class ExrDecoder : public BaseImageDecoder +class ExrDecoder CV_FINAL : public BaseImageDecoder { public: ExrDecoder(); - ~ExrDecoder(); + ~ExrDecoder() CV_OVERRIDE; - int type() const; - bool readData( Mat& img ); - bool readHeader(); + int type() const CV_OVERRIDE; + bool readData( Mat& img ) CV_OVERRIDE; + bool readHeader() CV_OVERRIDE; void close(); - ImageDecoder newDecoder() const; + ImageDecoder newDecoder() const CV_OVERRIDE; protected: void UpSample( uchar *data, int xstep, int ystep, int xsample, int ysample ); @@ -103,15 +103,15 @@ private: }; -class ExrEncoder : public BaseImageEncoder +class ExrEncoder CV_FINAL : public BaseImageEncoder { public: ExrEncoder(); - ~ExrEncoder(); + ~ExrEncoder() CV_OVERRIDE; - bool isFormatSupported( int depth ) const; - bool write( const Mat& img, const std::vector& params ); - ImageEncoder newEncoder() const; + bool isFormatSupported( int depth ) const CV_OVERRIDE; + bool write( const Mat& img, const std::vector& params ) CV_OVERRIDE; + ImageEncoder newEncoder() const CV_OVERRIDE; }; } diff --git a/modules/imgcodecs/src/grfmt_gdal.hpp b/modules/imgcodecs/src/grfmt_gdal.hpp index 0273960490..47b360f855 100644 --- a/modules/imgcodecs/src/grfmt_gdal.hpp +++ b/modules/imgcodecs/src/grfmt_gdal.hpp @@ -103,7 +103,7 @@ void write_ctable_pixel( const double& pixelValue, /** * Loader for GDAL */ -class GdalDecoder : public BaseImageDecoder{ +class GdalDecoder CV_FINAL : public BaseImageDecoder{ public: @@ -115,17 +115,17 @@ class GdalDecoder : public BaseImageDecoder{ /** * Destructor */ - ~GdalDecoder(); + ~GdalDecoder() CV_OVERRIDE; /** * Read image data */ - bool readData( Mat& img ); + bool readData( Mat& img ) CV_OVERRIDE; /** * Read the image header */ - bool readHeader(); + bool readHeader() CV_OVERRIDE; /** * Close the module @@ -135,7 +135,7 @@ class GdalDecoder : public BaseImageDecoder{ /** * Create a new decoder */ - ImageDecoder newDecoder() const; + ImageDecoder newDecoder() const CV_OVERRIDE; /** * Test the file signature @@ -144,7 +144,7 @@ class GdalDecoder : public BaseImageDecoder{ * The reason is that GDAL tends to overlap with other image formats and it is probably * safer to use other formats first. */ - virtual bool checkSignature( const String& signature ) const; + virtual bool checkSignature( const String& signature ) const CV_OVERRIDE; protected: diff --git a/modules/imgcodecs/src/grfmt_gdcm.hpp b/modules/imgcodecs/src/grfmt_gdcm.hpp index d8dc60f522..7cb7e13305 100644 --- a/modules/imgcodecs/src/grfmt_gdcm.hpp +++ b/modules/imgcodecs/src/grfmt_gdcm.hpp @@ -53,14 +53,14 @@ namespace cv { // DICOM image reader using GDCM -class DICOMDecoder : public BaseImageDecoder +class DICOMDecoder CV_FINAL : public BaseImageDecoder { public: DICOMDecoder(); - bool readData( Mat& img ); - bool readHeader(); - ImageDecoder newDecoder() const; - virtual bool checkSignature( const String& signature ) const; + bool readData( Mat& img ) CV_OVERRIDE; + bool readHeader() CV_OVERRIDE; + ImageDecoder newDecoder() const CV_OVERRIDE; + virtual bool checkSignature( const String& signature ) const CV_OVERRIDE; }; } diff --git a/modules/imgcodecs/src/grfmt_hdr.hpp b/modules/imgcodecs/src/grfmt_hdr.hpp index 3ed8015e00..04947eae58 100644 --- a/modules/imgcodecs/src/grfmt_hdr.hpp +++ b/modules/imgcodecs/src/grfmt_hdr.hpp @@ -55,34 +55,34 @@ enum HdrCompression }; // Radiance rgbe (.hdr) reader -class HdrDecoder : public BaseImageDecoder +class HdrDecoder CV_FINAL : public BaseImageDecoder { public: HdrDecoder(); - ~HdrDecoder(); - bool readHeader(); - bool readData( Mat& img ); - bool checkSignature( const String& signature ) const; - ImageDecoder newDecoder() const; - size_t signatureLength() const; + ~HdrDecoder() CV_OVERRIDE; + bool readHeader() CV_OVERRIDE; + bool readData( Mat& img ) CV_OVERRIDE; + bool checkSignature( const String& signature ) const CV_OVERRIDE; + ImageDecoder newDecoder() const CV_OVERRIDE; + size_t signatureLength() const CV_OVERRIDE; protected: String m_signature_alt; FILE *file; }; // ... writer -class HdrEncoder : public BaseImageEncoder +class HdrEncoder CV_FINAL : public BaseImageEncoder { public: HdrEncoder(); - ~HdrEncoder(); - bool write( const Mat& img, const std::vector& params ); - ImageEncoder newEncoder() const; - bool isFormatSupported( int depth ) const; + ~HdrEncoder() CV_OVERRIDE; + bool write( const Mat& img, const std::vector& params ) CV_OVERRIDE; + ImageEncoder newEncoder() const CV_OVERRIDE; + bool isFormatSupported( int depth ) const CV_OVERRIDE; protected: }; } -#endif/*_GRFMT_HDR_H_*/ \ No newline at end of file +#endif/*_GRFMT_HDR_H_*/ diff --git a/modules/imgcodecs/src/grfmt_jpeg.hpp b/modules/imgcodecs/src/grfmt_jpeg.hpp index 628dd166e2..90d80b4b59 100644 --- a/modules/imgcodecs/src/grfmt_jpeg.hpp +++ b/modules/imgcodecs/src/grfmt_jpeg.hpp @@ -53,18 +53,18 @@ namespace cv { -class JpegDecoder : public BaseImageDecoder +class JpegDecoder CV_FINAL : public BaseImageDecoder { public: JpegDecoder(); virtual ~JpegDecoder(); - bool readData( Mat& img ); - bool readHeader(); + bool readData( Mat& img ) CV_OVERRIDE; + bool readHeader() CV_OVERRIDE; void close(); - ImageDecoder newDecoder() const; + ImageDecoder newDecoder() const CV_OVERRIDE; protected: @@ -77,14 +77,14 @@ private: }; -class JpegEncoder : public BaseImageEncoder +class JpegEncoder CV_FINAL : public BaseImageEncoder { public: JpegEncoder(); virtual ~JpegEncoder(); - bool write( const Mat& img, const std::vector& params ); - ImageEncoder newEncoder() const; + bool write( const Mat& img, const std::vector& params ) CV_OVERRIDE; + ImageEncoder newEncoder() const CV_OVERRIDE; }; } diff --git a/modules/imgcodecs/src/grfmt_jpeg2000.hpp b/modules/imgcodecs/src/grfmt_jpeg2000.hpp index 0c0954f8b3..586f16f0fa 100644 --- a/modules/imgcodecs/src/grfmt_jpeg2000.hpp +++ b/modules/imgcodecs/src/grfmt_jpeg2000.hpp @@ -50,17 +50,17 @@ namespace cv { -class Jpeg2KDecoder : public BaseImageDecoder +class Jpeg2KDecoder CV_FINAL : public BaseImageDecoder { public: Jpeg2KDecoder(); virtual ~Jpeg2KDecoder(); - bool readData( Mat& img ); - bool readHeader(); + bool readData( Mat& img ) CV_OVERRIDE; + bool readHeader() CV_OVERRIDE; void close(); - ImageDecoder newDecoder() const; + ImageDecoder newDecoder() const CV_OVERRIDE; protected: bool readComponent8u( uchar *data, void *buffer, int step, int cmpt, @@ -73,15 +73,15 @@ protected: }; -class Jpeg2KEncoder : public BaseImageEncoder +class Jpeg2KEncoder CV_FINAL : public BaseImageEncoder { public: Jpeg2KEncoder(); virtual ~Jpeg2KEncoder(); - bool isFormatSupported( int depth ) const; - bool write( const Mat& img, const std::vector& params ); - ImageEncoder newEncoder() const; + bool isFormatSupported( int depth ) const CV_OVERRIDE; + bool write( const Mat& img, const std::vector& params ) CV_OVERRIDE; + ImageEncoder newEncoder() const CV_OVERRIDE; protected: bool writeComponent8u( void *img, const Mat& _img ); diff --git a/modules/imgcodecs/src/grfmt_pam.hpp b/modules/imgcodecs/src/grfmt_pam.hpp index 8b3b1f10c9..3b740e3692 100644 --- a/modules/imgcodecs/src/grfmt_pam.hpp +++ b/modules/imgcodecs/src/grfmt_pam.hpp @@ -59,19 +59,19 @@ namespace cv { -class PAMDecoder : public BaseImageDecoder +class PAMDecoder CV_FINAL : public BaseImageDecoder { public: PAMDecoder(); - virtual ~PAMDecoder(); + virtual ~PAMDecoder() CV_OVERRIDE; - bool readData( Mat& img ); - bool readHeader(); + bool readData( Mat& img ) CV_OVERRIDE; + bool readHeader() CV_OVERRIDE; - size_t signatureLength() const; - bool checkSignature( const String& signature ) const; - ImageDecoder newDecoder() const; + size_t signatureLength() const CV_OVERRIDE; + bool checkSignature( const String& signature ) const CV_OVERRIDE; + ImageDecoder newDecoder() const CV_OVERRIDE; protected: @@ -82,18 +82,18 @@ protected: }; -class PAMEncoder : public BaseImageEncoder +class PAMEncoder CV_FINAL : public BaseImageEncoder { public: PAMEncoder(); - virtual ~PAMEncoder(); + virtual ~PAMEncoder() CV_OVERRIDE; - bool isFormatSupported( int depth ) const; - bool write( const Mat& img, const std::vector& params ); + bool isFormatSupported( int depth ) const CV_OVERRIDE; + bool write( const Mat& img, const std::vector& params ) CV_OVERRIDE; - ImageEncoder newEncoder() const; + ImageEncoder newEncoder() const CV_OVERRIDE; }; } -#endif /* _OPENCV_PAM_HPP_ */ \ No newline at end of file +#endif /* _OPENCV_PAM_HPP_ */ diff --git a/modules/imgcodecs/src/grfmt_png.hpp b/modules/imgcodecs/src/grfmt_png.hpp index 3a3d004ffd..3d8d1a764a 100644 --- a/modules/imgcodecs/src/grfmt_png.hpp +++ b/modules/imgcodecs/src/grfmt_png.hpp @@ -51,18 +51,18 @@ namespace cv { -class PngDecoder : public BaseImageDecoder +class PngDecoder CV_FINAL : public BaseImageDecoder { public: PngDecoder(); virtual ~PngDecoder(); - bool readData( Mat& img ); - bool readHeader(); + bool readData( Mat& img ) CV_OVERRIDE; + bool readHeader() CV_OVERRIDE; void close(); - ImageDecoder newDecoder() const; + ImageDecoder newDecoder() const CV_OVERRIDE; protected: @@ -78,16 +78,16 @@ protected: }; -class PngEncoder : public BaseImageEncoder +class PngEncoder CV_FINAL : public BaseImageEncoder { public: PngEncoder(); virtual ~PngEncoder(); - bool isFormatSupported( int depth ) const; - bool write( const Mat& img, const std::vector& params ); + bool isFormatSupported( int depth ) const CV_OVERRIDE; + bool write( const Mat& img, const std::vector& params ) CV_OVERRIDE; - ImageEncoder newEncoder() const; + ImageEncoder newEncoder() const CV_OVERRIDE; protected: static void writeDataToBuf(void* png_ptr, uchar* src, size_t size); diff --git a/modules/imgcodecs/src/grfmt_pxm.hpp b/modules/imgcodecs/src/grfmt_pxm.hpp index 3c7100b7d8..b4d5ad08fa 100644 --- a/modules/imgcodecs/src/grfmt_pxm.hpp +++ b/modules/imgcodecs/src/grfmt_pxm.hpp @@ -57,20 +57,20 @@ enum PxMMode PXM_TYPE_PPM = 3 // color format }; -class PxMDecoder : public BaseImageDecoder +class PxMDecoder CV_FINAL : public BaseImageDecoder { public: PxMDecoder(); - virtual ~PxMDecoder(); + virtual ~PxMDecoder() CV_OVERRIDE; - bool readData( Mat& img ); - bool readHeader(); + bool readData( Mat& img ) CV_OVERRIDE; + bool readHeader() CV_OVERRIDE; void close(); - size_t signatureLength() const; - bool checkSignature( const String& signature ) const; - ImageDecoder newDecoder() const; + size_t signatureLength() const CV_OVERRIDE; + bool checkSignature( const String& signature ) const CV_OVERRIDE; + ImageDecoder newDecoder() const CV_OVERRIDE; protected: @@ -82,16 +82,16 @@ protected: int m_maxval; }; -class PxMEncoder : public BaseImageEncoder +class PxMEncoder CV_FINAL : public BaseImageEncoder { public: PxMEncoder(PxMMode mode); - virtual ~PxMEncoder(); + virtual ~PxMEncoder() CV_OVERRIDE; - bool isFormatSupported( int depth ) const; - bool write( const Mat& img, const std::vector& params ); + bool isFormatSupported( int depth ) const CV_OVERRIDE; + bool write( const Mat& img, const std::vector& params ) CV_OVERRIDE; - ImageEncoder newEncoder() const + ImageEncoder newEncoder() const CV_OVERRIDE { return makePtr(mode_); } diff --git a/modules/imgcodecs/src/grfmt_sunras.hpp b/modules/imgcodecs/src/grfmt_sunras.hpp index ef09f9b1f9..ecd5c743fc 100644 --- a/modules/imgcodecs/src/grfmt_sunras.hpp +++ b/modules/imgcodecs/src/grfmt_sunras.hpp @@ -64,18 +64,18 @@ enum SunRasMapType // Sun Raster Reader -class SunRasterDecoder : public BaseImageDecoder +class SunRasterDecoder CV_FINAL : public BaseImageDecoder { public: SunRasterDecoder(); - virtual ~SunRasterDecoder(); + virtual ~SunRasterDecoder() CV_OVERRIDE; - bool readData( Mat& img ); - bool readHeader(); + bool readData( Mat& img ) CV_OVERRIDE; + bool readHeader() CV_OVERRIDE; void close(); - ImageDecoder newDecoder() const; + ImageDecoder newDecoder() const CV_OVERRIDE; protected: @@ -89,15 +89,15 @@ protected: }; -class SunRasterEncoder : public BaseImageEncoder +class SunRasterEncoder CV_FINAL : public BaseImageEncoder { public: SunRasterEncoder(); - virtual ~SunRasterEncoder(); + virtual ~SunRasterEncoder() CV_OVERRIDE; - bool write( const Mat& img, const std::vector& params ); + bool write( const Mat& img, const std::vector& params ) CV_OVERRIDE; - ImageEncoder newEncoder() const; + ImageEncoder newEncoder() const CV_OVERRIDE; }; } diff --git a/modules/imgcodecs/src/grfmt_tiff.hpp b/modules/imgcodecs/src/grfmt_tiff.hpp index eb0756f4d6..cd1b55ed02 100644 --- a/modules/imgcodecs/src/grfmt_tiff.hpp +++ b/modules/imgcodecs/src/grfmt_tiff.hpp @@ -90,20 +90,20 @@ enum TiffFieldType // libtiff based TIFF codec -class TiffDecoder : public BaseImageDecoder +class TiffDecoder CV_FINAL : public BaseImageDecoder { public: TiffDecoder(); - virtual ~TiffDecoder(); + virtual ~TiffDecoder() CV_OVERRIDE; - bool readHeader(); - bool readData( Mat& img ); + bool readHeader() CV_OVERRIDE; + bool readData( Mat& img ) CV_OVERRIDE; void close(); - bool nextPage(); + bool nextPage() CV_OVERRIDE; - size_t signatureLength() const; - bool checkSignature( const String& signature ) const; - ImageDecoder newDecoder() const; + size_t signatureLength() const CV_OVERRIDE; + bool checkSignature( const String& signature ) const CV_OVERRIDE; + ImageDecoder newDecoder() const CV_OVERRIDE; protected: void* m_tif; @@ -119,19 +119,19 @@ private: }; // ... and writer -class TiffEncoder : public BaseImageEncoder +class TiffEncoder CV_FINAL : public BaseImageEncoder { public: TiffEncoder(); - virtual ~TiffEncoder(); + virtual ~TiffEncoder() CV_OVERRIDE; - bool isFormatSupported( int depth ) const; + bool isFormatSupported( int depth ) const CV_OVERRIDE; - bool write( const Mat& img, const std::vector& params ); + bool write( const Mat& img, const std::vector& params ) CV_OVERRIDE; - bool writemulti(const std::vector& img_vec, const std::vector& params); + bool writemulti(const std::vector& img_vec, const std::vector& params) CV_OVERRIDE; - ImageEncoder newEncoder() const; + ImageEncoder newEncoder() const CV_OVERRIDE; protected: void writeTag( WLByteStream& strm, TiffTag tag, diff --git a/modules/imgcodecs/src/grfmt_webp.hpp b/modules/imgcodecs/src/grfmt_webp.hpp index ea692bf8d2..79e041b212 100644 --- a/modules/imgcodecs/src/grfmt_webp.hpp +++ b/modules/imgcodecs/src/grfmt_webp.hpp @@ -52,36 +52,36 @@ namespace cv { -class WebPDecoder : public BaseImageDecoder +class WebPDecoder CV_FINAL : public BaseImageDecoder { public: WebPDecoder(); - ~WebPDecoder(); + ~WebPDecoder() CV_OVERRIDE; - bool readData( Mat& img ); - bool readHeader(); + bool readData( Mat& img ) CV_OVERRIDE; + bool readHeader() CV_OVERRIDE; void close(); - size_t signatureLength() const; - bool checkSignature( const String& signature) const; + size_t signatureLength() const CV_OVERRIDE; + bool checkSignature( const String& signature) const CV_OVERRIDE; - ImageDecoder newDecoder() const; + ImageDecoder newDecoder() const CV_OVERRIDE; protected: Mat data; int channels; }; -class WebPEncoder : public BaseImageEncoder +class WebPEncoder CV_FINAL : public BaseImageEncoder { public: WebPEncoder(); - ~WebPEncoder(); + ~WebPEncoder() CV_OVERRIDE; - bool write(const Mat& img, const std::vector& params); + bool write(const Mat& img, const std::vector& params) CV_OVERRIDE; - ImageEncoder newEncoder() const; + ImageEncoder newEncoder() const CV_OVERRIDE; }; } diff --git a/modules/imgcodecs/src/loadsave.cpp b/modules/imgcodecs/src/loadsave.cpp index 814d307748..c2042b8ae9 100644 --- a/modules/imgcodecs/src/loadsave.cpp +++ b/modules/imgcodecs/src/loadsave.cpp @@ -89,7 +89,7 @@ public: protected: virtual pos_type seekoff( off_type offset, std::ios_base::seekdir dir, - std::ios_base::openmode ) + std::ios_base::openmode ) CV_OVERRIDE { char* whence = eback(); if (dir == std::ios_base::cur) diff --git a/modules/imgproc/src/blend.cpp b/modules/imgproc/src/blend.cpp index 16ed8c25c7..b334e14130 100644 --- a/modules/imgproc/src/blend.cpp +++ b/modules/imgproc/src/blend.cpp @@ -308,7 +308,7 @@ public: { } - virtual void operator() (const Range & range) const + virtual void operator() (const Range & range) const CV_OVERRIDE { int cn = src1->channels(), width = src1->cols * cn; diff --git a/modules/imgproc/src/canny.cpp b/modules/imgproc/src/canny.cpp index 6d7990b4b2..1d413726b8 100644 --- a/modules/imgproc/src/canny.cpp +++ b/modules/imgproc/src/canny.cpp @@ -356,7 +356,7 @@ public: parallelCanny& operator=(const parallelCanny&) { return *this; } - void operator()(const Range &boundaries) const + void operator()(const Range &boundaries) const CV_OVERRIDE { CV_TRACE_FUNCTION(); @@ -825,7 +825,7 @@ public: ~finalPass() {} - void operator()(const Range &boundaries) const + void operator()(const Range &boundaries) const CV_OVERRIDE { // the final pass, form the final image for (int i = boundaries.start; i < boundaries.end; i++) diff --git a/modules/imgproc/src/clahe.cpp b/modules/imgproc/src/clahe.cpp index 336f73b7b1..7a96da62aa 100644 --- a/modules/imgproc/src/clahe.cpp +++ b/modules/imgproc/src/clahe.cpp @@ -136,7 +136,7 @@ namespace { } - void operator ()(const cv::Range& range) const; + void operator ()(const cv::Range& range) const CV_OVERRIDE; private: cv::Mat src_; @@ -265,7 +265,7 @@ namespace } } - void operator ()(const cv::Range& range) const; + void operator ()(const cv::Range& range) const CV_OVERRIDE; private: cv::Mat src_; @@ -319,20 +319,20 @@ namespace } } - class CLAHE_Impl : public cv::CLAHE + class CLAHE_Impl CV_FINAL : public cv::CLAHE { public: CLAHE_Impl(double clipLimit = 40.0, int tilesX = 8, int tilesY = 8); - void apply(cv::InputArray src, cv::OutputArray dst); + void apply(cv::InputArray src, cv::OutputArray dst) CV_OVERRIDE; - void setClipLimit(double clipLimit); - double getClipLimit() const; + void setClipLimit(double clipLimit) CV_OVERRIDE; + double getClipLimit() const CV_OVERRIDE; - void setTilesGridSize(cv::Size tileGridSize); - cv::Size getTilesGridSize() const; + void setTilesGridSize(cv::Size tileGridSize) CV_OVERRIDE; + cv::Size getTilesGridSize() const CV_OVERRIDE; - void collectGarbage(); + void collectGarbage() CV_OVERRIDE; private: double clipLimit_; diff --git a/modules/imgproc/src/color.hpp b/modules/imgproc/src/color.hpp index da62329f98..c2db3b39df 100644 --- a/modules/imgproc/src/color.hpp +++ b/modules/imgproc/src/color.hpp @@ -389,7 +389,7 @@ public: { } - virtual void operator()(const Range& range) const + virtual void operator()(const Range& range) const CV_OVERRIDE { CV_TRACE_FUNCTION(); @@ -447,7 +447,7 @@ public: *ok = true; } - virtual void operator()(const Range& range) const + virtual void operator()(const Range& range) const CV_OVERRIDE { const void *yS = src_data + src_step * range.start; void *yD = dst_data + dst_step * range.start; diff --git a/modules/imgproc/src/color_yuv.cpp b/modules/imgproc/src/color_yuv.cpp index 50e41e0c23..aeaf779ae5 100644 --- a/modules/imgproc/src/color_yuv.cpp +++ b/modules/imgproc/src/color_yuv.cpp @@ -1706,7 +1706,7 @@ struct YUV420sp2RGB888Invoker : ParallelLoopBody YUV420sp2RGB888Invoker(uchar * _dst_data, size_t _dst_step, int _dst_width, size_t _stride, const uchar* _y1, const uchar* _uv) : dst_data(_dst_data), dst_step(_dst_step), width(_dst_width), my1(_y1), muv(_uv), stride(_stride) {} - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { int rangeBegin = range.start * 2; int rangeEnd = range.end * 2; @@ -1772,7 +1772,7 @@ struct YUV420sp2RGBA8888Invoker : ParallelLoopBody YUV420sp2RGBA8888Invoker(uchar * _dst_data, size_t _dst_step, int _dst_width, size_t _stride, const uchar* _y1, const uchar* _uv) : dst_data(_dst_data), dst_step(_dst_step), width(_dst_width), my1(_y1), muv(_uv), stride(_stride) {} - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { int rangeBegin = range.start * 2; int rangeEnd = range.end * 2; @@ -1843,7 +1843,7 @@ struct YUV420p2RGB888Invoker : ParallelLoopBody YUV420p2RGB888Invoker(uchar * _dst_data, size_t _dst_step, int _dst_width, size_t _stride, const uchar* _y1, const uchar* _u, const uchar* _v, int _ustepIdx, int _vstepIdx) : dst_data(_dst_data), dst_step(_dst_step), width(_dst_width), my1(_y1), mu(_u), mv(_v), stride(_stride), ustepIdx(_ustepIdx), vstepIdx(_vstepIdx) {} - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { const int rangeBegin = range.start * 2; const int rangeEnd = range.end * 2; @@ -1913,7 +1913,7 @@ struct YUV420p2RGBA8888Invoker : ParallelLoopBody YUV420p2RGBA8888Invoker(uchar * _dst_data, size_t _dst_step, int _dst_width, size_t _stride, const uchar* _y1, const uchar* _u, const uchar* _v, int _ustepIdx, int _vstepIdx) : dst_data(_dst_data), dst_step(_dst_step), width(_dst_width), my1(_y1), mu(_u), mv(_v), stride(_stride), ustepIdx(_ustepIdx), vstepIdx(_vstepIdx) {} - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { int rangeBegin = range.start * 2; int rangeEnd = range.end * 2; @@ -2028,7 +2028,7 @@ struct RGB888toYUV420pInvoker: public ParallelLoopBody src_width(_src_width), src_height(_src_height), scn(_scn), swapBlue(swapBlue_), swapUV(swapUV_), interleaved(interleaved_) { } - void operator()(const Range& rowRange) const + void operator()(const Range& rowRange) const CV_OVERRIDE { const int w = src_width; const int h = src_height; @@ -2143,7 +2143,7 @@ struct YUV422toRGB888Invoker : ParallelLoopBody int _width) : dst_data(_dst_data), dst_step(_dst_step), src_data(_src_data), src_step(_src_step), width(_width) {} - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { int rangeBegin = range.start; int rangeEnd = range.end; @@ -2193,7 +2193,7 @@ struct YUV422toRGBA8888Invoker : ParallelLoopBody int _width) : dst_data(_dst_data), dst_step(_dst_step), src_data(_src_data), src_step(_src_step), width(_width) {} - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { int rangeBegin = range.start; int rangeEnd = range.end; diff --git a/modules/imgproc/src/colormap.cpp b/modules/imgproc/src/colormap.cpp index f8d5d1b36d..3e5068d488 100644 --- a/modules/imgproc/src/colormap.cpp +++ b/modules/imgproc/src/colormap.cpp @@ -19,7 +19,7 @@ #include #ifdef _MSC_VER -#pragma warning( disable: 4305 ) +#pragma warning( disable: 4305 ) // FIXIT remove this #endif namespace cv @@ -150,7 +150,7 @@ namespace colormap void operator()(InputArray src, OutputArray dst) const; // Setup base map to interpolate from. - virtual void init(int n) = 0; + //not used: virtual void init(int n) = 0; // Interpolates from a base colormap. static Mat linear_colormap(InputArray X, @@ -184,14 +184,14 @@ namespace colormap } void init(int n) { - float r[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - float g[] = { 0, 0.01587301587301587f, 0.03174603174603174f, 0.04761904761904762f, 0.06349206349206349f, 0.07936507936507936f, 0.09523809523809523f, 0.1111111111111111f, 0.126984126984127f, 0.1428571428571428f, 0.1587301587301587f, 0.1746031746031746f, 0.1904761904761905f, 0.2063492063492063f, 0.2222222222222222f, 0.2380952380952381f, 0.253968253968254f, 0.2698412698412698f, 0.2857142857142857f, 0.3015873015873016f, 0.3174603174603174f, 0.3333333333333333f, 0.3492063492063492f, 0.3650793650793651f, 0.3809523809523809f, 0.3968253968253968f, 0.4126984126984127f, 0.4285714285714285f, 0.4444444444444444f, 0.4603174603174603f, 0.4761904761904762f, 0.492063492063492f, 0.5079365079365079f, 0.5238095238095238f, 0.5396825396825397f, 0.5555555555555556f, 0.5714285714285714f, 0.5873015873015873f, 0.6031746031746031f, 0.6190476190476191f, 0.6349206349206349f, 0.6507936507936508f, 0.6666666666666666f, 0.6825396825396826f, 0.6984126984126984f, 0.7142857142857143f, 0.7301587301587301f, 0.746031746031746f, 0.7619047619047619f, 0.7777777777777778f, 0.7936507936507936f, 0.8095238095238095f, 0.8253968253968254f, 0.8412698412698413f, 0.8571428571428571f, 0.873015873015873f, 0.8888888888888888f, 0.9047619047619048f, 0.9206349206349206f, 0.9365079365079365f, 0.9523809523809523f, 0.9682539682539683f, 0.9841269841269841f, 1}; - float b[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + static const float r[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + static const float g[] = { 0, 0.01587301587301587f, 0.03174603174603174f, 0.04761904761904762f, 0.06349206349206349f, 0.07936507936507936f, 0.09523809523809523f, 0.1111111111111111f, 0.126984126984127f, 0.1428571428571428f, 0.1587301587301587f, 0.1746031746031746f, 0.1904761904761905f, 0.2063492063492063f, 0.2222222222222222f, 0.2380952380952381f, 0.253968253968254f, 0.2698412698412698f, 0.2857142857142857f, 0.3015873015873016f, 0.3174603174603174f, 0.3333333333333333f, 0.3492063492063492f, 0.3650793650793651f, 0.3809523809523809f, 0.3968253968253968f, 0.4126984126984127f, 0.4285714285714285f, 0.4444444444444444f, 0.4603174603174603f, 0.4761904761904762f, 0.492063492063492f, 0.5079365079365079f, 0.5238095238095238f, 0.5396825396825397f, 0.5555555555555556f, 0.5714285714285714f, 0.5873015873015873f, 0.6031746031746031f, 0.6190476190476191f, 0.6349206349206349f, 0.6507936507936508f, 0.6666666666666666f, 0.6825396825396826f, 0.6984126984126984f, 0.7142857142857143f, 0.7301587301587301f, 0.746031746031746f, 0.7619047619047619f, 0.7777777777777778f, 0.7936507936507936f, 0.8095238095238095f, 0.8253968253968254f, 0.8412698412698413f, 0.8571428571428571f, 0.873015873015873f, 0.8888888888888888f, 0.9047619047619048f, 0.9206349206349206f, 0.9365079365079365f, 0.9523809523809523f, 0.9682539682539683f, 0.9841269841269841f, 1}; + static const float b[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; Mat X = linspace(0,1,64); this->_lut = ColorMap::linear_colormap(X, - Mat(64,1, CV_32FC1, r).clone(), // red - Mat(64,1, CV_32FC1, g).clone(), // green - Mat(64,1, CV_32FC1, b).clone(), // blue + Mat(64,1, CV_32FC1, (void*)r).clone(), // red + Mat(64,1, CV_32FC1, (void*)g).clone(), // green + Mat(64,1, CV_32FC1, (void*)b).clone(), // blue n); // number of sample points } }; @@ -208,14 +208,14 @@ namespace colormap } void init(int n) { - float r[] = { 0, 0.01388888888888889f, 0.02777777777777778f, 0.04166666666666666f, 0.05555555555555555f, 0.06944444444444445f, 0.08333333333333333f, 0.09722222222222221f, 0.1111111111111111f, 0.125f, 0.1388888888888889f, 0.1527777777777778f, 0.1666666666666667f, 0.1805555555555556f, 0.1944444444444444f, 0.2083333333333333f, 0.2222222222222222f, 0.2361111111111111f, 0.25f, 0.2638888888888889f, 0.2777777777777778f, 0.2916666666666666f, 0.3055555555555555f, 0.3194444444444444f, 0.3333333333333333f, 0.3472222222222222f, 0.3611111111111111f, 0.375f, 0.3888888888888888f, 0.4027777777777777f, 0.4166666666666666f, 0.4305555555555555f, 0.4444444444444444f, 0.4583333333333333f, 0.4722222222222222f, 0.4861111111111112f, 0.5f, 0.5138888888888888f, 0.5277777777777778f, 0.5416666666666667f, 0.5555555555555556f, 0.5694444444444444f, 0.5833333333333333f, 0.5972222222222222f, 0.611111111111111f, 0.6249999999999999f, 0.6388888888888888f, 0.6527777777777778f, 0.6726190476190474f, 0.6944444444444442f, 0.7162698412698412f, 0.7380952380952381f, 0.7599206349206349f, 0.7817460317460316f, 0.8035714285714286f, 0.8253968253968254f, 0.8472222222222221f, 0.8690476190476188f, 0.8908730158730158f, 0.9126984126984128f, 0.9345238095238095f, 0.9563492063492063f, 0.978174603174603f, 1}; - float g[] = { 0, 0.01388888888888889f, 0.02777777777777778f, 0.04166666666666666f, 0.05555555555555555f, 0.06944444444444445f, 0.08333333333333333f, 0.09722222222222221f, 0.1111111111111111f, 0.125f, 0.1388888888888889f, 0.1527777777777778f, 0.1666666666666667f, 0.1805555555555556f, 0.1944444444444444f, 0.2083333333333333f, 0.2222222222222222f, 0.2361111111111111f, 0.25f, 0.2638888888888889f, 0.2777777777777778f, 0.2916666666666666f, 0.3055555555555555f, 0.3194444444444444f, 0.3353174603174602f, 0.3544973544973544f, 0.3736772486772486f, 0.3928571428571428f, 0.412037037037037f, 0.4312169312169312f, 0.4503968253968254f, 0.4695767195767195f, 0.4887566137566137f, 0.5079365079365078f, 0.5271164021164021f, 0.5462962962962963f, 0.5654761904761904f, 0.5846560846560845f, 0.6038359788359787f, 0.623015873015873f, 0.6421957671957671f, 0.6613756613756612f, 0.6805555555555555f, 0.6997354497354497f, 0.7189153439153438f, 0.7380952380952379f, 0.7572751322751322f, 0.7764550264550264f, 0.7916666666666666f, 0.8055555555555555f, 0.8194444444444444f, 0.8333333333333334f, 0.8472222222222222f, 0.861111111111111f, 0.875f, 0.8888888888888888f, 0.9027777777777777f, 0.9166666666666665f, 0.9305555555555555f, 0.9444444444444444f, 0.9583333333333333f, 0.9722222222222221f, 0.986111111111111f, 1}; - float b[] = { 0, 0.01917989417989418f, 0.03835978835978836f, 0.05753968253968253f, 0.07671957671957672f, 0.09589947089947089f, 0.1150793650793651f, 0.1342592592592592f, 0.1534391534391534f, 0.1726190476190476f, 0.1917989417989418f, 0.210978835978836f, 0.2301587301587301f, 0.2493386243386243f, 0.2685185185185185f, 0.2876984126984127f, 0.3068783068783069f, 0.326058201058201f, 0.3452380952380952f, 0.3644179894179894f, 0.3835978835978835f, 0.4027777777777777f, 0.4219576719576719f, 0.4411375661375661f, 0.4583333333333333f, 0.4722222222222222f, 0.4861111111111111f, 0.5f, 0.5138888888888888f, 0.5277777777777777f, 0.5416666666666666f, 0.5555555555555556f, 0.5694444444444444f, 0.5833333333333333f, 0.5972222222222222f, 0.6111111111111112f, 0.625f, 0.6388888888888888f, 0.6527777777777778f, 0.6666666666666667f, 0.6805555555555556f, 0.6944444444444444f, 0.7083333333333333f, 0.7222222222222222f, 0.736111111111111f, 0.7499999999999999f, 0.7638888888888888f, 0.7777777777777778f, 0.7916666666666666f, 0.8055555555555555f, 0.8194444444444444f, 0.8333333333333334f, 0.8472222222222222f, 0.861111111111111f, 0.875f, 0.8888888888888888f, 0.9027777777777777f, 0.9166666666666665f, 0.9305555555555555f, 0.9444444444444444f, 0.9583333333333333f, 0.9722222222222221f, 0.986111111111111f, 1}; + static const float r[] = { 0, 0.01388888888888889f, 0.02777777777777778f, 0.04166666666666666f, 0.05555555555555555f, 0.06944444444444445f, 0.08333333333333333f, 0.09722222222222221f, 0.1111111111111111f, 0.125f, 0.1388888888888889f, 0.1527777777777778f, 0.1666666666666667f, 0.1805555555555556f, 0.1944444444444444f, 0.2083333333333333f, 0.2222222222222222f, 0.2361111111111111f, 0.25f, 0.2638888888888889f, 0.2777777777777778f, 0.2916666666666666f, 0.3055555555555555f, 0.3194444444444444f, 0.3333333333333333f, 0.3472222222222222f, 0.3611111111111111f, 0.375f, 0.3888888888888888f, 0.4027777777777777f, 0.4166666666666666f, 0.4305555555555555f, 0.4444444444444444f, 0.4583333333333333f, 0.4722222222222222f, 0.4861111111111112f, 0.5f, 0.5138888888888888f, 0.5277777777777778f, 0.5416666666666667f, 0.5555555555555556f, 0.5694444444444444f, 0.5833333333333333f, 0.5972222222222222f, 0.611111111111111f, 0.6249999999999999f, 0.6388888888888888f, 0.6527777777777778f, 0.6726190476190474f, 0.6944444444444442f, 0.7162698412698412f, 0.7380952380952381f, 0.7599206349206349f, 0.7817460317460316f, 0.8035714285714286f, 0.8253968253968254f, 0.8472222222222221f, 0.8690476190476188f, 0.8908730158730158f, 0.9126984126984128f, 0.9345238095238095f, 0.9563492063492063f, 0.978174603174603f, 1}; + static const float g[] = { 0, 0.01388888888888889f, 0.02777777777777778f, 0.04166666666666666f, 0.05555555555555555f, 0.06944444444444445f, 0.08333333333333333f, 0.09722222222222221f, 0.1111111111111111f, 0.125f, 0.1388888888888889f, 0.1527777777777778f, 0.1666666666666667f, 0.1805555555555556f, 0.1944444444444444f, 0.2083333333333333f, 0.2222222222222222f, 0.2361111111111111f, 0.25f, 0.2638888888888889f, 0.2777777777777778f, 0.2916666666666666f, 0.3055555555555555f, 0.3194444444444444f, 0.3353174603174602f, 0.3544973544973544f, 0.3736772486772486f, 0.3928571428571428f, 0.412037037037037f, 0.4312169312169312f, 0.4503968253968254f, 0.4695767195767195f, 0.4887566137566137f, 0.5079365079365078f, 0.5271164021164021f, 0.5462962962962963f, 0.5654761904761904f, 0.5846560846560845f, 0.6038359788359787f, 0.623015873015873f, 0.6421957671957671f, 0.6613756613756612f, 0.6805555555555555f, 0.6997354497354497f, 0.7189153439153438f, 0.7380952380952379f, 0.7572751322751322f, 0.7764550264550264f, 0.7916666666666666f, 0.8055555555555555f, 0.8194444444444444f, 0.8333333333333334f, 0.8472222222222222f, 0.861111111111111f, 0.875f, 0.8888888888888888f, 0.9027777777777777f, 0.9166666666666665f, 0.9305555555555555f, 0.9444444444444444f, 0.9583333333333333f, 0.9722222222222221f, 0.986111111111111f, 1}; + static const float b[] = { 0, 0.01917989417989418f, 0.03835978835978836f, 0.05753968253968253f, 0.07671957671957672f, 0.09589947089947089f, 0.1150793650793651f, 0.1342592592592592f, 0.1534391534391534f, 0.1726190476190476f, 0.1917989417989418f, 0.210978835978836f, 0.2301587301587301f, 0.2493386243386243f, 0.2685185185185185f, 0.2876984126984127f, 0.3068783068783069f, 0.326058201058201f, 0.3452380952380952f, 0.3644179894179894f, 0.3835978835978835f, 0.4027777777777777f, 0.4219576719576719f, 0.4411375661375661f, 0.4583333333333333f, 0.4722222222222222f, 0.4861111111111111f, 0.5f, 0.5138888888888888f, 0.5277777777777777f, 0.5416666666666666f, 0.5555555555555556f, 0.5694444444444444f, 0.5833333333333333f, 0.5972222222222222f, 0.6111111111111112f, 0.625f, 0.6388888888888888f, 0.6527777777777778f, 0.6666666666666667f, 0.6805555555555556f, 0.6944444444444444f, 0.7083333333333333f, 0.7222222222222222f, 0.736111111111111f, 0.7499999999999999f, 0.7638888888888888f, 0.7777777777777778f, 0.7916666666666666f, 0.8055555555555555f, 0.8194444444444444f, 0.8333333333333334f, 0.8472222222222222f, 0.861111111111111f, 0.875f, 0.8888888888888888f, 0.9027777777777777f, 0.9166666666666665f, 0.9305555555555555f, 0.9444444444444444f, 0.9583333333333333f, 0.9722222222222221f, 0.986111111111111f, 1}; Mat X = linspace(0,1,64); this->_lut = ColorMap::linear_colormap(X, - Mat(64,1, CV_32FC1, r).clone(), // red - Mat(64,1, CV_32FC1, g).clone(), // green - Mat(64,1, CV_32FC1, b).clone(), // blue + Mat(64,1, CV_32FC1, (void*)r).clone(), // red + Mat(64,1, CV_32FC1, (void*)g).clone(), // green + Mat(64,1, CV_32FC1, (void*)b).clone(), // blue n); // number of sample points } }; @@ -238,14 +238,14 @@ namespace colormap // breakpoints Mat X = linspace(0,1,256); // define the basemap - float r[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.00588235294117645f,0.02156862745098032f,0.03725490196078418f,0.05294117647058827f,0.06862745098039214f,0.084313725490196f,0.1000000000000001f,0.115686274509804f,0.1313725490196078f,0.1470588235294117f,0.1627450980392156f,0.1784313725490196f,0.1941176470588235f,0.2098039215686274f,0.2254901960784315f,0.2411764705882353f,0.2568627450980392f,0.2725490196078431f,0.2882352941176469f,0.303921568627451f,0.3196078431372549f,0.3352941176470587f,0.3509803921568628f,0.3666666666666667f,0.3823529411764706f,0.3980392156862744f,0.4137254901960783f,0.4294117647058824f,0.4450980392156862f,0.4607843137254901f,0.4764705882352942f,0.4921568627450981f,0.5078431372549019f,0.5235294117647058f,0.5392156862745097f,0.5549019607843135f,0.5705882352941174f,0.5862745098039217f,0.6019607843137256f,0.6176470588235294f,0.6333333333333333f,0.6490196078431372f,0.664705882352941f,0.6803921568627449f,0.6960784313725492f,0.7117647058823531f,0.7274509803921569f,0.7431372549019608f,0.7588235294117647f,0.7745098039215685f,0.7901960784313724f,0.8058823529411763f,0.8215686274509801f,0.8372549019607844f,0.8529411764705883f,0.8686274509803922f,0.884313725490196f,0.8999999999999999f,0.9156862745098038f,0.9313725490196076f,0.947058823529412f,0.9627450980392158f,0.9784313725490197f,0.9941176470588236f,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.9862745098039216f,0.9705882352941178f,0.9549019607843139f,0.93921568627451f,0.9235294117647062f,0.9078431372549018f,0.892156862745098f,0.8764705882352941f,0.8607843137254902f,0.8450980392156864f,0.8294117647058825f,0.8137254901960786f,0.7980392156862743f,0.7823529411764705f,0.7666666666666666f,0.7509803921568627f,0.7352941176470589f,0.719607843137255f,0.7039215686274511f,0.6882352941176473f,0.6725490196078434f,0.6568627450980391f,0.6411764705882352f,0.6254901960784314f,0.6098039215686275f,0.5941176470588236f,0.5784313725490198f,0.5627450980392159f,0.5470588235294116f,0.5313725490196077f,0.5156862745098039f,0.5f}; - float g[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.001960784313725483f,0.01764705882352935f,0.03333333333333333f,0.0490196078431373f,0.06470588235294117f,0.08039215686274503f,0.09607843137254901f,0.111764705882353f,0.1274509803921569f,0.1431372549019607f,0.1588235294117647f,0.1745098039215687f,0.1901960784313725f,0.2058823529411764f,0.2215686274509804f,0.2372549019607844f,0.2529411764705882f,0.2686274509803921f,0.2843137254901961f,0.3f,0.3156862745098039f,0.3313725490196078f,0.3470588235294118f,0.3627450980392157f,0.3784313725490196f,0.3941176470588235f,0.4098039215686274f,0.4254901960784314f,0.4411764705882353f,0.4568627450980391f,0.4725490196078431f,0.4882352941176471f,0.503921568627451f,0.5196078431372548f,0.5352941176470587f,0.5509803921568628f,0.5666666666666667f,0.5823529411764705f,0.5980392156862746f,0.6137254901960785f,0.6294117647058823f,0.6450980392156862f,0.6607843137254901f,0.6764705882352942f,0.692156862745098f,0.7078431372549019f,0.723529411764706f,0.7392156862745098f,0.7549019607843137f,0.7705882352941176f,0.7862745098039214f,0.8019607843137255f,0.8176470588235294f,0.8333333333333333f,0.8490196078431373f,0.8647058823529412f,0.8803921568627451f,0.8960784313725489f,0.9117647058823528f,0.9274509803921569f,0.9431372549019608f,0.9588235294117646f,0.9745098039215687f,0.9901960784313726f,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.9901960784313726f,0.9745098039215687f,0.9588235294117649f,0.943137254901961f,0.9274509803921571f,0.9117647058823528f,0.8960784313725489f,0.8803921568627451f,0.8647058823529412f,0.8490196078431373f,0.8333333333333335f,0.8176470588235296f,0.8019607843137253f,0.7862745098039214f,0.7705882352941176f,0.7549019607843137f,0.7392156862745098f,0.723529411764706f,0.7078431372549021f,0.6921568627450982f,0.6764705882352944f,0.6607843137254901f,0.6450980392156862f,0.6294117647058823f,0.6137254901960785f,0.5980392156862746f,0.5823529411764707f,0.5666666666666669f,0.5509803921568626f,0.5352941176470587f,0.5196078431372548f,0.503921568627451f,0.4882352941176471f,0.4725490196078432f,0.4568627450980394f,0.4411764705882355f,0.4254901960784316f,0.4098039215686273f,0.3941176470588235f,0.3784313725490196f,0.3627450980392157f,0.3470588235294119f,0.331372549019608f,0.3156862745098041f,0.2999999999999998f,0.284313725490196f,0.2686274509803921f,0.2529411764705882f,0.2372549019607844f,0.2215686274509805f,0.2058823529411766f,0.1901960784313728f,0.1745098039215689f,0.1588235294117646f,0.1431372549019607f,0.1274509803921569f,0.111764705882353f,0.09607843137254912f,0.08039215686274526f,0.06470588235294139f,0.04901960784313708f,0.03333333333333321f,0.01764705882352935f,0.001960784313725483f,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - float b[] = {0.5f,0.5156862745098039f,0.5313725490196078f,0.5470588235294118f,0.5627450980392157f,0.5784313725490196f,0.5941176470588235f,0.6098039215686275f,0.6254901960784314f,0.6411764705882352f,0.6568627450980392f,0.6725490196078432f,0.6882352941176471f,0.7039215686274509f,0.7196078431372549f,0.7352941176470589f,0.7509803921568627f,0.7666666666666666f,0.7823529411764706f,0.7980392156862746f,0.8137254901960784f,0.8294117647058823f,0.8450980392156863f,0.8607843137254902f,0.8764705882352941f,0.892156862745098f,0.907843137254902f,0.9235294117647059f,0.9392156862745098f,0.9549019607843137f,0.9705882352941176f,0.9862745098039216f,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.9941176470588236f,0.9784313725490197f,0.9627450980392158f,0.9470588235294117f,0.9313725490196079f,0.915686274509804f,0.8999999999999999f,0.884313725490196f,0.8686274509803922f,0.8529411764705883f,0.8372549019607844f,0.8215686274509804f,0.8058823529411765f,0.7901960784313726f,0.7745098039215685f,0.7588235294117647f,0.7431372549019608f,0.7274509803921569f,0.7117647058823531f,0.696078431372549f,0.6803921568627451f,0.6647058823529413f,0.6490196078431372f,0.6333333333333333f,0.6176470588235294f,0.6019607843137256f,0.5862745098039217f,0.5705882352941176f,0.5549019607843138f,0.5392156862745099f,0.5235294117647058f,0.5078431372549019f,0.4921568627450981f,0.4764705882352942f,0.4607843137254903f,0.4450980392156865f,0.4294117647058826f,0.4137254901960783f,0.3980392156862744f,0.3823529411764706f,0.3666666666666667f,0.3509803921568628f,0.335294117647059f,0.3196078431372551f,0.3039215686274508f,0.2882352941176469f,0.2725490196078431f,0.2568627450980392f,0.2411764705882353f,0.2254901960784315f,0.2098039215686276f,0.1941176470588237f,0.1784313725490199f,0.1627450980392156f,0.1470588235294117f,0.1313725490196078f,0.115686274509804f,0.1000000000000001f,0.08431372549019622f,0.06862745098039236f,0.05294117647058805f,0.03725490196078418f,0.02156862745098032f,0.00588235294117645f,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + static const float r[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.00588235294117645f,0.02156862745098032f,0.03725490196078418f,0.05294117647058827f,0.06862745098039214f,0.084313725490196f,0.1000000000000001f,0.115686274509804f,0.1313725490196078f,0.1470588235294117f,0.1627450980392156f,0.1784313725490196f,0.1941176470588235f,0.2098039215686274f,0.2254901960784315f,0.2411764705882353f,0.2568627450980392f,0.2725490196078431f,0.2882352941176469f,0.303921568627451f,0.3196078431372549f,0.3352941176470587f,0.3509803921568628f,0.3666666666666667f,0.3823529411764706f,0.3980392156862744f,0.4137254901960783f,0.4294117647058824f,0.4450980392156862f,0.4607843137254901f,0.4764705882352942f,0.4921568627450981f,0.5078431372549019f,0.5235294117647058f,0.5392156862745097f,0.5549019607843135f,0.5705882352941174f,0.5862745098039217f,0.6019607843137256f,0.6176470588235294f,0.6333333333333333f,0.6490196078431372f,0.664705882352941f,0.6803921568627449f,0.6960784313725492f,0.7117647058823531f,0.7274509803921569f,0.7431372549019608f,0.7588235294117647f,0.7745098039215685f,0.7901960784313724f,0.8058823529411763f,0.8215686274509801f,0.8372549019607844f,0.8529411764705883f,0.8686274509803922f,0.884313725490196f,0.8999999999999999f,0.9156862745098038f,0.9313725490196076f,0.947058823529412f,0.9627450980392158f,0.9784313725490197f,0.9941176470588236f,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.9862745098039216f,0.9705882352941178f,0.9549019607843139f,0.93921568627451f,0.9235294117647062f,0.9078431372549018f,0.892156862745098f,0.8764705882352941f,0.8607843137254902f,0.8450980392156864f,0.8294117647058825f,0.8137254901960786f,0.7980392156862743f,0.7823529411764705f,0.7666666666666666f,0.7509803921568627f,0.7352941176470589f,0.719607843137255f,0.7039215686274511f,0.6882352941176473f,0.6725490196078434f,0.6568627450980391f,0.6411764705882352f,0.6254901960784314f,0.6098039215686275f,0.5941176470588236f,0.5784313725490198f,0.5627450980392159f,0.5470588235294116f,0.5313725490196077f,0.5156862745098039f,0.5f}; + static const float g[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.001960784313725483f,0.01764705882352935f,0.03333333333333333f,0.0490196078431373f,0.06470588235294117f,0.08039215686274503f,0.09607843137254901f,0.111764705882353f,0.1274509803921569f,0.1431372549019607f,0.1588235294117647f,0.1745098039215687f,0.1901960784313725f,0.2058823529411764f,0.2215686274509804f,0.2372549019607844f,0.2529411764705882f,0.2686274509803921f,0.2843137254901961f,0.3f,0.3156862745098039f,0.3313725490196078f,0.3470588235294118f,0.3627450980392157f,0.3784313725490196f,0.3941176470588235f,0.4098039215686274f,0.4254901960784314f,0.4411764705882353f,0.4568627450980391f,0.4725490196078431f,0.4882352941176471f,0.503921568627451f,0.5196078431372548f,0.5352941176470587f,0.5509803921568628f,0.5666666666666667f,0.5823529411764705f,0.5980392156862746f,0.6137254901960785f,0.6294117647058823f,0.6450980392156862f,0.6607843137254901f,0.6764705882352942f,0.692156862745098f,0.7078431372549019f,0.723529411764706f,0.7392156862745098f,0.7549019607843137f,0.7705882352941176f,0.7862745098039214f,0.8019607843137255f,0.8176470588235294f,0.8333333333333333f,0.8490196078431373f,0.8647058823529412f,0.8803921568627451f,0.8960784313725489f,0.9117647058823528f,0.9274509803921569f,0.9431372549019608f,0.9588235294117646f,0.9745098039215687f,0.9901960784313726f,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.9901960784313726f,0.9745098039215687f,0.9588235294117649f,0.943137254901961f,0.9274509803921571f,0.9117647058823528f,0.8960784313725489f,0.8803921568627451f,0.8647058823529412f,0.8490196078431373f,0.8333333333333335f,0.8176470588235296f,0.8019607843137253f,0.7862745098039214f,0.7705882352941176f,0.7549019607843137f,0.7392156862745098f,0.723529411764706f,0.7078431372549021f,0.6921568627450982f,0.6764705882352944f,0.6607843137254901f,0.6450980392156862f,0.6294117647058823f,0.6137254901960785f,0.5980392156862746f,0.5823529411764707f,0.5666666666666669f,0.5509803921568626f,0.5352941176470587f,0.5196078431372548f,0.503921568627451f,0.4882352941176471f,0.4725490196078432f,0.4568627450980394f,0.4411764705882355f,0.4254901960784316f,0.4098039215686273f,0.3941176470588235f,0.3784313725490196f,0.3627450980392157f,0.3470588235294119f,0.331372549019608f,0.3156862745098041f,0.2999999999999998f,0.284313725490196f,0.2686274509803921f,0.2529411764705882f,0.2372549019607844f,0.2215686274509805f,0.2058823529411766f,0.1901960784313728f,0.1745098039215689f,0.1588235294117646f,0.1431372549019607f,0.1274509803921569f,0.111764705882353f,0.09607843137254912f,0.08039215686274526f,0.06470588235294139f,0.04901960784313708f,0.03333333333333321f,0.01764705882352935f,0.001960784313725483f,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + static const float b[] = {0.5f,0.5156862745098039f,0.5313725490196078f,0.5470588235294118f,0.5627450980392157f,0.5784313725490196f,0.5941176470588235f,0.6098039215686275f,0.6254901960784314f,0.6411764705882352f,0.6568627450980392f,0.6725490196078432f,0.6882352941176471f,0.7039215686274509f,0.7196078431372549f,0.7352941176470589f,0.7509803921568627f,0.7666666666666666f,0.7823529411764706f,0.7980392156862746f,0.8137254901960784f,0.8294117647058823f,0.8450980392156863f,0.8607843137254902f,0.8764705882352941f,0.892156862745098f,0.907843137254902f,0.9235294117647059f,0.9392156862745098f,0.9549019607843137f,0.9705882352941176f,0.9862745098039216f,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.9941176470588236f,0.9784313725490197f,0.9627450980392158f,0.9470588235294117f,0.9313725490196079f,0.915686274509804f,0.8999999999999999f,0.884313725490196f,0.8686274509803922f,0.8529411764705883f,0.8372549019607844f,0.8215686274509804f,0.8058823529411765f,0.7901960784313726f,0.7745098039215685f,0.7588235294117647f,0.7431372549019608f,0.7274509803921569f,0.7117647058823531f,0.696078431372549f,0.6803921568627451f,0.6647058823529413f,0.6490196078431372f,0.6333333333333333f,0.6176470588235294f,0.6019607843137256f,0.5862745098039217f,0.5705882352941176f,0.5549019607843138f,0.5392156862745099f,0.5235294117647058f,0.5078431372549019f,0.4921568627450981f,0.4764705882352942f,0.4607843137254903f,0.4450980392156865f,0.4294117647058826f,0.4137254901960783f,0.3980392156862744f,0.3823529411764706f,0.3666666666666667f,0.3509803921568628f,0.335294117647059f,0.3196078431372551f,0.3039215686274508f,0.2882352941176469f,0.2725490196078431f,0.2568627450980392f,0.2411764705882353f,0.2254901960784315f,0.2098039215686276f,0.1941176470588237f,0.1784313725490199f,0.1627450980392156f,0.1470588235294117f,0.1313725490196078f,0.115686274509804f,0.1000000000000001f,0.08431372549019622f,0.06862745098039236f,0.05294117647058805f,0.03725490196078418f,0.02156862745098032f,0.00588235294117645f,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; // now build lookup table this->_lut = ColorMap::linear_colormap(X, - Mat(256,1, CV_32FC1, r).clone(), // red - Mat(256,1, CV_32FC1, g).clone(), // green - Mat(256,1, CV_32FC1, b).clone(), // blue + Mat(256,1, CV_32FC1, (void*)r).clone(), // red + Mat(256,1, CV_32FC1, (void*)g).clone(), // green + Mat(256,1, CV_32FC1, (void*)b).clone(), // blue n); } }; @@ -262,14 +262,14 @@ namespace colormap } void init(int n) { - float r[] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}; - float g[] = {0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f,}; - float b[] = {1.0, 0.95f, 0.9f, 0.85f, 0.8f, 0.75f, 0.7f, 0.65f, 0.6f, 0.55f, 0.5f}; + static const float r[] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}; + static const float g[] = {0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f,}; + static const float b[] = {1.0, 0.95f, 0.9f, 0.85f, 0.8f, 0.75f, 0.7f, 0.65f, 0.6f, 0.55f, 0.5f}; Mat X = linspace(0,1,11); this->_lut = ColorMap::linear_colormap(X, - Mat(11,1, CV_32FC1, r).clone(), // red - Mat(11,1, CV_32FC1, g).clone(), // green - Mat(11,1, CV_32FC1, b).clone(), // blue + Mat(11,1, CV_32FC1, (void*)r).clone(), // red + Mat(11,1, CV_32FC1, (void*)g).clone(), // green + Mat(11,1, CV_32FC1, (void*)b).clone(), // blue n); // number of sample points } }; @@ -286,14 +286,14 @@ namespace colormap } void init(int n) { - float r[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9365079365079367f, 0.8571428571428572f, 0.7777777777777777f, 0.6984126984126986f, 0.6190476190476191f, 0.53968253968254f, 0.4603174603174605f, 0.3809523809523814f, 0.3015873015873018f, 0.2222222222222223f, 0.1428571428571432f, 0.06349206349206415f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.03174603174603208f, 0.08465608465608465f, 0.1375661375661377f, 0.1904761904761907f, 0.2433862433862437f, 0.2962962962962963f, 0.3492063492063493f, 0.4021164021164023f, 0.4550264550264553f, 0.5079365079365079f, 0.5608465608465609f, 0.6137566137566139f, 0.666666666666667f}; - float g[] = { 0, 0.03968253968253968f, 0.07936507936507936f, 0.119047619047619f, 0.1587301587301587f, 0.1984126984126984f, 0.2380952380952381f, 0.2777777777777778f, 0.3174603174603174f, 0.3571428571428571f, 0.3968253968253968f, 0.4365079365079365f, 0.4761904761904762f, 0.5158730158730158f, 0.5555555555555556f, 0.5952380952380952f, 0.6349206349206349f, 0.6746031746031745f, 0.7142857142857142f, 0.753968253968254f, 0.7936507936507936f, 0.8333333333333333f, 0.873015873015873f, 0.9126984126984127f, 0.9523809523809523f, 0.992063492063492f, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9841269841269842f, 0.9047619047619047f, 0.8253968253968256f, 0.7460317460317465f, 0.666666666666667f, 0.587301587301587f, 0.5079365079365079f, 0.4285714285714288f, 0.3492063492063493f, 0.2698412698412698f, 0.1904761904761907f, 0.1111111111111116f, 0.03174603174603208f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - float b[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.01587301587301582f, 0.09523809523809534f, 0.1746031746031744f, 0.2539682539682535f, 0.333333333333333f, 0.412698412698413f, 0.4920634920634921f, 0.5714285714285712f, 0.6507936507936507f, 0.7301587301587302f, 0.8095238095238093f, 0.8888888888888884f, 0.9682539682539679f, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + static const float r[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9365079365079367f, 0.8571428571428572f, 0.7777777777777777f, 0.6984126984126986f, 0.6190476190476191f, 0.53968253968254f, 0.4603174603174605f, 0.3809523809523814f, 0.3015873015873018f, 0.2222222222222223f, 0.1428571428571432f, 0.06349206349206415f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.03174603174603208f, 0.08465608465608465f, 0.1375661375661377f, 0.1904761904761907f, 0.2433862433862437f, 0.2962962962962963f, 0.3492063492063493f, 0.4021164021164023f, 0.4550264550264553f, 0.5079365079365079f, 0.5608465608465609f, 0.6137566137566139f, 0.666666666666667f}; + static const float g[] = { 0, 0.03968253968253968f, 0.07936507936507936f, 0.119047619047619f, 0.1587301587301587f, 0.1984126984126984f, 0.2380952380952381f, 0.2777777777777778f, 0.3174603174603174f, 0.3571428571428571f, 0.3968253968253968f, 0.4365079365079365f, 0.4761904761904762f, 0.5158730158730158f, 0.5555555555555556f, 0.5952380952380952f, 0.6349206349206349f, 0.6746031746031745f, 0.7142857142857142f, 0.753968253968254f, 0.7936507936507936f, 0.8333333333333333f, 0.873015873015873f, 0.9126984126984127f, 0.9523809523809523f, 0.992063492063492f, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9841269841269842f, 0.9047619047619047f, 0.8253968253968256f, 0.7460317460317465f, 0.666666666666667f, 0.587301587301587f, 0.5079365079365079f, 0.4285714285714288f, 0.3492063492063493f, 0.2698412698412698f, 0.1904761904761907f, 0.1111111111111116f, 0.03174603174603208f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + static const float b[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.01587301587301582f, 0.09523809523809534f, 0.1746031746031744f, 0.2539682539682535f, 0.333333333333333f, 0.412698412698413f, 0.4920634920634921f, 0.5714285714285712f, 0.6507936507936507f, 0.7301587301587302f, 0.8095238095238093f, 0.8888888888888884f, 0.9682539682539679f, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; Mat X = linspace(0,1,64); this->_lut = ColorMap::linear_colormap(X, - Mat(64,1, CV_32FC1, r).clone(), // red - Mat(64,1, CV_32FC1, g).clone(), // green - Mat(64,1, CV_32FC1, b).clone(), // blue + Mat(64,1, CV_32FC1, (void*)r).clone(), // red + Mat(64,1, CV_32FC1, (void*)g).clone(), // green + Mat(64,1, CV_32FC1, (void*)b).clone(), // blue n); // number of sample points } }; @@ -310,14 +310,14 @@ namespace colormap } void init(int n) { - float r[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.04761904761904762f, 0.09523809523809523f, 0.1428571428571428f, 0.1904761904761905f, 0.2380952380952381f, 0.2857142857142857f, 0.3333333333333333f, 0.3809523809523809f, 0.4285714285714285f, 0.4761904761904762f, 0.5238095238095238f, 0.5714285714285714f, 0.6190476190476191f, 0.6666666666666666f, 0.7142857142857143f, 0.7619047619047619f, 0.8095238095238095f, 0.8571428571428571f, 0.9047619047619048f, 0.9523809523809523f, 1}; - float g[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.02380952380952381f, 0.04761904761904762f, 0.07142857142857142f, 0.09523809523809523f, 0.119047619047619f, 0.1428571428571428f, 0.1666666666666667f, 0.1904761904761905f, 0.2142857142857143f, 0.2380952380952381f, 0.2619047619047619f, 0.2857142857142857f, 0.3095238095238095f, 0.3333333333333333f, 0.3571428571428572f, 0.3809523809523809f, 0.4047619047619048f, 0.4285714285714285f, 0.4523809523809524f, 0.4761904761904762f, 0.5f, 0.5238095238095238f, 0.5476190476190477f, 0.5714285714285714f, 0.5952380952380952f, 0.6190476190476191f, 0.6428571428571429f, 0.6666666666666666f, 0.6904761904761905f, 0.7142857142857143f, 0.7380952380952381f, 0.7619047619047619f, 0.7857142857142857f, 0.8095238095238095f, 0.8333333333333334f, 0.8571428571428571f, 0.8809523809523809f, 0.9047619047619048f, 0.9285714285714286f, 0.9523809523809523f, 0.9761904761904762f, 1}; - float b[] = { 0, 0.01587301587301587f, 0.03174603174603174f, 0.04761904761904762f, 0.06349206349206349f, 0.07936507936507936f, 0.09523809523809523f, 0.1111111111111111f, 0.126984126984127f, 0.1428571428571428f, 0.1587301587301587f, 0.1746031746031746f, 0.1904761904761905f, 0.2063492063492063f, 0.2222222222222222f, 0.2380952380952381f, 0.253968253968254f, 0.2698412698412698f, 0.2857142857142857f, 0.3015873015873016f, 0.3174603174603174f, 0.3333333333333333f, 0.3492063492063492f, 0.3650793650793651f, 0.3809523809523809f, 0.3968253968253968f, 0.4126984126984127f, 0.4285714285714285f, 0.4444444444444444f, 0.4603174603174603f, 0.4761904761904762f, 0.492063492063492f, 0.5079365079365079f, 0.5238095238095238f, 0.5396825396825397f, 0.5555555555555556f, 0.5714285714285714f, 0.5873015873015873f, 0.6031746031746031f, 0.6190476190476191f, 0.6349206349206349f, 0.6507936507936508f, 0.6666666666666666f, 0.6825396825396826f, 0.6984126984126984f, 0.7142857142857143f, 0.7301587301587301f, 0.746031746031746f, 0.7619047619047619f, 0.7777777777777778f, 0.7936507936507936f, 0.8095238095238095f, 0.8253968253968254f, 0.8412698412698413f, 0.8571428571428571f, 0.873015873015873f, 0.8888888888888888f, 0.9047619047619048f, 0.9206349206349206f, 0.9365079365079365f, 0.9523809523809523f, 0.9682539682539683f, 0.9841269841269841f, 1}; + static const float r[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.04761904761904762f, 0.09523809523809523f, 0.1428571428571428f, 0.1904761904761905f, 0.2380952380952381f, 0.2857142857142857f, 0.3333333333333333f, 0.3809523809523809f, 0.4285714285714285f, 0.4761904761904762f, 0.5238095238095238f, 0.5714285714285714f, 0.6190476190476191f, 0.6666666666666666f, 0.7142857142857143f, 0.7619047619047619f, 0.8095238095238095f, 0.8571428571428571f, 0.9047619047619048f, 0.9523809523809523f, 1}; + static const float g[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.02380952380952381f, 0.04761904761904762f, 0.07142857142857142f, 0.09523809523809523f, 0.119047619047619f, 0.1428571428571428f, 0.1666666666666667f, 0.1904761904761905f, 0.2142857142857143f, 0.2380952380952381f, 0.2619047619047619f, 0.2857142857142857f, 0.3095238095238095f, 0.3333333333333333f, 0.3571428571428572f, 0.3809523809523809f, 0.4047619047619048f, 0.4285714285714285f, 0.4523809523809524f, 0.4761904761904762f, 0.5f, 0.5238095238095238f, 0.5476190476190477f, 0.5714285714285714f, 0.5952380952380952f, 0.6190476190476191f, 0.6428571428571429f, 0.6666666666666666f, 0.6904761904761905f, 0.7142857142857143f, 0.7380952380952381f, 0.7619047619047619f, 0.7857142857142857f, 0.8095238095238095f, 0.8333333333333334f, 0.8571428571428571f, 0.8809523809523809f, 0.9047619047619048f, 0.9285714285714286f, 0.9523809523809523f, 0.9761904761904762f, 1}; + static const float b[] = { 0, 0.01587301587301587f, 0.03174603174603174f, 0.04761904761904762f, 0.06349206349206349f, 0.07936507936507936f, 0.09523809523809523f, 0.1111111111111111f, 0.126984126984127f, 0.1428571428571428f, 0.1587301587301587f, 0.1746031746031746f, 0.1904761904761905f, 0.2063492063492063f, 0.2222222222222222f, 0.2380952380952381f, 0.253968253968254f, 0.2698412698412698f, 0.2857142857142857f, 0.3015873015873016f, 0.3174603174603174f, 0.3333333333333333f, 0.3492063492063492f, 0.3650793650793651f, 0.3809523809523809f, 0.3968253968253968f, 0.4126984126984127f, 0.4285714285714285f, 0.4444444444444444f, 0.4603174603174603f, 0.4761904761904762f, 0.492063492063492f, 0.5079365079365079f, 0.5238095238095238f, 0.5396825396825397f, 0.5555555555555556f, 0.5714285714285714f, 0.5873015873015873f, 0.6031746031746031f, 0.6190476190476191f, 0.6349206349206349f, 0.6507936507936508f, 0.6666666666666666f, 0.6825396825396826f, 0.6984126984126984f, 0.7142857142857143f, 0.7301587301587301f, 0.746031746031746f, 0.7619047619047619f, 0.7777777777777778f, 0.7936507936507936f, 0.8095238095238095f, 0.8253968253968254f, 0.8412698412698413f, 0.8571428571428571f, 0.873015873015873f, 0.8888888888888888f, 0.9047619047619048f, 0.9206349206349206f, 0.9365079365079365f, 0.9523809523809523f, 0.9682539682539683f, 0.9841269841269841f, 1}; Mat X = linspace(0,1,64); this->_lut = ColorMap::linear_colormap(X, - Mat(64,1, CV_32FC1, r).clone(), // red - Mat(64,1, CV_32FC1, g).clone(), // green - Mat(64,1, CV_32FC1, b).clone(), // blue + Mat(64,1, CV_32FC1, (void*)r).clone(), // red + Mat(64,1, CV_32FC1, (void*)g).clone(), // green + Mat(64,1, CV_32FC1, (void*)b).clone(), // blue n); // number of sample points } }; @@ -334,14 +334,14 @@ namespace colormap } void init(int n) { - float r[] = { 0, 0.01587301587301587f, 0.03174603174603174f, 0.04761904761904762f, 0.06349206349206349f, 0.07936507936507936f, 0.09523809523809523f, 0.1111111111111111f, 0.126984126984127f, 0.1428571428571428f, 0.1587301587301587f, 0.1746031746031746f, 0.1904761904761905f, 0.2063492063492063f, 0.2222222222222222f, 0.2380952380952381f, 0.253968253968254f, 0.2698412698412698f, 0.2857142857142857f, 0.3015873015873016f, 0.3174603174603174f, 0.3333333333333333f, 0.3492063492063492f, 0.3650793650793651f, 0.3809523809523809f, 0.3968253968253968f, 0.4126984126984127f, 0.4285714285714285f, 0.4444444444444444f, 0.4603174603174603f, 0.4761904761904762f, 0.492063492063492f, 0.5079365079365079f, 0.5238095238095238f, 0.5396825396825397f, 0.5555555555555556f, 0.5714285714285714f, 0.5873015873015873f, 0.6031746031746031f, 0.6190476190476191f, 0.6349206349206349f, 0.6507936507936508f, 0.6666666666666666f, 0.6825396825396826f, 0.6984126984126984f, 0.7142857142857143f, 0.7301587301587301f, 0.746031746031746f, 0.7619047619047619f, 0.7777777777777778f, 0.7936507936507936f, 0.8095238095238095f, 0.8253968253968254f, 0.8412698412698413f, 0.8571428571428571f, 0.873015873015873f, 0.8888888888888888f, 0.9047619047619048f, 0.9206349206349206f, 0.9365079365079365f, 0.9523809523809523f, 0.9682539682539683f, 0.9841269841269841f, 1}; - float g[] = { 0.5f, 0.5079365079365079f, 0.5158730158730158f, 0.5238095238095238f, 0.5317460317460317f, 0.5396825396825397f, 0.5476190476190477f, 0.5555555555555556f, 0.5634920634920635f, 0.5714285714285714f, 0.5793650793650793f, 0.5873015873015873f, 0.5952380952380952f, 0.6031746031746031f, 0.6111111111111112f, 0.6190476190476191f, 0.626984126984127f, 0.6349206349206349f, 0.6428571428571428f, 0.6507936507936508f, 0.6587301587301587f, 0.6666666666666666f, 0.6746031746031746f, 0.6825396825396826f, 0.6904761904761905f, 0.6984126984126984f, 0.7063492063492063f, 0.7142857142857143f, 0.7222222222222222f, 0.7301587301587301f, 0.7380952380952381f, 0.746031746031746f, 0.753968253968254f, 0.7619047619047619f, 0.7698412698412698f, 0.7777777777777778f, 0.7857142857142857f, 0.7936507936507937f, 0.8015873015873016f, 0.8095238095238095f, 0.8174603174603174f, 0.8253968253968254f, 0.8333333333333333f, 0.8412698412698413f, 0.8492063492063492f, 0.8571428571428572f, 0.8650793650793651f, 0.873015873015873f, 0.8809523809523809f, 0.8888888888888888f, 0.8968253968253967f, 0.9047619047619048f, 0.9126984126984127f, 0.9206349206349207f, 0.9285714285714286f, 0.9365079365079365f, 0.9444444444444444f, 0.9523809523809523f, 0.9603174603174602f, 0.9682539682539683f, 0.9761904761904762f, 0.9841269841269842f, 0.9920634920634921f, 1}; - float b[] = { 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f}; + static const float r[] = { 0, 0.01587301587301587f, 0.03174603174603174f, 0.04761904761904762f, 0.06349206349206349f, 0.07936507936507936f, 0.09523809523809523f, 0.1111111111111111f, 0.126984126984127f, 0.1428571428571428f, 0.1587301587301587f, 0.1746031746031746f, 0.1904761904761905f, 0.2063492063492063f, 0.2222222222222222f, 0.2380952380952381f, 0.253968253968254f, 0.2698412698412698f, 0.2857142857142857f, 0.3015873015873016f, 0.3174603174603174f, 0.3333333333333333f, 0.3492063492063492f, 0.3650793650793651f, 0.3809523809523809f, 0.3968253968253968f, 0.4126984126984127f, 0.4285714285714285f, 0.4444444444444444f, 0.4603174603174603f, 0.4761904761904762f, 0.492063492063492f, 0.5079365079365079f, 0.5238095238095238f, 0.5396825396825397f, 0.5555555555555556f, 0.5714285714285714f, 0.5873015873015873f, 0.6031746031746031f, 0.6190476190476191f, 0.6349206349206349f, 0.6507936507936508f, 0.6666666666666666f, 0.6825396825396826f, 0.6984126984126984f, 0.7142857142857143f, 0.7301587301587301f, 0.746031746031746f, 0.7619047619047619f, 0.7777777777777778f, 0.7936507936507936f, 0.8095238095238095f, 0.8253968253968254f, 0.8412698412698413f, 0.8571428571428571f, 0.873015873015873f, 0.8888888888888888f, 0.9047619047619048f, 0.9206349206349206f, 0.9365079365079365f, 0.9523809523809523f, 0.9682539682539683f, 0.9841269841269841f, 1}; + static const float g[] = { 0.5f, 0.5079365079365079f, 0.5158730158730158f, 0.5238095238095238f, 0.5317460317460317f, 0.5396825396825397f, 0.5476190476190477f, 0.5555555555555556f, 0.5634920634920635f, 0.5714285714285714f, 0.5793650793650793f, 0.5873015873015873f, 0.5952380952380952f, 0.6031746031746031f, 0.6111111111111112f, 0.6190476190476191f, 0.626984126984127f, 0.6349206349206349f, 0.6428571428571428f, 0.6507936507936508f, 0.6587301587301587f, 0.6666666666666666f, 0.6746031746031746f, 0.6825396825396826f, 0.6904761904761905f, 0.6984126984126984f, 0.7063492063492063f, 0.7142857142857143f, 0.7222222222222222f, 0.7301587301587301f, 0.7380952380952381f, 0.746031746031746f, 0.753968253968254f, 0.7619047619047619f, 0.7698412698412698f, 0.7777777777777778f, 0.7857142857142857f, 0.7936507936507937f, 0.8015873015873016f, 0.8095238095238095f, 0.8174603174603174f, 0.8253968253968254f, 0.8333333333333333f, 0.8412698412698413f, 0.8492063492063492f, 0.8571428571428572f, 0.8650793650793651f, 0.873015873015873f, 0.8809523809523809f, 0.8888888888888888f, 0.8968253968253967f, 0.9047619047619048f, 0.9126984126984127f, 0.9206349206349207f, 0.9285714285714286f, 0.9365079365079365f, 0.9444444444444444f, 0.9523809523809523f, 0.9603174603174602f, 0.9682539682539683f, 0.9761904761904762f, 0.9841269841269842f, 0.9920634920634921f, 1}; + static const float b[] = { 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f}; Mat X = linspace(0,1,64); this->_lut = ColorMap::linear_colormap(X, - Mat(64,1, CV_32FC1, r).clone(), // red - Mat(64,1, CV_32FC1, g).clone(), // green - Mat(64,1, CV_32FC1, b).clone(), // blue + Mat(64,1, CV_32FC1, (void*)r).clone(), // red + Mat(64,1, CV_32FC1, (void*)g).clone(), // green + Mat(64,1, CV_32FC1, (void*)b).clone(), // blue n); // number of sample points } }; @@ -358,14 +358,14 @@ namespace colormap } void init(int n) { - float r[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - float g[] = { 0, 0.01587301587301587f, 0.03174603174603174f, 0.04761904761904762f, 0.06349206349206349f, 0.07936507936507936f, 0.09523809523809523f, 0.1111111111111111f, 0.126984126984127f, 0.1428571428571428f, 0.1587301587301587f, 0.1746031746031746f, 0.1904761904761905f, 0.2063492063492063f, 0.2222222222222222f, 0.2380952380952381f, 0.253968253968254f, 0.2698412698412698f, 0.2857142857142857f, 0.3015873015873016f, 0.3174603174603174f, 0.3333333333333333f, 0.3492063492063492f, 0.3650793650793651f, 0.3809523809523809f, 0.3968253968253968f, 0.4126984126984127f, 0.4285714285714285f, 0.4444444444444444f, 0.4603174603174603f, 0.4761904761904762f, 0.492063492063492f, 0.5079365079365079f, 0.5238095238095238f, 0.5396825396825397f, 0.5555555555555556f, 0.5714285714285714f, 0.5873015873015873f, 0.6031746031746031f, 0.6190476190476191f, 0.6349206349206349f, 0.6507936507936508f, 0.6666666666666666f, 0.6825396825396826f, 0.6984126984126984f, 0.7142857142857143f, 0.7301587301587301f, 0.746031746031746f, 0.7619047619047619f, 0.7777777777777778f, 0.7936507936507936f, 0.8095238095238095f, 0.8253968253968254f, 0.8412698412698413f, 0.8571428571428571f, 0.873015873015873f, 0.8888888888888888f, 0.9047619047619048f, 0.9206349206349206f, 0.9365079365079365f, 0.9523809523809523f, 0.9682539682539683f, 0.9841269841269841f, 1}; - float b[] = { 1, 0.9841269841269842f, 0.9682539682539683f, 0.9523809523809523f, 0.9365079365079365f, 0.9206349206349207f, 0.9047619047619048f, 0.8888888888888888f, 0.873015873015873f, 0.8571428571428572f, 0.8412698412698413f, 0.8253968253968254f, 0.8095238095238095f, 0.7936507936507937f, 0.7777777777777778f, 0.7619047619047619f, 0.746031746031746f, 0.7301587301587302f, 0.7142857142857143f, 0.6984126984126984f, 0.6825396825396826f, 0.6666666666666667f, 0.6507936507936508f, 0.6349206349206349f, 0.6190476190476191f, 0.6031746031746033f, 0.5873015873015873f, 0.5714285714285714f, 0.5555555555555556f, 0.5396825396825398f, 0.5238095238095238f, 0.5079365079365079f, 0.4920634920634921f, 0.4761904761904762f, 0.4603174603174603f, 0.4444444444444444f, 0.4285714285714286f, 0.4126984126984127f, 0.3968253968253969f, 0.3809523809523809f, 0.3650793650793651f, 0.3492063492063492f, 0.3333333333333334f, 0.3174603174603174f, 0.3015873015873016f, 0.2857142857142857f, 0.2698412698412699f, 0.253968253968254f, 0.2380952380952381f, 0.2222222222222222f, 0.2063492063492064f, 0.1904761904761905f, 0.1746031746031746f, 0.1587301587301587f, 0.1428571428571429f, 0.126984126984127f, 0.1111111111111112f, 0.09523809523809523f, 0.07936507936507942f, 0.06349206349206349f, 0.04761904761904767f, 0.03174603174603174f, 0.01587301587301593f, 0}; + static const float r[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + static const float g[] = { 0, 0.01587301587301587f, 0.03174603174603174f, 0.04761904761904762f, 0.06349206349206349f, 0.07936507936507936f, 0.09523809523809523f, 0.1111111111111111f, 0.126984126984127f, 0.1428571428571428f, 0.1587301587301587f, 0.1746031746031746f, 0.1904761904761905f, 0.2063492063492063f, 0.2222222222222222f, 0.2380952380952381f, 0.253968253968254f, 0.2698412698412698f, 0.2857142857142857f, 0.3015873015873016f, 0.3174603174603174f, 0.3333333333333333f, 0.3492063492063492f, 0.3650793650793651f, 0.3809523809523809f, 0.3968253968253968f, 0.4126984126984127f, 0.4285714285714285f, 0.4444444444444444f, 0.4603174603174603f, 0.4761904761904762f, 0.492063492063492f, 0.5079365079365079f, 0.5238095238095238f, 0.5396825396825397f, 0.5555555555555556f, 0.5714285714285714f, 0.5873015873015873f, 0.6031746031746031f, 0.6190476190476191f, 0.6349206349206349f, 0.6507936507936508f, 0.6666666666666666f, 0.6825396825396826f, 0.6984126984126984f, 0.7142857142857143f, 0.7301587301587301f, 0.746031746031746f, 0.7619047619047619f, 0.7777777777777778f, 0.7936507936507936f, 0.8095238095238095f, 0.8253968253968254f, 0.8412698412698413f, 0.8571428571428571f, 0.873015873015873f, 0.8888888888888888f, 0.9047619047619048f, 0.9206349206349206f, 0.9365079365079365f, 0.9523809523809523f, 0.9682539682539683f, 0.9841269841269841f, 1}; + static const float b[] = { 1, 0.9841269841269842f, 0.9682539682539683f, 0.9523809523809523f, 0.9365079365079365f, 0.9206349206349207f, 0.9047619047619048f, 0.8888888888888888f, 0.873015873015873f, 0.8571428571428572f, 0.8412698412698413f, 0.8253968253968254f, 0.8095238095238095f, 0.7936507936507937f, 0.7777777777777778f, 0.7619047619047619f, 0.746031746031746f, 0.7301587301587302f, 0.7142857142857143f, 0.6984126984126984f, 0.6825396825396826f, 0.6666666666666667f, 0.6507936507936508f, 0.6349206349206349f, 0.6190476190476191f, 0.6031746031746033f, 0.5873015873015873f, 0.5714285714285714f, 0.5555555555555556f, 0.5396825396825398f, 0.5238095238095238f, 0.5079365079365079f, 0.4920634920634921f, 0.4761904761904762f, 0.4603174603174603f, 0.4444444444444444f, 0.4285714285714286f, 0.4126984126984127f, 0.3968253968253969f, 0.3809523809523809f, 0.3650793650793651f, 0.3492063492063492f, 0.3333333333333334f, 0.3174603174603174f, 0.3015873015873016f, 0.2857142857142857f, 0.2698412698412699f, 0.253968253968254f, 0.2380952380952381f, 0.2222222222222222f, 0.2063492063492064f, 0.1904761904761905f, 0.1746031746031746f, 0.1587301587301587f, 0.1428571428571429f, 0.126984126984127f, 0.1111111111111112f, 0.09523809523809523f, 0.07936507936507942f, 0.06349206349206349f, 0.04761904761904767f, 0.03174603174603174f, 0.01587301587301593f, 0}; Mat X = linspace(0,1,64); this->_lut = ColorMap::linear_colormap(X, - Mat(64,1, CV_32FC1, r).clone(), // red - Mat(64,1, CV_32FC1, g).clone(), // green - Mat(64,1, CV_32FC1, b).clone(), // blue + Mat(64,1, CV_32FC1, (void*)r).clone(), // red + Mat(64,1, CV_32FC1, (void*)g).clone(), // green + Mat(64,1, CV_32FC1, (void*)b).clone(), // blue n); // number of sample points } }; @@ -382,14 +382,14 @@ namespace colormap } void init(int n) { - float r[] = { 0, 0.01587301587301587f, 0.03174603174603174f, 0.04761904761904762f, 0.06349206349206349f, 0.07936507936507936f, 0.09523809523809523f, 0.1111111111111111f, 0.126984126984127f, 0.1428571428571428f, 0.1587301587301587f, 0.1746031746031746f, 0.1904761904761905f, 0.2063492063492063f, 0.2222222222222222f, 0.2380952380952381f, 0.253968253968254f, 0.2698412698412698f, 0.2857142857142857f, 0.3015873015873016f, 0.3174603174603174f, 0.3333333333333333f, 0.3492063492063492f, 0.3650793650793651f, 0.3809523809523809f, 0.3968253968253968f, 0.4126984126984127f, 0.4285714285714285f, 0.4444444444444444f, 0.4603174603174603f, 0.4761904761904762f, 0.492063492063492f, 0.5079365079365079f, 0.5238095238095238f, 0.5396825396825397f, 0.5555555555555556f, 0.5714285714285714f, 0.5873015873015873f, 0.6031746031746031f, 0.6190476190476191f, 0.6349206349206349f, 0.6507936507936508f, 0.6666666666666666f, 0.6825396825396826f, 0.6984126984126984f, 0.7142857142857143f, 0.7301587301587301f, 0.746031746031746f, 0.7619047619047619f, 0.7777777777777778f, 0.7936507936507936f, 0.8095238095238095f, 0.8253968253968254f, 0.8412698412698413f, 0.8571428571428571f, 0.873015873015873f, 0.8888888888888888f, 0.9047619047619048f, 0.9206349206349206f, 0.9365079365079365f, 0.9523809523809523f, 0.9682539682539683f, 0.9841269841269841f, 1}; - float g[] = { 1, 0.9841269841269842f, 0.9682539682539683f, 0.9523809523809523f, 0.9365079365079365f, 0.9206349206349207f, 0.9047619047619048f, 0.8888888888888888f, 0.873015873015873f, 0.8571428571428572f, 0.8412698412698413f, 0.8253968253968254f, 0.8095238095238095f, 0.7936507936507937f, 0.7777777777777778f, 0.7619047619047619f, 0.746031746031746f, 0.7301587301587302f, 0.7142857142857143f, 0.6984126984126984f, 0.6825396825396826f, 0.6666666666666667f, 0.6507936507936508f, 0.6349206349206349f, 0.6190476190476191f, 0.6031746031746033f, 0.5873015873015873f, 0.5714285714285714f, 0.5555555555555556f, 0.5396825396825398f, 0.5238095238095238f, 0.5079365079365079f, 0.4920634920634921f, 0.4761904761904762f, 0.4603174603174603f, 0.4444444444444444f, 0.4285714285714286f, 0.4126984126984127f, 0.3968253968253969f, 0.3809523809523809f, 0.3650793650793651f, 0.3492063492063492f, 0.3333333333333334f, 0.3174603174603174f, 0.3015873015873016f, 0.2857142857142857f, 0.2698412698412699f, 0.253968253968254f, 0.2380952380952381f, 0.2222222222222222f, 0.2063492063492064f, 0.1904761904761905f, 0.1746031746031746f, 0.1587301587301587f, 0.1428571428571429f, 0.126984126984127f, 0.1111111111111112f, 0.09523809523809523f, 0.07936507936507942f, 0.06349206349206349f, 0.04761904761904767f, 0.03174603174603174f, 0.01587301587301593f, 0}; - float b[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + static const float r[] = { 0, 0.01587301587301587f, 0.03174603174603174f, 0.04761904761904762f, 0.06349206349206349f, 0.07936507936507936f, 0.09523809523809523f, 0.1111111111111111f, 0.126984126984127f, 0.1428571428571428f, 0.1587301587301587f, 0.1746031746031746f, 0.1904761904761905f, 0.2063492063492063f, 0.2222222222222222f, 0.2380952380952381f, 0.253968253968254f, 0.2698412698412698f, 0.2857142857142857f, 0.3015873015873016f, 0.3174603174603174f, 0.3333333333333333f, 0.3492063492063492f, 0.3650793650793651f, 0.3809523809523809f, 0.3968253968253968f, 0.4126984126984127f, 0.4285714285714285f, 0.4444444444444444f, 0.4603174603174603f, 0.4761904761904762f, 0.492063492063492f, 0.5079365079365079f, 0.5238095238095238f, 0.5396825396825397f, 0.5555555555555556f, 0.5714285714285714f, 0.5873015873015873f, 0.6031746031746031f, 0.6190476190476191f, 0.6349206349206349f, 0.6507936507936508f, 0.6666666666666666f, 0.6825396825396826f, 0.6984126984126984f, 0.7142857142857143f, 0.7301587301587301f, 0.746031746031746f, 0.7619047619047619f, 0.7777777777777778f, 0.7936507936507936f, 0.8095238095238095f, 0.8253968253968254f, 0.8412698412698413f, 0.8571428571428571f, 0.873015873015873f, 0.8888888888888888f, 0.9047619047619048f, 0.9206349206349206f, 0.9365079365079365f, 0.9523809523809523f, 0.9682539682539683f, 0.9841269841269841f, 1}; + static const float g[] = { 1, 0.9841269841269842f, 0.9682539682539683f, 0.9523809523809523f, 0.9365079365079365f, 0.9206349206349207f, 0.9047619047619048f, 0.8888888888888888f, 0.873015873015873f, 0.8571428571428572f, 0.8412698412698413f, 0.8253968253968254f, 0.8095238095238095f, 0.7936507936507937f, 0.7777777777777778f, 0.7619047619047619f, 0.746031746031746f, 0.7301587301587302f, 0.7142857142857143f, 0.6984126984126984f, 0.6825396825396826f, 0.6666666666666667f, 0.6507936507936508f, 0.6349206349206349f, 0.6190476190476191f, 0.6031746031746033f, 0.5873015873015873f, 0.5714285714285714f, 0.5555555555555556f, 0.5396825396825398f, 0.5238095238095238f, 0.5079365079365079f, 0.4920634920634921f, 0.4761904761904762f, 0.4603174603174603f, 0.4444444444444444f, 0.4285714285714286f, 0.4126984126984127f, 0.3968253968253969f, 0.3809523809523809f, 0.3650793650793651f, 0.3492063492063492f, 0.3333333333333334f, 0.3174603174603174f, 0.3015873015873016f, 0.2857142857142857f, 0.2698412698412699f, 0.253968253968254f, 0.2380952380952381f, 0.2222222222222222f, 0.2063492063492064f, 0.1904761904761905f, 0.1746031746031746f, 0.1587301587301587f, 0.1428571428571429f, 0.126984126984127f, 0.1111111111111112f, 0.09523809523809523f, 0.07936507936507942f, 0.06349206349206349f, 0.04761904761904767f, 0.03174603174603174f, 0.01587301587301593f, 0}; + static const float b[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; Mat X = linspace(0,1,64); this->_lut = ColorMap::linear_colormap(X, - Mat(64,1, CV_32FC1, r).clone(), // red - Mat(64,1, CV_32FC1, g).clone(), // green - Mat(64,1, CV_32FC1, b).clone(), // blue + Mat(64,1, CV_32FC1, (void*)r).clone(), // red + Mat(64,1, CV_32FC1, (void*)g).clone(), // green + Mat(64,1, CV_32FC1, (void*)b).clone(), // blue n); // number of sample points } }; @@ -406,14 +406,14 @@ namespace colormap } void init(int n) { - float r[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9523809523809526f, 0.8571428571428568f, 0.7619047619047614f, 0.6666666666666665f, 0.5714285714285716f, 0.4761904761904763f, 0.3809523809523805f, 0.2857142857142856f, 0.1904761904761907f, 0.0952380952380949f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.09523809523809557f, 0.1904761904761905f, 0.2857142857142854f, 0.3809523809523809f, 0.4761904761904765f, 0.5714285714285714f, 0.6666666666666663f, 0.7619047619047619f, 0.8571428571428574f, 0.9523809523809523f, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - float g[] = { 0, 0.09523809523809523f, 0.1904761904761905f, 0.2857142857142857f, 0.3809523809523809f, 0.4761904761904762f, 0.5714285714285714f, 0.6666666666666666f, 0.7619047619047619f, 0.8571428571428571f, 0.9523809523809523f, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9523809523809526f, 0.8571428571428577f, 0.7619047619047619f, 0.6666666666666665f, 0.5714285714285716f, 0.4761904761904767f, 0.3809523809523814f, 0.2857142857142856f, 0.1904761904761907f, 0.09523809523809579f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - float b[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.09523809523809523f, 0.1904761904761905f, 0.2857142857142857f, 0.3809523809523809f, 0.4761904761904762f, 0.5714285714285714f, 0.6666666666666666f, 0.7619047619047619f, 0.8571428571428571f, 0.9523809523809523f, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9523809523809526f, 0.8571428571428577f, 0.7619047619047614f, 0.6666666666666665f, 0.5714285714285716f, 0.4761904761904767f, 0.3809523809523805f, 0.2857142857142856f, 0.1904761904761907f, 0.09523809523809579f, 0}; + static const float r[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9523809523809526f, 0.8571428571428568f, 0.7619047619047614f, 0.6666666666666665f, 0.5714285714285716f, 0.4761904761904763f, 0.3809523809523805f, 0.2857142857142856f, 0.1904761904761907f, 0.0952380952380949f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.09523809523809557f, 0.1904761904761905f, 0.2857142857142854f, 0.3809523809523809f, 0.4761904761904765f, 0.5714285714285714f, 0.6666666666666663f, 0.7619047619047619f, 0.8571428571428574f, 0.9523809523809523f, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + static const float g[] = { 0, 0.09523809523809523f, 0.1904761904761905f, 0.2857142857142857f, 0.3809523809523809f, 0.4761904761904762f, 0.5714285714285714f, 0.6666666666666666f, 0.7619047619047619f, 0.8571428571428571f, 0.9523809523809523f, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9523809523809526f, 0.8571428571428577f, 0.7619047619047619f, 0.6666666666666665f, 0.5714285714285716f, 0.4761904761904767f, 0.3809523809523814f, 0.2857142857142856f, 0.1904761904761907f, 0.09523809523809579f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + static const float b[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.09523809523809523f, 0.1904761904761905f, 0.2857142857142857f, 0.3809523809523809f, 0.4761904761904762f, 0.5714285714285714f, 0.6666666666666666f, 0.7619047619047619f, 0.8571428571428571f, 0.9523809523809523f, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9523809523809526f, 0.8571428571428577f, 0.7619047619047614f, 0.6666666666666665f, 0.5714285714285716f, 0.4761904761904767f, 0.3809523809523805f, 0.2857142857142856f, 0.1904761904761907f, 0.09523809523809579f, 0}; Mat X = linspace(0,1,64); this->_lut = ColorMap::linear_colormap(X, - Mat(64,1, CV_32FC1, r).clone(), // red - Mat(64,1, CV_32FC1, g).clone(), // green - Mat(64,1, CV_32FC1, b).clone(), // blue + Mat(64,1, CV_32FC1, (void*)r).clone(), // red + Mat(64,1, CV_32FC1, (void*)g).clone(), // green + Mat(64,1, CV_32FC1, (void*)b).clone(), // blue n); // number of sample points } }; @@ -430,14 +430,14 @@ namespace colormap } void init(int n) { - float r[] = { 0, 0.1571348402636772f, 0.2222222222222222f, 0.2721655269759087f, 0.3142696805273544f, 0.3513641844631533f, 0.3849001794597505f, 0.415739709641549f, 0.4444444444444444f, 0.4714045207910317f, 0.4969039949999532f, 0.5211573066470477f, 0.5443310539518174f, 0.5665577237325317f, 0.5879447357921312f, 0.6085806194501846f, 0.6285393610547089f, 0.6478835438717f, 0.6666666666666666f, 0.6849348892187751f, 0.7027283689263065f, 0.7200822998230956f, 0.7370277311900888f, 0.753592220347252f, 0.7663560447348133f, 0.7732293307186413f, 0.7800420555749596f, 0.7867957924694432f, 0.7934920476158722f, 0.8001322641986387f, 0.8067178260046388f, 0.8132500607904444f, 0.8197302434079591f, 0.8261595987094034f, 0.8325393042503717f, 0.8388704928078611f, 0.8451542547285166f, 0.8513916401208816f, 0.8575836609041332f, 0.8637312927246217f, 0.8698354767504924f, 0.8758971213537393f, 0.8819171036881968f, 0.8878962711712378f, 0.8938354428762595f, 0.8997354108424372f, 0.9055969413076769f, 0.9114207758701963f, 0.9172076325837248f, 0.9229582069908971f, 0.9286731730990523f, 0.9343531843023135f, 0.9399988742535192f, 0.9456108576893002f, 0.9511897312113418f, 0.9567360740266436f, 0.9622504486493763f, 0.9677334015667416f, 0.9731854638710686f, 0.9786071518602129f, 0.9839989676081821f, 0.9893613995077727f, 0.9946949227868761f, 1}; - float g[] = { 0, 0.1028688999747279f, 0.1454785934906616f, 0.1781741612749496f, 0.2057377999494559f, 0.2300218531141181f, 0.2519763153394848f, 0.2721655269759087f, 0.2909571869813232f, 0.3086066999241838f, 0.3253000243161777f, 0.3411775438127727f, 0.3563483225498992f, 0.3708990935094579f, 0.3849001794597505f, 0.3984095364447979f, 0.4114755998989117f, 0.4241393401869012f, 0.4364357804719847f, 0.4483951394230328f, 0.4600437062282361f, 0.4714045207910317f, 0.4824979096371639f, 0.4933419132673033f, 0.5091750772173156f, 0.5328701692569688f, 0.5555555555555556f, 0.5773502691896257f, 0.5983516452371671f, 0.6186404847588913f, 0.6382847385042254f, 0.6573421981221795f, 0.6758625033664688f, 0.6938886664887108f, 0.7114582486036499f, 0.7286042804780002f, 0.7453559924999299f, 0.7617394000445604f, 0.7777777777777778f, 0.7934920476158723f, 0.8089010988089465f, 0.8240220541217402f, 0.8388704928078611f, 0.8534606386520677f, 0.8678055195451838f, 0.8819171036881968f, 0.8958064164776166f, 0.9094836413191612f, 0.9172076325837248f, 0.9229582069908971f, 0.9286731730990523f, 0.9343531843023135f, 0.9399988742535192f, 0.9456108576893002f, 0.9511897312113418f, 0.9567360740266436f, 0.9622504486493763f, 0.9677334015667416f, 0.9731854638710686f, 0.9786071518602129f, 0.9839989676081821f, 0.9893613995077727f, 0.9946949227868761f, 1}; - float b[] = { 0, 0.1028688999747279f, 0.1454785934906616f, 0.1781741612749496f, 0.2057377999494559f, 0.2300218531141181f, 0.2519763153394848f, 0.2721655269759087f, 0.2909571869813232f, 0.3086066999241838f, 0.3253000243161777f, 0.3411775438127727f, 0.3563483225498992f, 0.3708990935094579f, 0.3849001794597505f, 0.3984095364447979f, 0.4114755998989117f, 0.4241393401869012f, 0.4364357804719847f, 0.4483951394230328f, 0.4600437062282361f, 0.4714045207910317f, 0.4824979096371639f, 0.4933419132673033f, 0.5039526306789697f, 0.5143444998736397f, 0.5245305283129621f, 0.5345224838248488f, 0.5443310539518174f, 0.5539659798925444f, 0.563436169819011f, 0.5727497953228163f, 0.5819143739626463f, 0.5909368402852788f, 0.5998236072282915f, 0.6085806194501846f, 0.6172133998483676f, 0.6257270902992705f, 0.6341264874742278f, 0.642416074439621f, 0.6506000486323554f, 0.6586823467062358f, 0.6666666666666666f, 0.6745564876468501f, 0.6823550876255453f, 0.6900655593423541f, 0.6976908246297114f, 0.7052336473499384f, 0.7237468644557459f, 0.7453559924999298f, 0.7663560447348133f, 0.7867957924694432f, 0.8067178260046388f, 0.8261595987094034f, 0.8451542547285166f, 0.8637312927246217f, 0.8819171036881968f, 0.8997354108424372f, 0.9172076325837248f, 0.9343531843023135f, 0.9511897312113418f, 0.9677334015667416f, 0.9839989676081821f, 1}; + static const float r[] = { 0, 0.1571348402636772f, 0.2222222222222222f, 0.2721655269759087f, 0.3142696805273544f, 0.3513641844631533f, 0.3849001794597505f, 0.415739709641549f, 0.4444444444444444f, 0.4714045207910317f, 0.4969039949999532f, 0.5211573066470477f, 0.5443310539518174f, 0.5665577237325317f, 0.5879447357921312f, 0.6085806194501846f, 0.6285393610547089f, 0.6478835438717f, 0.6666666666666666f, 0.6849348892187751f, 0.7027283689263065f, 0.7200822998230956f, 0.7370277311900888f, 0.753592220347252f, 0.7663560447348133f, 0.7732293307186413f, 0.7800420555749596f, 0.7867957924694432f, 0.7934920476158722f, 0.8001322641986387f, 0.8067178260046388f, 0.8132500607904444f, 0.8197302434079591f, 0.8261595987094034f, 0.8325393042503717f, 0.8388704928078611f, 0.8451542547285166f, 0.8513916401208816f, 0.8575836609041332f, 0.8637312927246217f, 0.8698354767504924f, 0.8758971213537393f, 0.8819171036881968f, 0.8878962711712378f, 0.8938354428762595f, 0.8997354108424372f, 0.9055969413076769f, 0.9114207758701963f, 0.9172076325837248f, 0.9229582069908971f, 0.9286731730990523f, 0.9343531843023135f, 0.9399988742535192f, 0.9456108576893002f, 0.9511897312113418f, 0.9567360740266436f, 0.9622504486493763f, 0.9677334015667416f, 0.9731854638710686f, 0.9786071518602129f, 0.9839989676081821f, 0.9893613995077727f, 0.9946949227868761f, 1}; + static const float g[] = { 0, 0.1028688999747279f, 0.1454785934906616f, 0.1781741612749496f, 0.2057377999494559f, 0.2300218531141181f, 0.2519763153394848f, 0.2721655269759087f, 0.2909571869813232f, 0.3086066999241838f, 0.3253000243161777f, 0.3411775438127727f, 0.3563483225498992f, 0.3708990935094579f, 0.3849001794597505f, 0.3984095364447979f, 0.4114755998989117f, 0.4241393401869012f, 0.4364357804719847f, 0.4483951394230328f, 0.4600437062282361f, 0.4714045207910317f, 0.4824979096371639f, 0.4933419132673033f, 0.5091750772173156f, 0.5328701692569688f, 0.5555555555555556f, 0.5773502691896257f, 0.5983516452371671f, 0.6186404847588913f, 0.6382847385042254f, 0.6573421981221795f, 0.6758625033664688f, 0.6938886664887108f, 0.7114582486036499f, 0.7286042804780002f, 0.7453559924999299f, 0.7617394000445604f, 0.7777777777777778f, 0.7934920476158723f, 0.8089010988089465f, 0.8240220541217402f, 0.8388704928078611f, 0.8534606386520677f, 0.8678055195451838f, 0.8819171036881968f, 0.8958064164776166f, 0.9094836413191612f, 0.9172076325837248f, 0.9229582069908971f, 0.9286731730990523f, 0.9343531843023135f, 0.9399988742535192f, 0.9456108576893002f, 0.9511897312113418f, 0.9567360740266436f, 0.9622504486493763f, 0.9677334015667416f, 0.9731854638710686f, 0.9786071518602129f, 0.9839989676081821f, 0.9893613995077727f, 0.9946949227868761f, 1}; + static const float b[] = { 0, 0.1028688999747279f, 0.1454785934906616f, 0.1781741612749496f, 0.2057377999494559f, 0.2300218531141181f, 0.2519763153394848f, 0.2721655269759087f, 0.2909571869813232f, 0.3086066999241838f, 0.3253000243161777f, 0.3411775438127727f, 0.3563483225498992f, 0.3708990935094579f, 0.3849001794597505f, 0.3984095364447979f, 0.4114755998989117f, 0.4241393401869012f, 0.4364357804719847f, 0.4483951394230328f, 0.4600437062282361f, 0.4714045207910317f, 0.4824979096371639f, 0.4933419132673033f, 0.5039526306789697f, 0.5143444998736397f, 0.5245305283129621f, 0.5345224838248488f, 0.5443310539518174f, 0.5539659798925444f, 0.563436169819011f, 0.5727497953228163f, 0.5819143739626463f, 0.5909368402852788f, 0.5998236072282915f, 0.6085806194501846f, 0.6172133998483676f, 0.6257270902992705f, 0.6341264874742278f, 0.642416074439621f, 0.6506000486323554f, 0.6586823467062358f, 0.6666666666666666f, 0.6745564876468501f, 0.6823550876255453f, 0.6900655593423541f, 0.6976908246297114f, 0.7052336473499384f, 0.7237468644557459f, 0.7453559924999298f, 0.7663560447348133f, 0.7867957924694432f, 0.8067178260046388f, 0.8261595987094034f, 0.8451542547285166f, 0.8637312927246217f, 0.8819171036881968f, 0.8997354108424372f, 0.9172076325837248f, 0.9343531843023135f, 0.9511897312113418f, 0.9677334015667416f, 0.9839989676081821f, 1}; Mat X = linspace(0,1,64); this->_lut = ColorMap::linear_colormap(X, - Mat(64,1, CV_32FC1, r).clone(), // red - Mat(64,1, CV_32FC1, g).clone(), // green - Mat(64,1, CV_32FC1, b).clone(), // blue + Mat(64,1, CV_32FC1, (void*)r).clone(), // red + Mat(64,1, CV_32FC1, (void*)g).clone(), // green + Mat(64,1, CV_32FC1, (void*)b).clone(), // blue n); // number of sample points } }; @@ -454,14 +454,14 @@ namespace colormap } void init(int n) { - float r[] = { 0, 0.03968253968253968f, 0.07936507936507936f, 0.119047619047619f, 0.1587301587301587f, 0.1984126984126984f, 0.2380952380952381f, 0.2777777777777778f, 0.3174603174603174f, 0.3571428571428571f, 0.3968253968253968f, 0.4365079365079365f, 0.4761904761904762f, 0.5158730158730158f, 0.5555555555555556f, 0.5952380952380952f, 0.6349206349206349f, 0.6746031746031745f, 0.7142857142857142f, 0.753968253968254f, 0.7936507936507936f, 0.8333333333333333f, 0.873015873015873f, 0.9126984126984127f, 0.9523809523809523f, 0.992063492063492f, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - float g[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.03174603174603163f, 0.0714285714285714f, 0.1111111111111112f, 0.1507936507936507f, 0.1904761904761905f, 0.23015873015873f, 0.2698412698412698f, 0.3095238095238093f, 0.3492063492063491f, 0.3888888888888888f, 0.4285714285714284f, 0.4682539682539679f, 0.5079365079365079f, 0.5476190476190477f, 0.5873015873015872f, 0.6269841269841268f, 0.6666666666666665f, 0.7063492063492065f, 0.746031746031746f, 0.7857142857142856f, 0.8253968253968254f, 0.8650793650793651f, 0.9047619047619047f, 0.9444444444444442f, 0.984126984126984f, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - float b[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.04761904761904745f, 0.1269841269841265f, 0.2063492063492056f, 0.2857142857142856f, 0.3650793650793656f, 0.4444444444444446f, 0.5238095238095237f, 0.6031746031746028f, 0.6825396825396828f, 0.7619047619047619f, 0.8412698412698409f, 0.92063492063492f, 1}; + static const float r[] = { 0, 0.03968253968253968f, 0.07936507936507936f, 0.119047619047619f, 0.1587301587301587f, 0.1984126984126984f, 0.2380952380952381f, 0.2777777777777778f, 0.3174603174603174f, 0.3571428571428571f, 0.3968253968253968f, 0.4365079365079365f, 0.4761904761904762f, 0.5158730158730158f, 0.5555555555555556f, 0.5952380952380952f, 0.6349206349206349f, 0.6746031746031745f, 0.7142857142857142f, 0.753968253968254f, 0.7936507936507936f, 0.8333333333333333f, 0.873015873015873f, 0.9126984126984127f, 0.9523809523809523f, 0.992063492063492f, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + static const float g[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.03174603174603163f, 0.0714285714285714f, 0.1111111111111112f, 0.1507936507936507f, 0.1904761904761905f, 0.23015873015873f, 0.2698412698412698f, 0.3095238095238093f, 0.3492063492063491f, 0.3888888888888888f, 0.4285714285714284f, 0.4682539682539679f, 0.5079365079365079f, 0.5476190476190477f, 0.5873015873015872f, 0.6269841269841268f, 0.6666666666666665f, 0.7063492063492065f, 0.746031746031746f, 0.7857142857142856f, 0.8253968253968254f, 0.8650793650793651f, 0.9047619047619047f, 0.9444444444444442f, 0.984126984126984f, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + static const float b[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.04761904761904745f, 0.1269841269841265f, 0.2063492063492056f, 0.2857142857142856f, 0.3650793650793656f, 0.4444444444444446f, 0.5238095238095237f, 0.6031746031746028f, 0.6825396825396828f, 0.7619047619047619f, 0.8412698412698409f, 0.92063492063492f, 1}; Mat X = linspace(0,1,64); this->_lut = ColorMap::linear_colormap(X, - Mat(64,1, CV_32FC1, r).clone(), // red - Mat(64,1, CV_32FC1, g).clone(), // green - Mat(64,1, CV_32FC1, b).clone(), // blue + Mat(64,1, CV_32FC1, (void*)r).clone(), // red + Mat(64,1, CV_32FC1, (void*)g).clone(), // green + Mat(64,1, CV_32FC1, (void*)b).clone(), // blue n); // number of sample points } }; @@ -478,14 +478,14 @@ namespace colormap } void init(int n) { - float r[] = { 0.2078f, 0.0118f, 0.0784f, 0.0235f, 0.2196f, 0.5725f, 0.8510f, 0.9882f, 0.9765f }; - float g[] = { 0.1647f, 0.3882f, 0.5216f, 0.6549f, 0.7255f, 0.7490f, 0.7294f, 0.8078f, 0.9843f }; - float b[] = { 0.5294f, 0.8824f, 0.8314f, 0.7765f, 0.6196f, 0.4510f, 0.3373f, 0.1804f, 0.0549f }; + static const float r[] = { 0.2078f, 0.0118f, 0.0784f, 0.0235f, 0.2196f, 0.5725f, 0.8510f, 0.9882f, 0.9765f }; + static const float g[] = { 0.1647f, 0.3882f, 0.5216f, 0.6549f, 0.7255f, 0.7490f, 0.7294f, 0.8078f, 0.9843f }; + static const float b[] = { 0.5294f, 0.8824f, 0.8314f, 0.7765f, 0.6196f, 0.4510f, 0.3373f, 0.1804f, 0.0549f }; Mat X = linspace(0, 1, 9); this->_lut = ColorMap::linear_colormap(X, - Mat(9, 1, CV_32FC1, r).clone(), // red - Mat(9, 1, CV_32FC1, g).clone(), // green - Mat(9, 1, CV_32FC1, b).clone(), // blue + Mat(9, 1, CV_32FC1, (void*)r).clone(), // red + Mat(9, 1, CV_32FC1, (void*)g).clone(), // green + Mat(9, 1, CV_32FC1, (void*)b).clone(), // blue n); // number of sample points } }; diff --git a/modules/imgproc/src/connectedcomponents.cpp b/modules/imgproc/src/connectedcomponents.cpp index e0d91aef2b..4d882bf55c 100644 --- a/modules/imgproc/src/connectedcomponents.cpp +++ b/modules/imgproc/src/connectedcomponents.cpp @@ -283,8 +283,8 @@ namespace cv{ FirstScan8Connectivity& operator=(const FirstScan8Connectivity& ) { return *this; } - void operator()(const cv::Range& range) const{ - + void operator()(const cv::Range& range) const CV_OVERRIDE + { int r = range.start; chunksSizeAndLabels_[r] = range.end; @@ -385,8 +385,8 @@ namespace cv{ FirstScan4Connectivity& operator=(const FirstScan4Connectivity& ) { return *this; } - void operator()(const cv::Range& range) const{ - + void operator()(const cv::Range& range) const CV_OVERRIDE + { int r = range.start; chunksSizeAndLabels_[r] = range.end; @@ -462,8 +462,8 @@ namespace cv{ SecondScan& operator=(const SecondScan& ) { return *this; } - void operator()(const cv::Range& range) const{ - + void operator()(const cv::Range& range) const CV_OVERRIDE + { int r = range.start; const int rowBegin = r; const int rowEnd = range.end; @@ -839,8 +839,8 @@ namespace cv{ FirstScan& operator=(const FirstScan&) { return *this; } - void operator()(const cv::Range& range) const{ - + void operator()(const cv::Range& range) const CV_OVERRIDE + { int r = range.start; r += (r % 2); @@ -1907,8 +1907,8 @@ namespace cv{ SecondScan& operator=(const SecondScan& ) { return *this; } - void operator()(const cv::Range& range) const{ - + void operator()(const cv::Range& range) const CV_OVERRIDE + { int r = range.start; r += (r % 2); const int rowBegin = r; diff --git a/modules/imgproc/src/demosaicing.cpp b/modules/imgproc/src/demosaicing.cpp index 77885c53f8..05920d2150 100644 --- a/modules/imgproc/src/demosaicing.cpp +++ b/modules/imgproc/src/demosaicing.cpp @@ -555,7 +555,7 @@ public: { } - virtual void operator ()(const Range& range) const + virtual void operator ()(const Range& range) const CV_OVERRIDE { SIMDInterpolator vecOp; const int G2Y = 9617; @@ -714,7 +714,7 @@ public: { } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { SIMDInterpolator vecOp; T alpha = Alpha::value(); @@ -1520,7 +1520,7 @@ public: { } - virtual void operator()(const Range& range) const + virtual void operator()(const Range& range) const CV_OVERRIDE { int dcn = dst.channels(); int dcn2 = dcn<<1; diff --git a/modules/imgproc/src/distransform.cpp b/modules/imgproc/src/distransform.cpp index aba0a774c1..8e7774ae48 100644 --- a/modules/imgproc/src/distransform.cpp +++ b/modules/imgproc/src/distransform.cpp @@ -452,7 +452,7 @@ struct DTColumnInvoker : ParallelLoopBody sqr_tab = _sqr_tab; } - void operator()( const Range& range ) const + void operator()(const Range& range) const CV_OVERRIDE { int i, i1 = range.start, i2 = range.end; int m = src->rows; @@ -497,7 +497,7 @@ struct DTRowInvoker : ParallelLoopBody inv_tab = _inv_tab; } - void operator()( const Range& range ) const + void operator()(const Range& range) const CV_OVERRIDE { const float inf = 1e15f; int i, i1 = range.start, i2 = range.end; diff --git a/modules/imgproc/src/filter.cpp b/modules/imgproc/src/filter.cpp index 5f3ed517a5..5cbaf3f357 100644 --- a/modules/imgproc/src/filter.cpp +++ b/modules/imgproc/src/filter.cpp @@ -3054,7 +3054,7 @@ template struct RowFilter : public BaseRo vecOp = _vecOp; } - void operator()(const uchar* src, uchar* dst, int width, int cn) + void operator()(const uchar* src, uchar* dst, int width, int cn) CV_OVERRIDE { int _ksize = ksize; const DT* kx = kernel.ptr
(); @@ -3112,7 +3112,7 @@ template struct SymmRowSmallFilter : CV_Assert( (symmetryType & (KERNEL_SYMMETRICAL | KERNEL_ASYMMETRICAL)) != 0 && this->ksize <= 5 ); } - void operator()(const uchar* src, uchar* dst, int width, int cn) + void operator()(const uchar* src, uchar* dst, int width, int cn) CV_OVERRIDE { int ksize2 = this->ksize/2, ksize2n = ksize2*cn; const DT* kx = this->kernel.template ptr
() + ksize2; @@ -3251,7 +3251,7 @@ template struct ColumnFilter : public BaseColumnFilte (kernel.rows == 1 || kernel.cols == 1)); } - void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) + void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) CV_OVERRIDE { const ST* ky = kernel.template ptr(); ST _delta = delta; @@ -3314,7 +3314,7 @@ template struct SymmColumnFilter : public ColumnFilte CV_Assert( (symmetryType & (KERNEL_SYMMETRICAL | KERNEL_ASYMMETRICAL)) != 0 ); } - void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) + void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) CV_OVERRIDE { int ksize2 = this->ksize/2; const ST* ky = this->kernel.template ptr() + ksize2; @@ -3420,7 +3420,7 @@ struct SymmColumnSmallFilter : public SymmColumnFilter CV_Assert( this->ksize == 3 ); } - void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) + void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) CV_OVERRIDE { int ksize2 = this->ksize/2; const ST* ky = this->kernel.template ptr() + ksize2; @@ -3889,7 +3889,7 @@ template struct Filter2D : public BaseFi ptrs.resize( coords.size() ); } - void operator()(const uchar** src, uchar* dst, int dststep, int count, int width, int cn) + void operator()(const uchar** src, uchar* dst, int dststep, int count, int width, int cn) CV_OVERRIDE { KT _delta = delta; const Point* pt = &coords[0]; @@ -4628,8 +4628,9 @@ static bool ippFilter2D(int stype, int dtype, int kernel_type, CV_INSTRUMENT_FUN_IPP(::ipp::iwiFilter, iwSrc, iwDst, iwKernel, ::ipp::IwiFilterParams(1, 0, ippAlgHintNone, ippRndFinancial), iwBorderType); } - catch(::ipp::IwException ex) + catch(const ::ipp::IwException& ex) { + CV_UNUSED(ex); return false; } diff --git a/modules/imgproc/src/generalized_hough.cpp b/modules/imgproc/src/generalized_hough.cpp index 4bdcaed719..027e67a77e 100644 --- a/modules/imgproc/src/generalized_hough.cpp +++ b/modules/imgproc/src/generalized_hough.cpp @@ -326,41 +326,41 @@ namespace namespace { - class GeneralizedHoughBallardImpl : public GeneralizedHoughBallard, private GeneralizedHoughBase + class GeneralizedHoughBallardImpl CV_FINAL : public GeneralizedHoughBallard, private GeneralizedHoughBase { public: GeneralizedHoughBallardImpl(); - void setTemplate(InputArray templ, Point templCenter) { setTemplateImpl(templ, templCenter); } - void setTemplate(InputArray edges, InputArray dx, InputArray dy, Point templCenter) { setTemplateImpl(edges, dx, dy, templCenter); } + void setTemplate(InputArray templ, Point templCenter) CV_OVERRIDE { setTemplateImpl(templ, templCenter); } + void setTemplate(InputArray edges, InputArray dx, InputArray dy, Point templCenter) CV_OVERRIDE { setTemplateImpl(edges, dx, dy, templCenter); } - void detect(InputArray image, OutputArray positions, OutputArray votes) { detectImpl(image, positions, votes); } - void detect(InputArray edges, InputArray dx, InputArray dy, OutputArray positions, OutputArray votes) { detectImpl(edges, dx, dy, positions, votes); } + void detect(InputArray image, OutputArray positions, OutputArray votes) CV_OVERRIDE { detectImpl(image, positions, votes); } + void detect(InputArray edges, InputArray dx, InputArray dy, OutputArray positions, OutputArray votes) CV_OVERRIDE { detectImpl(edges, dx, dy, positions, votes); } - void setCannyLowThresh(int cannyLowThresh) { cannyLowThresh_ = cannyLowThresh; } - int getCannyLowThresh() const { return cannyLowThresh_; } + void setCannyLowThresh(int cannyLowThresh) CV_OVERRIDE { cannyLowThresh_ = cannyLowThresh; } + int getCannyLowThresh() const CV_OVERRIDE { return cannyLowThresh_; } - void setCannyHighThresh(int cannyHighThresh) { cannyHighThresh_ = cannyHighThresh; } - int getCannyHighThresh() const { return cannyHighThresh_; } + void setCannyHighThresh(int cannyHighThresh) CV_OVERRIDE { cannyHighThresh_ = cannyHighThresh; } + int getCannyHighThresh() const CV_OVERRIDE { return cannyHighThresh_; } - void setMinDist(double minDist) { minDist_ = minDist; } - double getMinDist() const { return minDist_; } + void setMinDist(double minDist) CV_OVERRIDE { minDist_ = minDist; } + double getMinDist() const CV_OVERRIDE { return minDist_; } - void setDp(double dp) { dp_ = dp; } - double getDp() const { return dp_; } + void setDp(double dp) CV_OVERRIDE { dp_ = dp; } + double getDp() const CV_OVERRIDE { return dp_; } - void setMaxBufferSize(int) { } - int getMaxBufferSize() const { return 0; } + void setMaxBufferSize(int) CV_OVERRIDE { } + int getMaxBufferSize() const CV_OVERRIDE { return 0; } - void setLevels(int levels) { levels_ = levels; } - int getLevels() const { return levels_; } + void setLevels(int levels) CV_OVERRIDE { levels_ = levels; } + int getLevels() const CV_OVERRIDE { return levels_; } - void setVotesThreshold(int votesThreshold) { votesThreshold_ = votesThreshold; } - int getVotesThreshold() const { return votesThreshold_; } + void setVotesThreshold(int votesThreshold) CV_OVERRIDE { votesThreshold_ = votesThreshold; } + int getVotesThreshold() const CV_OVERRIDE { return votesThreshold_; } private: - void processTempl(); - void processImage(); + void processTempl() CV_OVERRIDE; + void processImage() CV_OVERRIDE; void calcHist(); void findPosInHist(); @@ -504,71 +504,71 @@ Ptr cv::createGeneralizedHoughBallard() namespace { - class GeneralizedHoughGuilImpl : public GeneralizedHoughGuil, private GeneralizedHoughBase + class GeneralizedHoughGuilImpl CV_FINAL : public GeneralizedHoughGuil, private GeneralizedHoughBase { public: GeneralizedHoughGuilImpl(); - void setTemplate(InputArray templ, Point templCenter) { setTemplateImpl(templ, templCenter); } - void setTemplate(InputArray edges, InputArray dx, InputArray dy, Point templCenter) { setTemplateImpl(edges, dx, dy, templCenter); } + void setTemplate(InputArray templ, Point templCenter) CV_OVERRIDE { setTemplateImpl(templ, templCenter); } + void setTemplate(InputArray edges, InputArray dx, InputArray dy, Point templCenter) CV_OVERRIDE { setTemplateImpl(edges, dx, dy, templCenter); } - void detect(InputArray image, OutputArray positions, OutputArray votes) { detectImpl(image, positions, votes); } - void detect(InputArray edges, InputArray dx, InputArray dy, OutputArray positions, OutputArray votes) { detectImpl(edges, dx, dy, positions, votes); } + void detect(InputArray image, OutputArray positions, OutputArray votes) CV_OVERRIDE { detectImpl(image, positions, votes); } + void detect(InputArray edges, InputArray dx, InputArray dy, OutputArray positions, OutputArray votes) CV_OVERRIDE { detectImpl(edges, dx, dy, positions, votes); } - void setCannyLowThresh(int cannyLowThresh) { cannyLowThresh_ = cannyLowThresh; } - int getCannyLowThresh() const { return cannyLowThresh_; } + void setCannyLowThresh(int cannyLowThresh) CV_OVERRIDE { cannyLowThresh_ = cannyLowThresh; } + int getCannyLowThresh() const CV_OVERRIDE { return cannyLowThresh_; } - void setCannyHighThresh(int cannyHighThresh) { cannyHighThresh_ = cannyHighThresh; } - int getCannyHighThresh() const { return cannyHighThresh_; } + void setCannyHighThresh(int cannyHighThresh) CV_OVERRIDE { cannyHighThresh_ = cannyHighThresh; } + int getCannyHighThresh() const CV_OVERRIDE { return cannyHighThresh_; } - void setMinDist(double minDist) { minDist_ = minDist; } - double getMinDist() const { return minDist_; } + void setMinDist(double minDist) CV_OVERRIDE { minDist_ = minDist; } + double getMinDist() const CV_OVERRIDE { return minDist_; } - void setDp(double dp) { dp_ = dp; } - double getDp() const { return dp_; } + void setDp(double dp) CV_OVERRIDE { dp_ = dp; } + double getDp() const CV_OVERRIDE { return dp_; } - void setMaxBufferSize(int maxBufferSize) { maxBufferSize_ = maxBufferSize; } - int getMaxBufferSize() const { return maxBufferSize_; } + void setMaxBufferSize(int maxBufferSize) CV_OVERRIDE { maxBufferSize_ = maxBufferSize; } + int getMaxBufferSize() const CV_OVERRIDE { return maxBufferSize_; } - void setXi(double xi) { xi_ = xi; } - double getXi() const { return xi_; } + void setXi(double xi) CV_OVERRIDE { xi_ = xi; } + double getXi() const CV_OVERRIDE { return xi_; } - void setLevels(int levels) { levels_ = levels; } - int getLevels() const { return levels_; } + void setLevels(int levels) CV_OVERRIDE { levels_ = levels; } + int getLevels() const CV_OVERRIDE { return levels_; } - void setAngleEpsilon(double angleEpsilon) { angleEpsilon_ = angleEpsilon; } - double getAngleEpsilon() const { return angleEpsilon_; } + void setAngleEpsilon(double angleEpsilon) CV_OVERRIDE { angleEpsilon_ = angleEpsilon; } + double getAngleEpsilon() const CV_OVERRIDE { return angleEpsilon_; } - void setMinAngle(double minAngle) { minAngle_ = minAngle; } - double getMinAngle() const { return minAngle_; } + void setMinAngle(double minAngle) CV_OVERRIDE { minAngle_ = minAngle; } + double getMinAngle() const CV_OVERRIDE { return minAngle_; } - void setMaxAngle(double maxAngle) { maxAngle_ = maxAngle; } - double getMaxAngle() const { return maxAngle_; } + void setMaxAngle(double maxAngle) CV_OVERRIDE { maxAngle_ = maxAngle; } + double getMaxAngle() const CV_OVERRIDE { return maxAngle_; } - void setAngleStep(double angleStep) { angleStep_ = angleStep; } - double getAngleStep() const { return angleStep_; } + void setAngleStep(double angleStep) CV_OVERRIDE { angleStep_ = angleStep; } + double getAngleStep() const CV_OVERRIDE { return angleStep_; } - void setAngleThresh(int angleThresh) { angleThresh_ = angleThresh; } - int getAngleThresh() const { return angleThresh_; } + void setAngleThresh(int angleThresh) CV_OVERRIDE { angleThresh_ = angleThresh; } + int getAngleThresh() const CV_OVERRIDE { return angleThresh_; } - void setMinScale(double minScale) { minScale_ = minScale; } - double getMinScale() const { return minScale_; } + void setMinScale(double minScale) CV_OVERRIDE { minScale_ = minScale; } + double getMinScale() const CV_OVERRIDE { return minScale_; } - void setMaxScale(double maxScale) { maxScale_ = maxScale; } - double getMaxScale() const { return maxScale_; } + void setMaxScale(double maxScale) CV_OVERRIDE { maxScale_ = maxScale; } + double getMaxScale() const CV_OVERRIDE { return maxScale_; } - void setScaleStep(double scaleStep) { scaleStep_ = scaleStep; } - double getScaleStep() const { return scaleStep_; } + void setScaleStep(double scaleStep) CV_OVERRIDE { scaleStep_ = scaleStep; } + double getScaleStep() const CV_OVERRIDE { return scaleStep_; } - void setScaleThresh(int scaleThresh) { scaleThresh_ = scaleThresh; } - int getScaleThresh() const { return scaleThresh_; } + void setScaleThresh(int scaleThresh) CV_OVERRIDE { scaleThresh_ = scaleThresh; } + int getScaleThresh() const CV_OVERRIDE { return scaleThresh_; } - void setPosThresh(int posThresh) { posThresh_ = posThresh; } - int getPosThresh() const { return posThresh_; } + void setPosThresh(int posThresh) CV_OVERRIDE { posThresh_ = posThresh; } + int getPosThresh() const CV_OVERRIDE { return posThresh_; } private: - void processTempl(); - void processImage(); + void processTempl() CV_OVERRIDE; + void processImage() CV_OVERRIDE; int maxBufferSize_; double xi_; diff --git a/modules/imgproc/src/histogram.cpp b/modules/imgproc/src/histogram.cpp index 038bc5589f..fdc6c08f3f 100644 --- a/modules/imgproc/src/histogram.cpp +++ b/modules/imgproc/src/histogram.cpp @@ -1243,7 +1243,7 @@ public: hist.setTo(0); } - virtual void operator() (const Range & range) const + virtual void operator() (const Range & range) const CV_OVERRIDE { CV_INSTRUMENT_REGION_IPP() @@ -3700,7 +3700,7 @@ public: : src_(src), globalHistogram_(histogram), histogramLock_(histogramLock) { } - void operator()( const cv::Range& rowRange ) const + void operator()( const cv::Range& rowRange ) const CV_OVERRIDE { int localHistogram[HIST_SZ] = {0, }; @@ -3758,7 +3758,7 @@ public: lut_(lut) { } - void operator()( const cv::Range& rowRange ) const + void operator()( const cv::Range& rowRange ) const CV_OVERRIDE { const size_t sstep = src_.step; const size_t dstep = dst_.step; diff --git a/modules/imgproc/src/hough.cpp b/modules/imgproc/src/hough.cpp index 2e4a582627..1266724cbe 100644 --- a/modules/imgproc/src/hough.cpp +++ b/modules/imgproc/src/hough.cpp @@ -1077,7 +1077,7 @@ public: ~HoughCirclesAccumInvoker() { } - void operator()(const Range &boundaries) const + void operator()(const Range &boundaries) const CV_OVERRIDE { Mat accumLocal = Mat(arows + 2, acols + 2, CV_32SC1, Scalar::all(0)); int *adataLocal = accumLocal.ptr(); @@ -1217,7 +1217,7 @@ public: ~HoughCirclesFindCentersInvoker() {} - void operator()(const Range &boundaries) const + void operator()(const Range &boundaries) const CV_OVERRIDE { int startRow = boundaries.start; int endRow = boundaries.end; @@ -1334,7 +1334,7 @@ public: protected: inline int filterCircles(const Point2f& curCenter, float* ddata) const; - void operator()(const Range &boundaries) const + void operator()(const Range &boundaries) const CV_OVERRIDE { std::vector circlesLocal; const int nBinsPerDr = 10; diff --git a/modules/imgproc/src/imgwarp.cpp b/modules/imgproc/src/imgwarp.cpp index 9a530c4a6c..d793616cfc 100644 --- a/modules/imgproc/src/imgwarp.cpp +++ b/modules/imgproc/src/imgwarp.cpp @@ -1084,7 +1084,7 @@ public: { } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { int x, y, x1, y1; const int buf_size = 1 << 14; @@ -2232,7 +2232,7 @@ public: { } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { const int BLOCK_SZ = 64; short XY[BLOCK_SZ*BLOCK_SZ*2], A[BLOCK_SZ*BLOCK_SZ]; @@ -2408,7 +2408,7 @@ public: *ok = true; } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { IppiSize srcsize = { src.cols, src.rows }; IppiRect srcroi = { 0, 0, src.cols, src.rows }; @@ -2800,7 +2800,7 @@ public: #endif } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { const int BLOCK_SZ = 32; short XY[BLOCK_SZ*BLOCK_SZ*2], A[BLOCK_SZ*BLOCK_SZ]; @@ -2916,7 +2916,7 @@ public: *ok = true; } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { IppiSize srcsize = {src.cols, src.rows}; IppiRect srcroi = {0, 0, src.cols, src.rows}; diff --git a/modules/imgproc/src/imgwarp.sse4_1.cpp b/modules/imgproc/src/imgwarp.sse4_1.cpp index c25967fcc9..5625b45f7b 100644 --- a/modules/imgproc/src/imgwarp.sse4_1.cpp +++ b/modules/imgproc/src/imgwarp.sse4_1.cpp @@ -209,14 +209,14 @@ void WarpAffineInvoker_Blockline_SSE41(int *adelta, int *bdelta, short* xy, int } -class WarpPerspectiveLine_SSE4_Impl: public WarpPerspectiveLine_SSE4 +class WarpPerspectiveLine_SSE4_Impl CV_FINAL : public WarpPerspectiveLine_SSE4 { public: WarpPerspectiveLine_SSE4_Impl(const double *M) { CV_UNUSED(M); } - virtual void processNN(const double *M, short* xy, double X0, double Y0, double W0, int bw) + virtual void processNN(const double *M, short* xy, double X0, double Y0, double W0, int bw) CV_OVERRIDE { const __m128d v_M0 = _mm_set1_pd(M[0]); const __m128d v_M3 = _mm_set1_pd(M[3]); @@ -346,7 +346,7 @@ public: xy[x1 * 2 + 1] = saturate_cast(Y); } } - virtual void process(const double *M, short* xy, short* alpha, double X0, double Y0, double W0, int bw) + virtual void process(const double *M, short* xy, short* alpha, double X0, double Y0, double W0, int bw) CV_OVERRIDE { const __m128d v_M0 = _mm_set1_pd(M[0]); const __m128d v_M3 = _mm_set1_pd(M[3]); @@ -492,7 +492,7 @@ public: (X & (INTER_TAB_SIZE - 1))); } } - virtual ~WarpPerspectiveLine_SSE4_Impl() {}; + virtual ~WarpPerspectiveLine_SSE4_Impl() CV_OVERRIDE {}; }; Ptr WarpPerspectiveLine_SSE4::getImpl(const double *M) diff --git a/modules/imgproc/src/lsd.cpp b/modules/imgproc/src/lsd.cpp index c63fb9b937..a17a8f2f20 100644 --- a/modules/imgproc/src/lsd.cpp +++ b/modules/imgproc/src/lsd.cpp @@ -160,7 +160,7 @@ inline double log_gamma_lanczos(const double& x) namespace cv{ -class LineSegmentDetectorImpl : public LineSegmentDetector +class LineSegmentDetectorImpl CV_FINAL : public LineSegmentDetector { public: @@ -205,7 +205,7 @@ public: */ void detect(InputArray _image, OutputArray _lines, OutputArray width = noArray(), OutputArray prec = noArray(), - OutputArray nfa = noArray()); + OutputArray nfa = noArray()) CV_OVERRIDE; /** * Draw lines on the given canvas. @@ -214,7 +214,7 @@ public: * Should have the size of the image, where the lines were found * @param lines The lines that need to be drawn */ - void drawSegments(InputOutputArray _image, InputArray lines); + void drawSegments(InputOutputArray _image, InputArray lines) CV_OVERRIDE; /** * Draw both vectors on the image canvas. Uses blue for lines 1 and red for lines 2. @@ -226,7 +226,7 @@ public: * Should have the size of the image, where the lines were found * @return The number of mismatching pixels between lines1 and lines2. */ - int compareSegments(const Size& size, InputArray lines1, InputArray lines2, InputOutputArray _image = noArray()); + int compareSegments(const Size& size, InputArray lines1, InputArray lines2, InputOutputArray _image = noArray()) CV_OVERRIDE; private: Mat image; diff --git a/modules/imgproc/src/morph.cpp b/modules/imgproc/src/morph.cpp index 27c7db7c72..73e447189b 100644 --- a/modules/imgproc/src/morph.cpp +++ b/modules/imgproc/src/morph.cpp @@ -637,7 +637,7 @@ template struct MorphRowFilter : public BaseRowFilter anchor = _anchor; } - void operator()(const uchar* src, uchar* dst, int width, int cn) + void operator()(const uchar* src, uchar* dst, int width, int cn) CV_OVERRIDE { int i, j, k, _ksize = ksize*cn; const T* S = (const T*)src; @@ -691,7 +691,7 @@ template struct MorphColumnFilter : public BaseColumnFilt anchor = _anchor; } - void operator()(const uchar** _src, uchar* dst, int dststep, int count, int width) + void operator()(const uchar** _src, uchar* dst, int dststep, int count, int width) CV_OVERRIDE { int i, k, _ksize = ksize; const T** src = (const T**)_src; @@ -792,7 +792,7 @@ template struct MorphFilter : BaseFilter ptrs.resize( coords.size() ); } - void operator()(const uchar** src, uchar* dst, int dststep, int count, int width, int cn) + void operator()(const uchar** src, uchar* dst, int dststep, int count, int width, int cn) CV_OVERRIDE { const Point* pt = &coords[0]; const T** kp = (const T**)&ptrs[0]; diff --git a/modules/imgproc/src/resize.avx2.cpp b/modules/imgproc/src/resize.avx2.cpp index 0d934da169..cf568878eb 100644 --- a/modules/imgproc/src/resize.avx2.cpp +++ b/modules/imgproc/src/resize.avx2.cpp @@ -55,7 +55,7 @@ namespace cv namespace opt_AVX2 { -class resizeNNInvokerAVX4 : +class resizeNNInvokerAVX4 CV_FINAL : public ParallelLoopBody { public: @@ -68,7 +68,7 @@ public: #if defined(__INTEL_COMPILER) #pragma optimization_parameter target_arch=AVX #endif - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { Size ssize = src.size(), dsize = dst.size(); int y, x; @@ -138,7 +138,7 @@ private: resizeNNInvokerAVX4& operator=(const resizeNNInvokerAVX4&); }; -class resizeNNInvokerAVX2 : +class resizeNNInvokerAVX2 CV_FINAL : public ParallelLoopBody { public: @@ -151,7 +151,7 @@ public: #if defined(__INTEL_COMPILER) #pragma optimization_parameter target_arch=AVX #endif - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { Size ssize = src.size(), dsize = dst.size(); int y, x; diff --git a/modules/imgproc/src/resize.cpp b/modules/imgproc/src/resize.cpp index fb0de06273..211642c48d 100644 --- a/modules/imgproc/src/resize.cpp +++ b/modules/imgproc/src/resize.cpp @@ -675,7 +675,7 @@ public: cn(_cn), xoffsets(_xoffsets), yoffsets(_yoffsets), xcoeffs(_xcoeffs), ycoeffs(_ycoeffs), min_x(_min_x), max_x(_max_x), min_y(_min_y), max_y(_max_y), hResize(_hResize) {} - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { AutoBuffer linebuf(interp_y_len * dst_width * cn); int last_eval = - interp_y_len; @@ -859,7 +859,7 @@ public: { } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { Size ssize = src.size(), dsize = dst.size(); int y, x, pix_size = (int)src.elemSize(); @@ -2211,7 +2211,7 @@ public: CV_Assert(ksize <= MAX_ESIZE); } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { int dy, cn = src.channels(); HResize hresize; @@ -2921,7 +2921,7 @@ public: { } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { Size ssize = src.size(), dsize = dst.size(); int cn = src.channels(); @@ -3031,7 +3031,7 @@ public: tabofs = _tabofs; } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { Size dsize = dst->size(); int cn = dst->channels(); @@ -3489,7 +3489,7 @@ public: m_ok = true; } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { CV_INSTRUMENT_REGION_IPP() @@ -3539,7 +3539,7 @@ public: m_ok = true; } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { CV_INSTRUMENT_REGION_IPP() diff --git a/modules/imgproc/src/resize.sse4_1.cpp b/modules/imgproc/src/resize.sse4_1.cpp index edcefcb9e7..0563031477 100644 --- a/modules/imgproc/src/resize.sse4_1.cpp +++ b/modules/imgproc/src/resize.sse4_1.cpp @@ -68,7 +68,7 @@ public: #if defined(__INTEL_COMPILER) #pragma optimization_parameter target_arch=SSE4.2 #endif - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { Size ssize = src.size(), dsize = dst.size(); int y, x; @@ -131,7 +131,7 @@ public: #if defined(__INTEL_COMPILER) #pragma optimization_parameter target_arch=SSE4.2 #endif - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { Size ssize = src.size(), dsize = dst.size(); int y, x; diff --git a/modules/imgproc/src/smooth.cpp b/modules/imgproc/src/smooth.cpp index aa1bd623d5..72876d6332 100644 --- a/modules/imgproc/src/smooth.cpp +++ b/modules/imgproc/src/smooth.cpp @@ -88,7 +88,7 @@ struct RowSum : anchor = _anchor; } - virtual void operator()(const uchar* src, uchar* dst, int width, int cn) + virtual void operator()(const uchar* src, uchar* dst, int width, int cn) CV_OVERRIDE { const T* S = (const T*)src; ST* D = (ST*)dst; @@ -199,9 +199,9 @@ struct ColumnSum : sumCount = 0; } - virtual void reset() { sumCount = 0; } + virtual void reset() CV_OVERRIDE { sumCount = 0; } - virtual void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) + virtual void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) CV_OVERRIDE { int i; ST* SUM; @@ -297,9 +297,9 @@ struct ColumnSum : sumCount = 0; } - virtual void reset() { sumCount = 0; } + virtual void reset() CV_OVERRIDE { sumCount = 0; } - virtual void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) + virtual void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) CV_OVERRIDE { int* SUM; bool haveScale = scale != 1; @@ -444,9 +444,9 @@ public BaseColumnFilter } } - virtual void reset() { sumCount = 0; } + virtual void reset() CV_OVERRIDE { sumCount = 0; } - virtual void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) + virtual void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) CV_OVERRIDE { const int ds = divScale; const int dd = divDelta; @@ -573,9 +573,9 @@ struct ColumnSum : sumCount = 0; } - virtual void reset() { sumCount = 0; } + virtual void reset() CV_OVERRIDE { sumCount = 0; } - virtual void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) + virtual void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) CV_OVERRIDE { int i; int* SUM; @@ -701,9 +701,9 @@ struct ColumnSum : sumCount = 0; } - virtual void reset() { sumCount = 0; } + virtual void reset() CV_OVERRIDE { sumCount = 0; } - virtual void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) + virtual void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) CV_OVERRIDE { int* SUM; bool haveScale = scale != 1; @@ -826,9 +826,9 @@ struct ColumnSum : sumCount = 0; } - virtual void reset() { sumCount = 0; } + virtual void reset() CV_OVERRIDE { sumCount = 0; } - virtual void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) + virtual void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) CV_OVERRIDE { int* SUM; bool haveScale = scale != 1; @@ -945,9 +945,9 @@ struct ColumnSum : sumCount = 0; } - virtual void reset() { sumCount = 0; } + virtual void reset() CV_OVERRIDE { sumCount = 0; } - virtual void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) + virtual void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) CV_OVERRIDE { int* SUM; bool haveScale = scale != 1; @@ -1606,7 +1606,7 @@ struct SqrRowSum : anchor = _anchor; } - virtual void operator()(const uchar* src, uchar* dst, int width, int cn) + virtual void operator()(const uchar* src, uchar* dst, int width, int cn) CV_OVERRIDE { const T* S = (const T*)src; ST* D = (ST*)dst; @@ -2979,7 +2979,7 @@ public: else vlineSmoothFunc = vlineSmooth; } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { AutoBuffer _buf(width*cn*kylen); FT* buf = _buf; @@ -3384,7 +3384,7 @@ public: { } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { CV_INSTRUMENT_REGION_IPP() @@ -4632,7 +4632,7 @@ public: { } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { int i, j, cn = dest->channels(), k; Size size = dest->size(); @@ -4970,7 +4970,7 @@ public: { } - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { int i, j, k; Size size = dest->size(); @@ -5263,7 +5263,7 @@ public: } ~ipp_bilateralFilterParallel() {} - virtual void operator() (const Range& range) const + virtual void operator() (const Range& range) const CV_OVERRIDE { if(*pOk == false) return; diff --git a/modules/imgproc/src/thresh.cpp b/modules/imgproc/src/thresh.cpp index b25c495f42..520a9c8fe9 100644 --- a/modules/imgproc/src/thresh.cpp +++ b/modules/imgproc/src/thresh.cpp @@ -1206,7 +1206,7 @@ public: thresholdType = _thresholdType; } - void operator () ( const Range& range ) const + void operator () (const Range& range) const CV_OVERRIDE { int row0 = range.start; int row1 = range.end; diff --git a/modules/imgproc/src/undistort.cpp b/modules/imgproc/src/undistort.cpp index e8d38d75fc..a10561d102 100644 --- a/modules/imgproc/src/undistort.cpp +++ b/modules/imgproc/src/undistort.cpp @@ -98,7 +98,7 @@ public: #endif } - 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/ml/include/opencv2/ml.hpp b/modules/ml/include/opencv2/ml.hpp index aa25db961a..31e7427735 100644 --- a/modules/ml/include/opencv2/ml.hpp +++ b/modules/ml/include/opencv2/ml.hpp @@ -318,7 +318,7 @@ public: /** @brief Returns the number of variables in training samples */ CV_WRAP virtual int getVarCount() const = 0; - CV_WRAP virtual bool empty() const; + CV_WRAP virtual bool empty() const CV_OVERRIDE; /** @brief Returns true if the model is trained */ CV_WRAP virtual bool isTrained() const = 0; @@ -894,7 +894,7 @@ public: posterior probabilities for each sample from the input @param flags This parameter will be ignored */ - CV_WRAP virtual float predict( InputArray samples, OutputArray results=noArray(), int flags=0 ) const = 0; + CV_WRAP virtual float predict( InputArray samples, OutputArray results=noArray(), int flags=0 ) const CV_OVERRIDE = 0; /** @brief Returns a likelihood logarithm value and an index of the most probable mixture component for the given sample. @@ -1656,7 +1656,7 @@ public: @param results Predicted labels as a column matrix of type CV_32S. @param flags Not used. */ - CV_WRAP virtual float predict( InputArray samples, OutputArray results=noArray(), int flags=0 ) const = 0; + CV_WRAP virtual float predict( InputArray samples, OutputArray results=noArray(), int flags=0 ) const CV_OVERRIDE = 0; /** @brief This function returns the trained parameters arranged across rows. diff --git a/modules/ml/src/ann_mlp.cpp b/modules/ml/src/ann_mlp.cpp index 22bacb34e5..156a0440ba 100644 --- a/modules/ml/src/ann_mlp.cpp +++ b/modules/ml/src/ann_mlp.cpp @@ -213,7 +213,7 @@ void ANN_MLP::setAnnealEnergyRNG(const RNG& rng) this_->setAnnealEnergyRNG(rng); } -class ANN_MLPImpl : public ANN_MLP_ANNEAL +class ANN_MLPImpl CV_FINAL : public ANN_MLP_ANNEAL { public: ANN_MLPImpl() @@ -226,23 +226,34 @@ public: virtual ~ANN_MLPImpl() {} - CV_IMPL_PROPERTY(TermCriteria, TermCriteria, params.termCrit) - CV_IMPL_PROPERTY(double, BackpropWeightScale, params.bpDWScale) - CV_IMPL_PROPERTY(double, BackpropMomentumScale, params.bpMomentScale) - CV_IMPL_PROPERTY(double, RpropDW0, params.rpDW0) - CV_IMPL_PROPERTY(double, RpropDWPlus, params.rpDWPlus) - CV_IMPL_PROPERTY(double, RpropDWMinus, params.rpDWMinus) - CV_IMPL_PROPERTY(double, RpropDWMin, params.rpDWMin) - CV_IMPL_PROPERTY(double, RpropDWMax, params.rpDWMax) - CV_IMPL_PROPERTY(double, AnnealInitialT, params.initialT) - CV_IMPL_PROPERTY(double, AnnealFinalT, params.finalT) - CV_IMPL_PROPERTY(double, AnnealCoolingRatio, params.coolingRatio) - CV_IMPL_PROPERTY(int, AnnealItePerStep, params.itePerStep) + inline TermCriteria getTermCriteria() const CV_OVERRIDE { return params.termCrit; } + inline void setTermCriteria(TermCriteria val) CV_OVERRIDE { params.termCrit = val; } + inline double getBackpropWeightScale() const CV_OVERRIDE { return params.bpDWScale; } + inline void setBackpropWeightScale(double val) CV_OVERRIDE { params.bpDWScale = val; } + inline double getBackpropMomentumScale() const CV_OVERRIDE { return params.bpMomentScale; } + inline void setBackpropMomentumScale(double val) CV_OVERRIDE { params.bpMomentScale = val; } + inline double getRpropDW0() const CV_OVERRIDE { return params.rpDW0; } + inline void setRpropDW0(double val) CV_OVERRIDE { params.rpDW0 = val; } + inline double getRpropDWPlus() const CV_OVERRIDE { return params.rpDWPlus; } + inline void setRpropDWPlus(double val) CV_OVERRIDE { params.rpDWPlus = val; } + inline double getRpropDWMinus() const CV_OVERRIDE { return params.rpDWMinus; } + inline void setRpropDWMinus(double val) CV_OVERRIDE { params.rpDWMinus = val; } + inline double getRpropDWMin() const CV_OVERRIDE { return params.rpDWMin; } + inline void setRpropDWMin(double val) CV_OVERRIDE { params.rpDWMin = val; } + inline double getRpropDWMax() const CV_OVERRIDE { return params.rpDWMax; } + inline void setRpropDWMax(double val) CV_OVERRIDE { params.rpDWMax = val; } + inline double getAnnealInitialT() const CV_OVERRIDE { return params.initialT; } + inline void setAnnealInitialT(double val) CV_OVERRIDE { params.initialT = val; } + inline double getAnnealFinalT() const CV_OVERRIDE { return params.finalT; } + inline void setAnnealFinalT(double val) CV_OVERRIDE { params.finalT = val; } + inline double getAnnealCoolingRatio() const CV_OVERRIDE { return params.coolingRatio; } + inline void setAnnealCoolingRatio(double val) CV_OVERRIDE { params.coolingRatio = val; } + inline int getAnnealItePerStep() const CV_OVERRIDE { return params.itePerStep; } + inline void setAnnealItePerStep(int val) CV_OVERRIDE { params.itePerStep = val; } + // disabled getAnnealEnergyRNG() + inline void setAnnealEnergyRNG(const RNG& val) CV_OVERRIDE { params.rEnergy = val; } - //CV_IMPL_PROPERTY(RNG, AnnealEnergyRNG, params.rEnergy) - inline void setAnnealEnergyRNG(const RNG& val) { params.rEnergy = val; } - - void clear() + void clear() CV_OVERRIDE { min_val = max_val = min_val1 = max_val1 = 0.; rng = RNG((uint64)-1); @@ -253,7 +264,7 @@ public: int layer_count() const { return (int)layer_sizes.size(); } - void setTrainMethod(int method, double param1, double param2) + void setTrainMethod(int method, double param1, double param2) CV_OVERRIDE { if (method != ANN_MLP::RPROP && method != ANN_MLP::BACKPROP && method != ANN_MLP::ANNEAL) method = ANN_MLP::RPROP; @@ -276,12 +287,12 @@ public: } } - int getTrainMethod() const + int getTrainMethod() const CV_OVERRIDE { return params.trainMethod; } - void setActivationFunction(int _activ_func, double _f_param1, double _f_param2) + void setActivationFunction(int _activ_func, double _f_param1, double _f_param2) CV_OVERRIDE { if( _activ_func < 0 || _activ_func > LEAKYRELU) CV_Error( CV_StsOutOfRange, "Unknown activation function" ); @@ -362,12 +373,12 @@ public: } } - Mat getLayerSizes() const + Mat getLayerSizes() const CV_OVERRIDE { return Mat_(layer_sizes, true); } - void setLayerSizes( InputArray _layer_sizes ) + void setLayerSizes( InputArray _layer_sizes ) CV_OVERRIDE { clear(); @@ -399,7 +410,7 @@ public: } } - float predict( InputArray _inputs, OutputArray _outputs, int ) const + float predict( InputArray _inputs, OutputArray _outputs, int ) const CV_OVERRIDE { if( !trained ) CV_Error( CV_StsError, "The network has not been trained or loaded" ); @@ -907,7 +918,7 @@ public: calc_output_scale( outputs, flags ); } - bool train( const Ptr& trainData, int flags ) + bool train( const Ptr& trainData, int flags ) CV_OVERRIDE { const int MAX_ITER = 1000; const double DEFAULT_EPSILON = FLT_EPSILON; @@ -1108,7 +1119,7 @@ public: int dcount0; double* pE; - void operator()( const Range& range ) const + void operator()(const Range& range) const CV_OVERRIDE { double inv_count = 1./inputs.rows; int ivcount = ann->layer_sizes.front(); @@ -1392,7 +1403,7 @@ public: fs << "}" << "}"; } - void write( FileStorage& fs ) const + void write( FileStorage& fs ) const CV_OVERRIDE { if( layer_sizes.empty() ) return; @@ -1502,7 +1513,7 @@ public: } } - void read( const FileNode& fn ) + void read( const FileNode& fn ) CV_OVERRIDE { clear(); @@ -1531,28 +1542,28 @@ public: trained = true; } - Mat getWeights(int layerIdx) const + Mat getWeights(int layerIdx) const CV_OVERRIDE { CV_Assert( 0 <= layerIdx && layerIdx < (int)weights.size() ); return weights[layerIdx]; } - bool isTrained() const + bool isTrained() const CV_OVERRIDE { return trained; } - bool isClassifier() const + bool isClassifier() const CV_OVERRIDE { return false; } - int getVarCount() const + int getVarCount() const CV_OVERRIDE { return layer_sizes.empty() ? 0 : layer_sizes[0]; } - String getDefaultName() const + String getDefaultName() const CV_OVERRIDE { return "opencv_ml_ann_mlp"; } diff --git a/modules/ml/src/boost.cpp b/modules/ml/src/boost.cpp index bc0ba00f90..66e87f6e1c 100644 --- a/modules/ml/src/boost.cpp +++ b/modules/ml/src/boost.cpp @@ -69,7 +69,7 @@ BoostTreeParams::BoostTreeParams( int _boostType, int _weak_count, weightTrimRate = _weightTrimRate; } -class DTreesImplForBoost : public DTreesImpl +class DTreesImplForBoost CV_FINAL : public DTreesImpl { public: DTreesImplForBoost() @@ -79,14 +79,14 @@ public: } virtual ~DTreesImplForBoost() {} - bool isClassifier() const { return true; } + bool isClassifier() const CV_OVERRIDE { return true; } - void clear() + void clear() CV_OVERRIDE { DTreesImpl::clear(); } - void startTraining( const Ptr& trainData, int flags ) + void startTraining( const Ptr& trainData, int flags ) CV_OVERRIDE { DTreesImpl::startTraining(trainData, flags); sumResult.assign(w->sidx.size(), 0.); @@ -132,7 +132,7 @@ public: } } - void endTraining() + void endTraining() CV_OVERRIDE { DTreesImpl::endTraining(); vector e; @@ -167,7 +167,7 @@ public: } } - void calcValue( int nidx, const vector& _sidx ) + void calcValue( int nidx, const vector& _sidx ) CV_OVERRIDE { DTreesImpl::calcValue(nidx, _sidx); WNode* node = &w->wnodes[nidx]; @@ -182,7 +182,7 @@ public: } } - bool train( const Ptr& trainData, int flags ) + bool train( const Ptr& trainData, int flags ) CV_OVERRIDE { startTraining(trainData, flags); int treeidx, ntrees = bparams.weakCount >= 0 ? bparams.weakCount : 10000; @@ -356,7 +356,7 @@ public: } } - float predictTrees( const Range& range, const Mat& sample, int flags0 ) const + float predictTrees( const Range& range, const Mat& sample, int flags0 ) const CV_OVERRIDE { int flags = (flags0 & ~PREDICT_MASK) | PREDICT_SUM; float val = DTreesImpl::predictTrees(range, sample, flags); @@ -370,7 +370,7 @@ public: return val; } - void writeTrainingParams( FileStorage& fs ) const + void writeTrainingParams( FileStorage& fs ) const CV_OVERRIDE { fs << "boosting_type" << (bparams.boostType == Boost::DISCRETE ? "DiscreteAdaboost" : @@ -382,7 +382,7 @@ public: fs << "weight_trimming_rate" << bparams.weightTrimRate; } - void write( FileStorage& fs ) const + void write( FileStorage& fs ) const CV_OVERRIDE { if( roots.empty() ) CV_Error( CV_StsBadArg, "RTrees have not been trained" ); @@ -405,7 +405,7 @@ public: fs << "]"; } - void readParams( const FileNode& fn ) + void readParams( const FileNode& fn ) CV_OVERRIDE { DTreesImpl::readParams(fn); @@ -423,7 +423,7 @@ public: tparams_node["weight_trimming_rate"] : fn["weight_trimming_rate"]); } - void read( const FileNode& fn ) + void read( const FileNode& fn ) CV_OVERRIDE { clear(); @@ -452,51 +452,63 @@ public: BoostImpl() {} virtual ~BoostImpl() {} - CV_IMPL_PROPERTY(int, BoostType, impl.bparams.boostType) - CV_IMPL_PROPERTY(int, WeakCount, impl.bparams.weakCount) - CV_IMPL_PROPERTY(double, WeightTrimRate, impl.bparams.weightTrimRate) + inline int getBoostType() const CV_OVERRIDE { return impl.bparams.boostType; } + inline void setBoostType(int val) CV_OVERRIDE { impl.bparams.boostType = val; } + inline int getWeakCount() const CV_OVERRIDE { return impl.bparams.weakCount; } + inline void setWeakCount(int val) CV_OVERRIDE { impl.bparams.weakCount = val; } + inline double getWeightTrimRate() const CV_OVERRIDE { return impl.bparams.weightTrimRate; } + inline void setWeightTrimRate(double val) CV_OVERRIDE { impl.bparams.weightTrimRate = val; } - CV_WRAP_SAME_PROPERTY(int, MaxCategories, impl.params) - CV_WRAP_SAME_PROPERTY(int, MaxDepth, impl.params) - CV_WRAP_SAME_PROPERTY(int, MinSampleCount, impl.params) - CV_WRAP_SAME_PROPERTY(int, CVFolds, impl.params) - CV_WRAP_SAME_PROPERTY(bool, UseSurrogates, impl.params) - CV_WRAP_SAME_PROPERTY(bool, Use1SERule, impl.params) - CV_WRAP_SAME_PROPERTY(bool, TruncatePrunedTree, impl.params) - CV_WRAP_SAME_PROPERTY(float, RegressionAccuracy, impl.params) - CV_WRAP_SAME_PROPERTY_S(cv::Mat, Priors, impl.params) + inline int getMaxCategories() const CV_OVERRIDE { return impl.params.getMaxCategories(); } + inline void setMaxCategories(int val) CV_OVERRIDE { impl.params.setMaxCategories(val); } + inline int getMaxDepth() const CV_OVERRIDE { return impl.params.getMaxDepth(); } + inline void setMaxDepth(int val) CV_OVERRIDE { impl.params.setMaxDepth(val); } + inline int getMinSampleCount() const CV_OVERRIDE { return impl.params.getMinSampleCount(); } + inline void setMinSampleCount(int val) CV_OVERRIDE { impl.params.setMinSampleCount(val); } + inline int getCVFolds() const CV_OVERRIDE { return impl.params.getCVFolds(); } + inline void setCVFolds(int val) CV_OVERRIDE { impl.params.setCVFolds(val); } + inline bool getUseSurrogates() const CV_OVERRIDE { return impl.params.getUseSurrogates(); } + inline void setUseSurrogates(bool val) CV_OVERRIDE { impl.params.setUseSurrogates(val); } + inline bool getUse1SERule() const CV_OVERRIDE { return impl.params.getUse1SERule(); } + inline void setUse1SERule(bool val) CV_OVERRIDE { impl.params.setUse1SERule(val); } + inline bool getTruncatePrunedTree() const CV_OVERRIDE { return impl.params.getTruncatePrunedTree(); } + inline void setTruncatePrunedTree(bool val) CV_OVERRIDE { impl.params.setTruncatePrunedTree(val); } + inline float getRegressionAccuracy() const CV_OVERRIDE { return impl.params.getRegressionAccuracy(); } + inline void setRegressionAccuracy(float val) CV_OVERRIDE { impl.params.setRegressionAccuracy(val); } + inline cv::Mat getPriors() const CV_OVERRIDE { return impl.params.getPriors(); } + inline void setPriors(const cv::Mat& val) CV_OVERRIDE { impl.params.setPriors(val); } - String getDefaultName() const { return "opencv_ml_boost"; } + String getDefaultName() const CV_OVERRIDE { return "opencv_ml_boost"; } - bool train( const Ptr& trainData, int flags ) + bool train( const Ptr& trainData, int flags ) CV_OVERRIDE { return impl.train(trainData, flags); } - float predict( InputArray samples, OutputArray results, int flags ) const + float predict( InputArray samples, OutputArray results, int flags ) const CV_OVERRIDE { return impl.predict(samples, results, flags); } - void write( FileStorage& fs ) const + void write( FileStorage& fs ) const CV_OVERRIDE { impl.write(fs); } - void read( const FileNode& fn ) + void read( const FileNode& fn ) CV_OVERRIDE { impl.read(fn); } - int getVarCount() const { return impl.getVarCount(); } + int getVarCount() const CV_OVERRIDE { return impl.getVarCount(); } - bool isTrained() const { return impl.isTrained(); } - bool isClassifier() const { return impl.isClassifier(); } + bool isTrained() const CV_OVERRIDE { return impl.isTrained(); } + bool isClassifier() const CV_OVERRIDE { return impl.isClassifier(); } - const vector& getRoots() const { return impl.getRoots(); } - const vector& getNodes() const { return impl.getNodes(); } - const vector& getSplits() const { return impl.getSplits(); } - const vector& getSubsets() const { return impl.getSubsets(); } + const vector& getRoots() const CV_OVERRIDE { return impl.getRoots(); } + const vector& getNodes() const CV_OVERRIDE { return impl.getNodes(); } + const vector& getSplits() const CV_OVERRIDE { return impl.getSplits(); } + const vector& getSubsets() const CV_OVERRIDE { return impl.getSubsets(); } DTreesImplForBoost impl; }; diff --git a/modules/ml/src/data.cpp b/modules/ml/src/data.cpp index 07858a0333..cbd1c3fde5 100644 --- a/modules/ml/src/data.cpp +++ b/modules/ml/src/data.cpp @@ -119,7 +119,7 @@ Mat TrainData::getSubVector(const Mat& vec, const Mat& idx) return subvec; } -class TrainDataImpl : public TrainData +class TrainDataImpl CV_FINAL : public TrainData { public: typedef std::map MapType; @@ -132,75 +132,75 @@ public: virtual ~TrainDataImpl() { closeFile(); } - int getLayout() const { return layout; } - int getNSamples() const + int getLayout() const CV_OVERRIDE { return layout; } + int getNSamples() const CV_OVERRIDE { return !sampleIdx.empty() ? (int)sampleIdx.total() : layout == ROW_SAMPLE ? samples.rows : samples.cols; } - int getNTrainSamples() const + int getNTrainSamples() const CV_OVERRIDE { return !trainSampleIdx.empty() ? (int)trainSampleIdx.total() : getNSamples(); } - int getNTestSamples() const + int getNTestSamples() const CV_OVERRIDE { return !testSampleIdx.empty() ? (int)testSampleIdx.total() : 0; } - int getNVars() const + int getNVars() const CV_OVERRIDE { return !varIdx.empty() ? (int)varIdx.total() : getNAllVars(); } - int getNAllVars() const + int getNAllVars() const CV_OVERRIDE { return layout == ROW_SAMPLE ? samples.cols : samples.rows; } - Mat getSamples() const { return samples; } - Mat getResponses() const { return responses; } - Mat getMissing() const { return missing; } - Mat getVarIdx() const { return varIdx; } - Mat getVarType() const { return varType; } - int getResponseType() const + Mat getSamples() const CV_OVERRIDE { return samples; } + Mat getResponses() const CV_OVERRIDE { return responses; } + Mat getMissing() const CV_OVERRIDE { return missing; } + Mat getVarIdx() const CV_OVERRIDE { return varIdx; } + Mat getVarType() const CV_OVERRIDE { return varType; } + int getResponseType() const CV_OVERRIDE { return classLabels.empty() ? VAR_ORDERED : VAR_CATEGORICAL; } - Mat getTrainSampleIdx() const { return !trainSampleIdx.empty() ? trainSampleIdx : sampleIdx; } - Mat getTestSampleIdx() const { return testSampleIdx; } - Mat getSampleWeights() const + Mat getTrainSampleIdx() const CV_OVERRIDE { return !trainSampleIdx.empty() ? trainSampleIdx : sampleIdx; } + Mat getTestSampleIdx() const CV_OVERRIDE { return testSampleIdx; } + Mat getSampleWeights() const CV_OVERRIDE { return sampleWeights; } - Mat getTrainSampleWeights() const + Mat getTrainSampleWeights() const CV_OVERRIDE { return getSubVector(sampleWeights, getTrainSampleIdx()); } - Mat getTestSampleWeights() const + Mat getTestSampleWeights() const CV_OVERRIDE { Mat idx = getTestSampleIdx(); return idx.empty() ? Mat() : getSubVector(sampleWeights, idx); } - Mat getTrainResponses() const + Mat getTrainResponses() const CV_OVERRIDE { return getSubVector(responses, getTrainSampleIdx()); } - Mat getTrainNormCatResponses() const + Mat getTrainNormCatResponses() const CV_OVERRIDE { return getSubVector(normCatResponses, getTrainSampleIdx()); } - Mat getTestResponses() const + Mat getTestResponses() const CV_OVERRIDE { Mat idx = getTestSampleIdx(); return idx.empty() ? Mat() : getSubVector(responses, idx); } - Mat getTestNormCatResponses() const + Mat getTestNormCatResponses() const CV_OVERRIDE { Mat idx = getTestSampleIdx(); return idx.empty() ? Mat() : getSubVector(normCatResponses, idx); } - Mat getNormCatResponses() const { return normCatResponses; } - Mat getClassLabels() const { return classLabels; } + Mat getNormCatResponses() const CV_OVERRIDE { return normCatResponses; } + Mat getClassLabels() const CV_OVERRIDE { return classLabels; } Mat getClassCounters() const { return classCounters; } - int getCatCount(int vi) const + int getCatCount(int vi) const CV_OVERRIDE { int n = (int)catOfs.total(); CV_Assert( 0 <= vi && vi < n ); @@ -208,10 +208,10 @@ public: return ofs[1] - ofs[0]; } - Mat getCatOfs() const { return catOfs; } - Mat getCatMap() const { return catMap; } + Mat getCatOfs() const CV_OVERRIDE { return catOfs; } + Mat getCatMap() const CV_OVERRIDE { return catMap; } - Mat getDefaultSubstValues() const { return missingSubst; } + Mat getDefaultSubstValues() const CV_OVERRIDE { return missingSubst; } void closeFile() { if(file) fclose(file); file=0; } void clear() @@ -767,13 +767,13 @@ public: CV_Error( CV_StsBadArg, "type of some variables is not specified" ); } - void setTrainTestSplitRatio(double ratio, bool shuffle) + void setTrainTestSplitRatio(double ratio, bool shuffle) CV_OVERRIDE { CV_Assert( 0. <= ratio && ratio <= 1. ); setTrainTestSplit(cvRound(getNSamples()*ratio), shuffle); } - void setTrainTestSplit(int count, bool shuffle) + void setTrainTestSplit(int count, bool shuffle) CV_OVERRIDE { int i, nsamples = getNSamples(); CV_Assert( 0 <= count && count < nsamples ); @@ -810,7 +810,7 @@ public: } } - void shuffleTrainTest() + void shuffleTrainTest() CV_OVERRIDE { if( !trainSampleIdx.empty() && !testSampleIdx.empty() ) { @@ -844,7 +844,7 @@ public: Mat getTrainSamples(int _layout, bool compressSamples, - bool compressVars) const + bool compressVars) const CV_OVERRIDE { if( samples.empty() ) return samples; @@ -884,7 +884,7 @@ public: return dsamples; } - void getValues( int vi, InputArray _sidx, float* values ) const + void getValues( int vi, InputArray _sidx, float* values ) const CV_OVERRIDE { Mat sidx = _sidx.getMat(); int i, n = sidx.checkVector(1, CV_32S), nsamples = getNSamples(); @@ -914,7 +914,7 @@ public: } } - void getNormCatValues( int vi, InputArray _sidx, int* values ) const + void getNormCatValues( int vi, InputArray _sidx, int* values ) const CV_OVERRIDE { float* fvalues = (float*)values; getValues(vi, _sidx, fvalues); @@ -960,7 +960,7 @@ public: } } - void getSample(InputArray _vidx, int sidx, float* buf) const + void getSample(InputArray _vidx, int sidx, float* buf) const CV_OVERRIDE { CV_Assert(buf != 0 && 0 <= sidx && sidx < getNSamples()); Mat vidx = _vidx.getMat(); diff --git a/modules/ml/src/em.cpp b/modules/ml/src/em.cpp index 40993ff441..8a1020dbd9 100644 --- a/modules/ml/src/em.cpp +++ b/modules/ml/src/em.cpp @@ -48,7 +48,7 @@ namespace ml const double minEigenValue = DBL_EPSILON; -class CV_EXPORTS EMImpl : public EM +class CV_EXPORTS EMImpl CV_FINAL : public EM { public: @@ -56,20 +56,21 @@ public: int covMatType; TermCriteria termCrit; - CV_IMPL_PROPERTY_S(TermCriteria, TermCriteria, termCrit) + inline TermCriteria getTermCriteria() const CV_OVERRIDE { return termCrit; } + inline void setTermCriteria(const TermCriteria& val) CV_OVERRIDE { termCrit = val; } - void setClustersNumber(int val) + void setClustersNumber(int val) CV_OVERRIDE { nclusters = val; CV_Assert(nclusters >= 1); } - int getClustersNumber() const + int getClustersNumber() const CV_OVERRIDE { return nclusters; } - void setCovarianceMatrixType(int val) + void setCovarianceMatrixType(int val) CV_OVERRIDE { covMatType = val; CV_Assert(covMatType == COV_MAT_SPHERICAL || @@ -77,7 +78,7 @@ public: covMatType == COV_MAT_GENERIC); } - int getCovarianceMatrixType() const + int getCovarianceMatrixType() const CV_OVERRIDE { return covMatType; } @@ -91,7 +92,7 @@ public: virtual ~EMImpl() {} - void clear() + void clear() CV_OVERRIDE { trainSamples.release(); trainProbs.release(); @@ -109,7 +110,7 @@ public: logWeightDivDet.release(); } - bool train(const Ptr& data, int) + bool train(const Ptr& data, int) CV_OVERRIDE { Mat samples = data->getTrainSamples(), labels; return trainEM(samples, labels, noArray(), noArray()); @@ -118,7 +119,7 @@ public: bool trainEM(InputArray samples, OutputArray logLikelihoods, OutputArray labels, - OutputArray probs) + OutputArray probs) CV_OVERRIDE { Mat samplesMat = samples.getMat(); setTrainData(START_AUTO_STEP, samplesMat, 0, 0, 0, 0); @@ -131,7 +132,7 @@ public: InputArray _weights0, OutputArray logLikelihoods, OutputArray labels, - OutputArray probs) + OutputArray probs) CV_OVERRIDE { Mat samplesMat = samples.getMat(); std::vector covs0; @@ -148,7 +149,7 @@ public: InputArray _probs0, OutputArray logLikelihoods, OutputArray labels, - OutputArray probs) + OutputArray probs) CV_OVERRIDE { Mat samplesMat = samples.getMat(); Mat probs0 = _probs0.getMat(); @@ -157,7 +158,7 @@ public: return doTrain(START_M_STEP, logLikelihoods, labels, probs); } - float predict(InputArray _inputs, OutputArray _outputs, int) const + float predict(InputArray _inputs, OutputArray _outputs, int) const CV_OVERRIDE { bool needprobs = _outputs.needed(); Mat samples = _inputs.getMat(), probs, probsrow; @@ -186,7 +187,7 @@ public: return firstres; } - Vec2d predict2(InputArray _sample, OutputArray _probs) const + Vec2d predict2(InputArray _sample, OutputArray _probs) const CV_OVERRIDE { int ptype = CV_64F; Mat sample = _sample.getMat(); @@ -213,22 +214,22 @@ public: return computeProbabilities(sample, !probs.empty() ? &probs : 0, ptype); } - bool isTrained() const + bool isTrained() const CV_OVERRIDE { return !means.empty(); } - bool isClassifier() const + bool isClassifier() const CV_OVERRIDE { return true; } - int getVarCount() const + int getVarCount() const CV_OVERRIDE { return means.cols; } - String getDefaultName() const + String getDefaultName() const CV_OVERRIDE { return "opencv_ml_em"; } @@ -768,7 +769,7 @@ public: writeTermCrit(fs, termCrit); } - void write(FileStorage& fs) const + void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "training_params" << "{"; @@ -796,7 +797,7 @@ public: termCrit = readTermCrit(fn); } - void read(const FileNode& fn) + void read(const FileNode& fn) CV_OVERRIDE { clear(); read_params(fn["training_params"]); @@ -816,9 +817,9 @@ public: computeLogWeightDivDet(); } - Mat getWeights() const { return weights; } - Mat getMeans() const { return means; } - void getCovs(std::vector& _covs) const + Mat getWeights() const CV_OVERRIDE { return weights; } + Mat getMeans() const CV_OVERRIDE { return means; } + void getCovs(std::vector& _covs) const CV_OVERRIDE { _covs.resize(covs.size()); std::copy(covs.begin(), covs.end(), _covs.begin()); diff --git a/modules/ml/src/inner_functions.cpp b/modules/ml/src/inner_functions.cpp index e95674a0fb..6f8b222d19 100644 --- a/modules/ml/src/inner_functions.cpp +++ b/modules/ml/src/inner_functions.cpp @@ -89,7 +89,7 @@ public: errStrip(e) { } - virtual void operator()(const Range& range) const + virtual void operator()(const Range& range) const CV_OVERRIDE { int idxErr = range.start; CV_TRACE_FUNCTION_SKIP_NESTED(); diff --git a/modules/ml/src/knearest.cpp b/modules/ml/src/knearest.cpp index 24c08da7c7..c78689c6d6 100644 --- a/modules/ml/src/knearest.cpp +++ b/modules/ml/src/knearest.cpp @@ -134,11 +134,11 @@ public: Mat responses; }; -class BruteForceImpl : public Impl +class BruteForceImpl CV_FINAL : public Impl { public: - String getModelName() const { return NAME_BRUTE_FORCE; } - int getType() const { return ml::KNearest::BRUTE_FORCE; } + String getModelName() const CV_OVERRIDE { return NAME_BRUTE_FORCE; } + int getType() const CV_OVERRIDE { return ml::KNearest::BRUTE_FORCE; } void findNearestCore( const Mat& _samples, int k0, const Range& range, Mat* results, Mat* neighbor_responses, @@ -294,7 +294,7 @@ public: presult = _presult; } - void operator()( const Range& range ) const + void operator()(const Range& range) const CV_OVERRIDE { int delta = std::min(range.end - range.start, 256); for( int start = range.start; start < range.end; start += delta ) @@ -316,7 +316,7 @@ public: float findNearest( InputArray _samples, int k, OutputArray _results, OutputArray _neighborResponses, - OutputArray _dists ) const + OutputArray _dists ) const CV_OVERRIDE { float result = 0.f; CV_Assert( 0 < k ); @@ -358,13 +358,13 @@ public: }; -class KDTreeImpl : public Impl +class KDTreeImpl CV_FINAL : public Impl { public: - String getModelName() const { return NAME_KDTREE; } - int getType() const { return ml::KNearest::KDTREE; } + String getModelName() const CV_OVERRIDE { return NAME_KDTREE; } + int getType() const CV_OVERRIDE { return ml::KNearest::KDTREE; } - void doTrain(InputArray points) + void doTrain(InputArray points) CV_OVERRIDE { tr.build(points); } @@ -372,7 +372,7 @@ public: float findNearest( InputArray _samples, int k, OutputArray _results, OutputArray _neighborResponses, - OutputArray _dists ) const + OutputArray _dists ) const CV_OVERRIDE { float result = 0.f; CV_Assert( 0 < k ); @@ -432,18 +432,21 @@ public: //================================================================ -class KNearestImpl : public KNearest +class KNearestImpl CV_FINAL : public KNearest { - CV_IMPL_PROPERTY(int, DefaultK, impl->defaultK) - CV_IMPL_PROPERTY(bool, IsClassifier, impl->isclassifier) - CV_IMPL_PROPERTY(int, Emax, impl->Emax) + inline int getDefaultK() const CV_OVERRIDE { return impl->defaultK; } + inline void setDefaultK(int val) CV_OVERRIDE { impl->defaultK = val; } + inline bool getIsClassifier() const CV_OVERRIDE { return impl->isclassifier; } + inline void setIsClassifier(bool val) CV_OVERRIDE { impl->isclassifier = val; } + inline int getEmax() const CV_OVERRIDE { return impl->Emax; } + inline void setEmax(int val) CV_OVERRIDE { impl->Emax = val; } public: - int getAlgorithmType() const + int getAlgorithmType() const CV_OVERRIDE { return impl->getType(); } - void setAlgorithmType(int val) + void setAlgorithmType(int val) CV_OVERRIDE { if (val != BRUTE_FORCE && val != KDTREE) val = BRUTE_FORCE; @@ -459,18 +462,18 @@ public: { } - bool isClassifier() const { return impl->isclassifier; } - bool isTrained() const { return !impl->samples.empty(); } + bool isClassifier() const CV_OVERRIDE { return impl->isclassifier; } + bool isTrained() const CV_OVERRIDE { return !impl->samples.empty(); } - int getVarCount() const { return impl->samples.cols; } + int getVarCount() const CV_OVERRIDE { return impl->samples.cols; } - void write( FileStorage& fs ) const + void write( FileStorage& fs ) const CV_OVERRIDE { writeFormat(fs); impl->write(fs); } - void read( const FileNode& fn ) + void read( const FileNode& fn ) CV_OVERRIDE { int algorithmType = BRUTE_FORCE; if (fn.name() == NAME_KDTREE) @@ -482,22 +485,22 @@ public: float findNearest( InputArray samples, int k, OutputArray results, OutputArray neighborResponses=noArray(), - OutputArray dist=noArray() ) const + OutputArray dist=noArray() ) const CV_OVERRIDE { return impl->findNearest(samples, k, results, neighborResponses, dist); } - float predict(InputArray inputs, OutputArray outputs, int) const + float predict(InputArray inputs, OutputArray outputs, int) const CV_OVERRIDE { return impl->findNearest( inputs, impl->defaultK, outputs, noArray(), noArray() ); } - bool train( const Ptr& data, int flags ) + bool train( const Ptr& data, int flags ) CV_OVERRIDE { return impl->train(data, flags); } - String getDefaultName() const { return impl->getModelName(); } + String getDefaultName() const CV_OVERRIDE { return impl->getModelName(); } protected: void initImpl(int algorithmType) diff --git a/modules/ml/src/lr.cpp b/modules/ml/src/lr.cpp index e9df409b79..166b6a39d8 100644 --- a/modules/ml/src/lr.cpp +++ b/modules/ml/src/lr.cpp @@ -81,30 +81,36 @@ public: TermCriteria term_crit; }; -class LogisticRegressionImpl : public LogisticRegression +class LogisticRegressionImpl CV_FINAL : public LogisticRegression { public: LogisticRegressionImpl() { } virtual ~LogisticRegressionImpl() {} - CV_IMPL_PROPERTY(double, LearningRate, params.alpha) - CV_IMPL_PROPERTY(int, Iterations, params.num_iters) - CV_IMPL_PROPERTY(int, Regularization, params.norm) - CV_IMPL_PROPERTY(int, TrainMethod, params.train_method) - CV_IMPL_PROPERTY(int, MiniBatchSize, params.mini_batch_size) - CV_IMPL_PROPERTY(TermCriteria, TermCriteria, params.term_crit) + inline double getLearningRate() const CV_OVERRIDE { return params.alpha; } + inline void setLearningRate(double val) CV_OVERRIDE { params.alpha = val; } + inline int getIterations() const CV_OVERRIDE { return params.num_iters; } + inline void setIterations(int val) CV_OVERRIDE { params.num_iters = val; } + inline int getRegularization() const CV_OVERRIDE { return params.norm; } + inline void setRegularization(int val) CV_OVERRIDE { params.norm = val; } + inline int getTrainMethod() const CV_OVERRIDE { return params.train_method; } + inline void setTrainMethod(int val) CV_OVERRIDE { params.train_method = val; } + inline int getMiniBatchSize() const CV_OVERRIDE { return params.mini_batch_size; } + inline void setMiniBatchSize(int val) CV_OVERRIDE { params.mini_batch_size = val; } + inline TermCriteria getTermCriteria() const CV_OVERRIDE { return params.term_crit; } + inline void setTermCriteria(TermCriteria val) CV_OVERRIDE { params.term_crit = val; } - virtual bool train( const Ptr& trainData, int=0 ); - virtual float predict(InputArray samples, OutputArray results, int flags=0) const; - virtual void clear(); - virtual void write(FileStorage& fs) const; - virtual void read(const FileNode& fn); - virtual Mat get_learnt_thetas() const { return learnt_thetas; } - virtual int getVarCount() const { return learnt_thetas.cols; } - virtual bool isTrained() const { return !learnt_thetas.empty(); } - virtual bool isClassifier() const { return true; } - virtual String getDefaultName() const { return "opencv_ml_lr"; } + virtual bool train( const Ptr& trainData, int=0 ) CV_OVERRIDE; + virtual float predict(InputArray samples, OutputArray results, int flags=0) const CV_OVERRIDE; + virtual void clear() CV_OVERRIDE; + virtual void write(FileStorage& fs) const CV_OVERRIDE; + virtual void read(const FileNode& fn) CV_OVERRIDE; + virtual Mat get_learnt_thetas() const CV_OVERRIDE { return learnt_thetas; } + virtual int getVarCount() const CV_OVERRIDE { return learnt_thetas.cols; } + virtual bool isTrained() const CV_OVERRIDE { return !learnt_thetas.empty(); } + virtual bool isClassifier() const CV_OVERRIDE { return true; } + virtual String getDefaultName() const CV_OVERRIDE { return "opencv_ml_lr"; } protected: Mat calc_sigmoid(const Mat& data) const; double compute_cost(const Mat& _data, const Mat& _labels, const Mat& _init_theta); @@ -392,7 +398,7 @@ struct LogisticRegressionImpl_ComputeDradient_Impl : ParallelLoopBody } - void operator()(const cv::Range& r) const + void operator()(const cv::Range& r) const CV_OVERRIDE { const Mat& _data = *data; const Mat &_theta = *theta; diff --git a/modules/ml/src/nbayes.cpp b/modules/ml/src/nbayes.cpp index dc70db2a0a..2b6467a6fe 100644 --- a/modules/ml/src/nbayes.cpp +++ b/modules/ml/src/nbayes.cpp @@ -52,7 +52,7 @@ public: nallvars = 0; } - bool train( const Ptr& trainData, int flags ) + bool train( const Ptr& trainData, int flags ) CV_OVERRIDE { const float min_variation = FLT_EPSILON; Mat responses = trainData->getNormCatResponses(); @@ -219,7 +219,7 @@ public: float* value; bool rawOutput; - void operator()( const Range& range ) const + void operator()(const Range& range) const CV_OVERRIDE { int cls = -1; int rtype = 0, rptype = 0; @@ -298,12 +298,12 @@ public: } }; - float predict( InputArray _samples, OutputArray _results, int flags ) const + float predict( InputArray _samples, OutputArray _results, int flags ) const CV_OVERRIDE { return predictProb(_samples, _results, noArray(), flags); } - float predictProb( InputArray _samples, OutputArray _results, OutputArray _resultsProb, int flags ) const + float predictProb( InputArray _samples, OutputArray _results, OutputArray _resultsProb, int flags ) const CV_OVERRIDE { int value=0; Mat samples = _samples.getMat(), results, resultsProb; @@ -339,7 +339,7 @@ public: return (float)value; } - void write( FileStorage& fs ) const + void write( FileStorage& fs ) const CV_OVERRIDE { int nclasses = (int)cls_labels.total(), i; @@ -380,7 +380,7 @@ public: fs << "c" << c; } - void read( const FileNode& fn ) + void read( const FileNode& fn ) CV_OVERRIDE { clear(); @@ -427,7 +427,7 @@ public: fn["c"] >> c; } - void clear() + void clear() CV_OVERRIDE { count.clear(); sum.clear(); @@ -442,10 +442,10 @@ public: nallvars = 0; } - bool isTrained() const { return !avg.empty(); } - bool isClassifier() const { return true; } - int getVarCount() const { return nallvars; } - String getDefaultName() const { return "opencv_ml_nbayes"; } + bool isTrained() const CV_OVERRIDE { return !avg.empty(); } + bool isClassifier() const CV_OVERRIDE { return true; } + int getVarCount() const CV_OVERRIDE { return nallvars; } + String getDefaultName() const CV_OVERRIDE { return "opencv_ml_nbayes"; } int nallvars; Mat var_idx, cls_labels, c; diff --git a/modules/ml/src/precomp.hpp b/modules/ml/src/precomp.hpp index e8f0b4e02b..6d50357b7a 100644 --- a/modules/ml/src/precomp.hpp +++ b/modules/ml/src/precomp.hpp @@ -173,13 +173,17 @@ namespace ml inline int getCVFolds() const { return CVFolds; } inline float getRegressionAccuracy() const { return regressionAccuracy; } - CV_IMPL_PROPERTY(bool, UseSurrogates, useSurrogates) - CV_IMPL_PROPERTY(bool, Use1SERule, use1SERule) - CV_IMPL_PROPERTY(bool, TruncatePrunedTree, truncatePrunedTree) - CV_IMPL_PROPERTY_S(cv::Mat, Priors, priors) + inline bool getUseSurrogates() const { return useSurrogates; } + inline void setUseSurrogates(bool val) { useSurrogates = val; } + inline bool getUse1SERule() const { return use1SERule; } + inline void setUse1SERule(bool val) { use1SERule = val; } + inline bool getTruncatePrunedTree() const { return truncatePrunedTree; } + inline void setTruncatePrunedTree(bool val) { truncatePrunedTree = val; } + inline cv::Mat getPriors() const { return priors; } + inline void setPriors(const cv::Mat& val) { priors = val; } public: - bool useSurrogates; + bool useSurrogates; bool use1SERule; bool truncatePrunedTree; Mat priors; @@ -281,24 +285,33 @@ namespace ml int maxSubsetSize; }; - CV_WRAP_SAME_PROPERTY(int, MaxCategories, params) - CV_WRAP_SAME_PROPERTY(int, MaxDepth, params) - CV_WRAP_SAME_PROPERTY(int, MinSampleCount, params) - CV_WRAP_SAME_PROPERTY(int, CVFolds, params) - CV_WRAP_SAME_PROPERTY(bool, UseSurrogates, params) - CV_WRAP_SAME_PROPERTY(bool, Use1SERule, params) - CV_WRAP_SAME_PROPERTY(bool, TruncatePrunedTree, params) - CV_WRAP_SAME_PROPERTY(float, RegressionAccuracy, params) - CV_WRAP_SAME_PROPERTY_S(cv::Mat, Priors, params) + inline int getMaxCategories() const CV_OVERRIDE { return params.getMaxCategories(); } + inline void setMaxCategories(int val) CV_OVERRIDE { params.setMaxCategories(val); } + inline int getMaxDepth() const CV_OVERRIDE { return params.getMaxDepth(); } + inline void setMaxDepth(int val) CV_OVERRIDE { params.setMaxDepth(val); } + inline int getMinSampleCount() const CV_OVERRIDE { return params.getMinSampleCount(); } + inline void setMinSampleCount(int val) CV_OVERRIDE { params.setMinSampleCount(val); } + inline int getCVFolds() const CV_OVERRIDE { return params.getCVFolds(); } + inline void setCVFolds(int val) CV_OVERRIDE { params.setCVFolds(val); } + inline bool getUseSurrogates() const CV_OVERRIDE { return params.getUseSurrogates(); } + inline void setUseSurrogates(bool val) CV_OVERRIDE { params.setUseSurrogates(val); } + inline bool getUse1SERule() const CV_OVERRIDE { return params.getUse1SERule(); } + inline void setUse1SERule(bool val) CV_OVERRIDE { params.setUse1SERule(val); } + inline bool getTruncatePrunedTree() const CV_OVERRIDE { return params.getTruncatePrunedTree(); } + inline void setTruncatePrunedTree(bool val) CV_OVERRIDE { params.setTruncatePrunedTree(val); } + inline float getRegressionAccuracy() const CV_OVERRIDE { return params.getRegressionAccuracy(); } + inline void setRegressionAccuracy(float val) CV_OVERRIDE { params.setRegressionAccuracy(val); } + inline cv::Mat getPriors() const CV_OVERRIDE { return params.getPriors(); } + inline void setPriors(const cv::Mat& val) CV_OVERRIDE { params.setPriors(val); } DTreesImpl(); - virtual ~DTreesImpl(); - virtual void clear(); + virtual ~DTreesImpl() CV_OVERRIDE; + virtual void clear() CV_OVERRIDE; - String getDefaultName() const { return "opencv_ml_dtree"; } - bool isTrained() const { return !roots.empty(); } - bool isClassifier() const { return _isClassifier; } - int getVarCount() const { return varType.empty() ? 0 : (int)(varType.size() - 1); } + String getDefaultName() const CV_OVERRIDE { return "opencv_ml_dtree"; } + bool isTrained() const CV_OVERRIDE { return !roots.empty(); } + bool isClassifier() const CV_OVERRIDE { return _isClassifier; } + int getVarCount() const CV_OVERRIDE { return varType.empty() ? 0 : (int)(varType.size() - 1); } int getCatCount(int vi) const { return catOfs[vi][1] - catOfs[vi][0]; } int getSubsetSize(int vi) const { return (getCatCount(vi) + 31)/32; } @@ -306,7 +319,7 @@ namespace ml virtual void startTraining( const Ptr& trainData, int flags ); virtual void endTraining(); virtual void initCompVarIdx(); - virtual bool train( const Ptr& trainData, int flags ); + virtual bool train( const Ptr& trainData, int flags ) CV_OVERRIDE; virtual int addTree( const vector& sidx ); virtual int addNodeAndTrySplit( int parent, const vector& sidx ); @@ -329,25 +342,25 @@ namespace ml virtual double updateTreeRNC( int root, double T, int fold ); virtual bool cutTree( int root, double T, int fold, double min_alpha ); virtual float predictTrees( const Range& range, const Mat& sample, int flags ) const; - virtual float predict( InputArray inputs, OutputArray outputs, int flags ) const; + virtual float predict( InputArray inputs, OutputArray outputs, int flags ) const CV_OVERRIDE; virtual void writeTrainingParams( FileStorage& fs ) const; virtual void writeParams( FileStorage& fs ) const; virtual void writeSplit( FileStorage& fs, int splitidx ) const; virtual void writeNode( FileStorage& fs, int nidx, int depth ) const; virtual void writeTree( FileStorage& fs, int root ) const; - virtual void write( FileStorage& fs ) const; + virtual void write( FileStorage& fs ) const CV_OVERRIDE; virtual void readParams( const FileNode& fn ); virtual int readSplit( const FileNode& fn ); virtual int readNode( const FileNode& fn ); virtual int readTree( const FileNode& fn ); - virtual void read( const FileNode& fn ); + virtual void read( const FileNode& fn ) CV_OVERRIDE; - virtual const std::vector& getRoots() const { return roots; } - virtual const std::vector& getNodes() const { return nodes; } - virtual const std::vector& getSplits() const { return splits; } - virtual const std::vector& getSubsets() const { return subsets; } + virtual const std::vector& getRoots() const CV_OVERRIDE { return roots; } + virtual const std::vector& getNodes() const CV_OVERRIDE { return nodes; } + virtual const std::vector& getSplits() const CV_OVERRIDE { return splits; } + virtual const std::vector& getSubsets() const CV_OVERRIDE { return subsets; } TreeParams params; diff --git a/modules/ml/src/rtrees.cpp b/modules/ml/src/rtrees.cpp index 6aa3c96522..0751e37b91 100644 --- a/modules/ml/src/rtrees.cpp +++ b/modules/ml/src/rtrees.cpp @@ -66,7 +66,7 @@ RTreeParams::RTreeParams(bool _calcVarImportance, } -class DTreesImplForRTrees : public DTreesImpl +class DTreesImplForRTrees CV_FINAL : public DTreesImpl { public: DTreesImplForRTrees() @@ -85,7 +85,7 @@ public: } virtual ~DTreesImplForRTrees() {} - void clear() + void clear() CV_OVERRIDE { CV_TRACE_FUNCTION(); DTreesImpl::clear(); @@ -93,7 +93,7 @@ public: rng = RNG((uint64)-1); } - const vector& getActiveVars() + const vector& getActiveVars() CV_OVERRIDE { CV_TRACE_FUNCTION(); int i, nvars = (int)allVars.size(), m = (int)activeVars.size(); @@ -108,7 +108,7 @@ public: return activeVars; } - void startTraining( const Ptr& trainData, int flags ) + void startTraining( const Ptr& trainData, int flags ) CV_OVERRIDE { CV_TRACE_FUNCTION(); DTreesImpl::startTraining(trainData, flags); @@ -121,7 +121,7 @@ public: allVars[i] = varIdx[i]; } - void endTraining() + void endTraining() CV_OVERRIDE { CV_TRACE_FUNCTION(); DTreesImpl::endTraining(); @@ -130,7 +130,7 @@ public: std::swap(activeVars, b); } - bool train( const Ptr& trainData, int flags ) + bool train( const Ptr& trainData, int flags ) CV_OVERRIDE { CV_TRACE_FUNCTION(); startTraining(trainData, flags); @@ -293,14 +293,14 @@ public: return true; } - void writeTrainingParams( FileStorage& fs ) const + void writeTrainingParams( FileStorage& fs ) const CV_OVERRIDE { CV_TRACE_FUNCTION(); DTreesImpl::writeTrainingParams(fs); fs << "nactive_vars" << rparams.nactiveVars; } - void write( FileStorage& fs ) const + void write( FileStorage& fs ) const CV_OVERRIDE { CV_TRACE_FUNCTION(); if( roots.empty() ) @@ -328,7 +328,7 @@ public: fs << "]"; } - void readParams( const FileNode& fn ) + void readParams( const FileNode& fn ) CV_OVERRIDE { CV_TRACE_FUNCTION(); DTreesImpl::readParams(fn); @@ -337,7 +337,7 @@ public: rparams.nactiveVars = (int)tparams_node["nactive_vars"]; } - void read( const FileNode& fn ) + void read( const FileNode& fn ) CV_OVERRIDE { CV_TRACE_FUNCTION(); clear(); @@ -425,29 +425,41 @@ public: }; -class RTreesImpl : public RTrees +class RTreesImpl CV_FINAL : public RTrees { public: - CV_IMPL_PROPERTY(bool, CalculateVarImportance, impl.rparams.calcVarImportance) - CV_IMPL_PROPERTY(int, ActiveVarCount, impl.rparams.nactiveVars) - CV_IMPL_PROPERTY_S(TermCriteria, TermCriteria, impl.rparams.termCrit) + inline bool getCalculateVarImportance() const CV_OVERRIDE { return impl.rparams.calcVarImportance; } + inline void setCalculateVarImportance(bool val) CV_OVERRIDE { impl.rparams.calcVarImportance = val; } + inline int getActiveVarCount() const CV_OVERRIDE { return impl.rparams.nactiveVars; } + inline void setActiveVarCount(int val) CV_OVERRIDE { impl.rparams.nactiveVars = val; } + inline TermCriteria getTermCriteria() const CV_OVERRIDE { return impl.rparams.termCrit; } + inline void setTermCriteria(const TermCriteria& val) CV_OVERRIDE { impl.rparams.termCrit = val; } - CV_WRAP_SAME_PROPERTY(int, MaxCategories, impl.params) - CV_WRAP_SAME_PROPERTY(int, MaxDepth, impl.params) - CV_WRAP_SAME_PROPERTY(int, MinSampleCount, impl.params) - CV_WRAP_SAME_PROPERTY(int, CVFolds, impl.params) - CV_WRAP_SAME_PROPERTY(bool, UseSurrogates, impl.params) - CV_WRAP_SAME_PROPERTY(bool, Use1SERule, impl.params) - CV_WRAP_SAME_PROPERTY(bool, TruncatePrunedTree, impl.params) - CV_WRAP_SAME_PROPERTY(float, RegressionAccuracy, impl.params) - CV_WRAP_SAME_PROPERTY_S(cv::Mat, Priors, impl.params) + inline int getMaxCategories() const CV_OVERRIDE { return impl.params.getMaxCategories(); } + inline void setMaxCategories(int val) CV_OVERRIDE { impl.params.setMaxCategories(val); } + inline int getMaxDepth() const CV_OVERRIDE { return impl.params.getMaxDepth(); } + inline void setMaxDepth(int val) CV_OVERRIDE { impl.params.setMaxDepth(val); } + inline int getMinSampleCount() const CV_OVERRIDE { return impl.params.getMinSampleCount(); } + inline void setMinSampleCount(int val) CV_OVERRIDE { impl.params.setMinSampleCount(val); } + inline int getCVFolds() const CV_OVERRIDE { return impl.params.getCVFolds(); } + inline void setCVFolds(int val) CV_OVERRIDE { impl.params.setCVFolds(val); } + inline bool getUseSurrogates() const CV_OVERRIDE { return impl.params.getUseSurrogates(); } + inline void setUseSurrogates(bool val) CV_OVERRIDE { impl.params.setUseSurrogates(val); } + inline bool getUse1SERule() const CV_OVERRIDE { return impl.params.getUse1SERule(); } + inline void setUse1SERule(bool val) CV_OVERRIDE { impl.params.setUse1SERule(val); } + inline bool getTruncatePrunedTree() const CV_OVERRIDE { return impl.params.getTruncatePrunedTree(); } + inline void setTruncatePrunedTree(bool val) CV_OVERRIDE { impl.params.setTruncatePrunedTree(val); } + inline float getRegressionAccuracy() const CV_OVERRIDE { return impl.params.getRegressionAccuracy(); } + inline void setRegressionAccuracy(float val) CV_OVERRIDE { impl.params.setRegressionAccuracy(val); } + inline cv::Mat getPriors() const CV_OVERRIDE { return impl.params.getPriors(); } + inline void setPriors(const cv::Mat& val) CV_OVERRIDE { impl.params.setPriors(val); } RTreesImpl() {} - virtual ~RTreesImpl() {} + virtual ~RTreesImpl() CV_OVERRIDE {} - String getDefaultName() const { return "opencv_ml_rtrees"; } + String getDefaultName() const CV_OVERRIDE { return "opencv_ml_rtrees"; } - bool train( const Ptr& trainData, int flags ) + bool train( const Ptr& trainData, int flags ) CV_OVERRIDE { CV_TRACE_FUNCTION(); if (impl.getCVFolds() != 0) @@ -455,19 +467,19 @@ public: return impl.train(trainData, flags); } - float predict( InputArray samples, OutputArray results, int flags ) const + float predict( InputArray samples, OutputArray results, int flags ) const CV_OVERRIDE { CV_TRACE_FUNCTION(); return impl.predict(samples, results, flags); } - void write( FileStorage& fs ) const + void write( FileStorage& fs ) const CV_OVERRIDE { CV_TRACE_FUNCTION(); impl.write(fs); } - void read( const FileNode& fn ) + void read( const FileNode& fn ) CV_OVERRIDE { CV_TRACE_FUNCTION(); impl.read(fn); @@ -479,16 +491,16 @@ public: impl.getVotes(samples, results, flags); } - Mat getVarImportance() const { return Mat_(impl.varImportance, true); } - int getVarCount() const { return impl.getVarCount(); } + Mat getVarImportance() const CV_OVERRIDE { return Mat_(impl.varImportance, true); } + int getVarCount() const CV_OVERRIDE { return impl.getVarCount(); } - bool isTrained() const { return impl.isTrained(); } - bool isClassifier() const { return impl.isClassifier(); } + bool isTrained() const CV_OVERRIDE { return impl.isTrained(); } + bool isClassifier() const CV_OVERRIDE { return impl.isClassifier(); } - const vector& getRoots() const { return impl.getRoots(); } - const vector& getNodes() const { return impl.getNodes(); } - const vector& getSplits() const { return impl.getSplits(); } - const vector& getSubsets() const { return impl.getSubsets(); } + const vector& getRoots() const CV_OVERRIDE { return impl.getRoots(); } + const vector& getNodes() const CV_OVERRIDE { return impl.getNodes(); } + const vector& getSplits() const CV_OVERRIDE { return impl.getSplits(); } + const vector& getSubsets() const CV_OVERRIDE { return impl.getSubsets(); } DTreesImplForRTrees impl; }; diff --git a/modules/ml/src/svm.cpp b/modules/ml/src/svm.cpp index bc7042abe7..d6518ef013 100644 --- a/modules/ml/src/svm.cpp +++ b/modules/ml/src/svm.cpp @@ -149,7 +149,7 @@ struct SvmParams }; /////////////////////////////////////// SVM kernel /////////////////////////////////////// -class SVMKernelImpl : public SVM::Kernel +class SVMKernelImpl CV_FINAL : public SVM::Kernel { public: SVMKernelImpl( const SvmParams& _params = SvmParams() ) @@ -157,7 +157,7 @@ public: params = _params; } - int getType() const + int getType() const CV_OVERRIDE { return params.kernelType; } @@ -300,7 +300,7 @@ public: } void calc( int vcount, int var_count, const float* vecs, - const float* another, Qfloat* results ) + const float* another, Qfloat* results ) CV_OVERRIDE { switch( params.kernelType ) { @@ -414,7 +414,7 @@ ParamGrid SVM::getDefaultGrid( int param_id ) } -class SVMImpl : public SVM +class SVMImpl CV_FINAL : public SVM { public: struct DecisionFunc @@ -1241,7 +1241,7 @@ public: clear(); } - void clear() + void clear() CV_OVERRIDE { decision_func.clear(); df_alpha.clear(); @@ -1255,34 +1255,39 @@ public: return uncompressed_sv; } - Mat getSupportVectors() const + Mat getSupportVectors() const CV_OVERRIDE { return sv; } - CV_IMPL_PROPERTY(int, Type, params.svmType) - CV_IMPL_PROPERTY(double, Gamma, params.gamma) - CV_IMPL_PROPERTY(double, Coef0, params.coef0) - CV_IMPL_PROPERTY(double, Degree, params.degree) - CV_IMPL_PROPERTY(double, C, params.C) - CV_IMPL_PROPERTY(double, Nu, params.nu) - CV_IMPL_PROPERTY(double, P, params.p) - CV_IMPL_PROPERTY_S(cv::Mat, ClassWeights, params.classWeights) - CV_IMPL_PROPERTY_S(cv::TermCriteria, TermCriteria, params.termCrit) + inline int getType() const CV_OVERRIDE { return params.svmType; } + inline void setType(int val) CV_OVERRIDE { params.svmType = val; } + inline double getGamma() const CV_OVERRIDE { return params.gamma; } + inline void setGamma(double val) CV_OVERRIDE { params.gamma = val; } + inline double getCoef0() const CV_OVERRIDE { return params.coef0; } + inline void setCoef0(double val) CV_OVERRIDE { params.coef0 = val; } + inline double getDegree() const CV_OVERRIDE { return params.degree; } + inline void setDegree(double val) CV_OVERRIDE { params.degree = val; } + inline double getC() const CV_OVERRIDE { return params.C; } + inline void setC(double val) CV_OVERRIDE { params.C = val; } + inline double getNu() const CV_OVERRIDE { return params.nu; } + inline void setNu(double val) CV_OVERRIDE { params.nu = val; } + inline double getP() const CV_OVERRIDE { return params.p; } + inline void setP(double val) CV_OVERRIDE { params.p = val; } + inline cv::Mat getClassWeights() const CV_OVERRIDE { return params.classWeights; } + inline void setClassWeights(const cv::Mat& val) CV_OVERRIDE { params.classWeights = val; } + inline cv::TermCriteria getTermCriteria() const CV_OVERRIDE { return params.termCrit; } + inline void setTermCriteria(const cv::TermCriteria& val) CV_OVERRIDE { params.termCrit = val; } - int getKernelType() const - { - return params.kernelType; - } - - void setKernel(int kernelType) + int getKernelType() const CV_OVERRIDE { return params.kernelType; } + void setKernel(int kernelType) CV_OVERRIDE { params.kernelType = kernelType; if (kernelType != CUSTOM) kernel = makePtr(params); } - void setCustomKernel(const Ptr &_kernel) + void setCustomKernel(const Ptr &_kernel) CV_OVERRIDE { params.kernelType = CUSTOM; kernel = _kernel; @@ -1606,7 +1611,7 @@ public: std::swap(decision_func, new_df); } - bool train( const Ptr& data, int ) + bool train( const Ptr& data, int ) CV_OVERRIDE { clear(); @@ -1651,7 +1656,7 @@ public: sidx(_sidx), is_classification(_is_classification), k_fold(_k_fold), result(_result) {} - void operator()( const cv::Range& range ) const + void operator()( const cv::Range& range ) const CV_OVERRIDE { int sample_count = samples.rows; int var_count_ = samples.cols; @@ -1732,7 +1737,7 @@ public: bool trainAuto( const Ptr& data, int k_fold, ParamGrid C_grid, ParamGrid gamma_grid, ParamGrid p_grid, ParamGrid nu_grid, ParamGrid coef_grid, ParamGrid degree_grid, - bool balanced ) + bool balanced ) CV_OVERRIDE { checkParams(); @@ -1902,7 +1907,7 @@ public: returnDFVal = _returnDFVal; } - void operator()( const Range& range ) const + void operator()(const Range& range) const CV_OVERRIDE { int svmType = svm->params.svmType; int sv_total = svm->sv.rows; @@ -1995,7 +2000,7 @@ public: } - float predict( InputArray _samples, OutputArray _results, int flags ) const + float predict( InputArray _samples, OutputArray _results, int flags ) const CV_OVERRIDE { float result = 0; Mat samples = _samples.getMat(), results; @@ -2023,7 +2028,7 @@ public: return result; } - double getDecisionFunction(int i, OutputArray _alpha, OutputArray _svidx ) const + double getDecisionFunction(int i, OutputArray _alpha, OutputArray _svidx ) const CV_OVERRIDE { CV_Assert( 0 <= i && i < (int)decision_func.size()); const DecisionFunc& df = decision_func[i]; @@ -2085,27 +2090,27 @@ public: fs << "}"; } - bool isTrained() const + bool isTrained() const CV_OVERRIDE { return !sv.empty(); } - bool isClassifier() const + bool isClassifier() const CV_OVERRIDE { return params.svmType == C_SVC || params.svmType == NU_SVC || params.svmType == ONE_CLASS; } - int getVarCount() const + int getVarCount() const CV_OVERRIDE { return var_count; } - String getDefaultName() const + String getDefaultName() const CV_OVERRIDE { return "opencv_ml_svm"; } - void write( FileStorage& fs ) const + void write( FileStorage& fs ) const CV_OVERRIDE { int class_count = !class_labels.empty() ? (int)class_labels.total() : params.svmType == ONE_CLASS ? 1 : 0; @@ -2238,7 +2243,7 @@ public: setParams( _params ); } - void read( const FileNode& fn ) + void read( const FileNode& fn ) CV_OVERRIDE { clear(); diff --git a/modules/ml/src/svmsgd.cpp b/modules/ml/src/svmsgd.cpp index 4b92079978..ac778f4da8 100644 --- a/modules/ml/src/svmsgd.cpp +++ b/modules/ml/src/svmsgd.cpp @@ -57,7 +57,7 @@ namespace cv namespace ml { -class SVMSGDImpl : public SVMSGD +class SVMSGDImpl CV_FINAL : public SVMSGD { public: @@ -65,36 +65,42 @@ public: virtual ~SVMSGDImpl() {} - virtual bool train(const Ptr& data, int); + virtual bool train(const Ptr& data, int) CV_OVERRIDE; - virtual float predict( InputArray samples, OutputArray results=noArray(), int flags = 0 ) const; + virtual float predict( InputArray samples, OutputArray results=noArray(), int flags = 0 ) const CV_OVERRIDE; - virtual bool isClassifier() const; + virtual bool isClassifier() const CV_OVERRIDE; - virtual bool isTrained() const; + virtual bool isTrained() const CV_OVERRIDE; - virtual void clear(); + virtual void clear() CV_OVERRIDE; - virtual void write(FileStorage &fs) const; + virtual void write(FileStorage &fs) const CV_OVERRIDE; - virtual void read(const FileNode &fn); + virtual void read(const FileNode &fn) CV_OVERRIDE; - virtual Mat getWeights(){ return weights_; } + virtual Mat getWeights() CV_OVERRIDE { return weights_; } - virtual float getShift(){ return shift_; } + virtual float getShift() CV_OVERRIDE { return shift_; } - virtual int getVarCount() const { return weights_.cols; } + virtual int getVarCount() const CV_OVERRIDE { return weights_.cols; } - virtual String getDefaultName() const {return "opencv_ml_svmsgd";} + virtual String getDefaultName() const CV_OVERRIDE {return "opencv_ml_svmsgd";} - virtual void setOptimalParameters(int svmsgdType = ASGD, int marginType = SOFT_MARGIN); + virtual void setOptimalParameters(int svmsgdType = ASGD, int marginType = SOFT_MARGIN) CV_OVERRIDE; - CV_IMPL_PROPERTY(int, SvmsgdType, params.svmsgdType) - CV_IMPL_PROPERTY(int, MarginType, params.marginType) - CV_IMPL_PROPERTY(float, MarginRegularization, params.marginRegularization) - CV_IMPL_PROPERTY(float, InitialStepSize, params.initialStepSize) - CV_IMPL_PROPERTY(float, StepDecreasingPower, params.stepDecreasingPower) - CV_IMPL_PROPERTY_S(cv::TermCriteria, TermCriteria, params.termCrit) + inline int getSvmsgdType() const CV_OVERRIDE { return params.svmsgdType; } + inline void setSvmsgdType(int val) CV_OVERRIDE { params.svmsgdType = val; } + inline int getMarginType() const CV_OVERRIDE { return params.marginType; } + inline void setMarginType(int val) CV_OVERRIDE { params.marginType = val; } + inline float getMarginRegularization() const CV_OVERRIDE { return params.marginRegularization; } + inline void setMarginRegularization(float val) CV_OVERRIDE { params.marginRegularization = val; } + inline float getInitialStepSize() const CV_OVERRIDE { return params.initialStepSize; } + inline void setInitialStepSize(float val) CV_OVERRIDE { params.initialStepSize = val; } + inline float getStepDecreasingPower() const CV_OVERRIDE { return params.stepDecreasingPower; } + inline void setStepDecreasingPower(float val) CV_OVERRIDE { params.stepDecreasingPower = val; } + inline cv::TermCriteria getTermCriteria() const CV_OVERRIDE { return params.termCrit; } + inline void setTermCriteria(const cv::TermCriteria& val) CV_OVERRIDE { params.termCrit = val; } private: void updateWeights(InputArray sample, bool positive, float stepSize, Mat &weights); diff --git a/modules/objdetect/include/opencv2/objdetect.hpp b/modules/objdetect/include/opencv2/objdetect.hpp index 5c6c221afa..eac9cbaf58 100644 --- a/modules/objdetect/include/opencv2/objdetect.hpp +++ b/modules/objdetect/include/opencv2/objdetect.hpp @@ -175,7 +175,7 @@ class CV_EXPORTS_W BaseCascadeClassifier : public Algorithm { public: virtual ~BaseCascadeClassifier(); - virtual bool empty() const = 0; + virtual bool empty() const CV_OVERRIDE = 0; virtual bool load( const String& filename ) = 0; virtual void detectMultiScale( InputArray image, CV_OUT std::vector& objects, diff --git a/modules/objdetect/src/cascadedetect.cpp b/modules/objdetect/src/cascadedetect.cpp index d05c47e06b..6c98eb9299 100644 --- a/modules/objdetect/src/cascadedetect.cpp +++ b/modules/objdetect/src/cascadedetect.cpp @@ -997,7 +997,7 @@ public: mtx = _mtx; } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { CV_INSTRUMENT_REGION() diff --git a/modules/objdetect/src/cascadedetect.hpp b/modules/objdetect/src/cascadedetect.hpp index a69dcad3f3..b19bc1c57f 100644 --- a/modules/objdetect/src/cascadedetect.hpp +++ b/modules/objdetect/src/cascadedetect.hpp @@ -74,22 +74,22 @@ protected: }; -class CascadeClassifierImpl : public BaseCascadeClassifier +class CascadeClassifierImpl CV_FINAL : public BaseCascadeClassifier { public: CascadeClassifierImpl(); - virtual ~CascadeClassifierImpl(); + virtual ~CascadeClassifierImpl() CV_OVERRIDE; - bool empty() const; - bool load( const String& filename ); - void read( const FileNode& node ); + bool empty() const CV_OVERRIDE; + bool load( const String& filename ) CV_OVERRIDE; + void read( const FileNode& node ) CV_OVERRIDE; bool read_( const FileNode& node ); void detectMultiScale( InputArray image, CV_OUT std::vector& objects, double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0, Size minSize = Size(), - Size maxSize = Size() ); + Size maxSize = Size() ) CV_OVERRIDE; void detectMultiScale( InputArray image, CV_OUT std::vector& objects, @@ -97,7 +97,7 @@ public: double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size(), - Size maxSize=Size() ); + Size maxSize=Size() ) CV_OVERRIDE; void detectMultiScale( InputArray image, CV_OUT std::vector& objects, @@ -107,16 +107,16 @@ public: int minNeighbors = 3, int flags = 0, Size minSize = Size(), Size maxSize = Size(), - bool outputRejectLevels = false ); + bool outputRejectLevels = false ) CV_OVERRIDE; - bool isOldFormatCascade() const; - Size getOriginalWindowSize() const; - int getFeatureType() const; - void* getOldCascade(); + bool isOldFormatCascade() const CV_OVERRIDE; + Size getOriginalWindowSize() const CV_OVERRIDE; + int getFeatureType() const CV_OVERRIDE; + void* getOldCascade() CV_OVERRIDE; - void setMaskGenerator(const Ptr& maskGenerator); - Ptr getMaskGenerator(); + void setMaskGenerator(const Ptr& maskGenerator) CV_OVERRIDE; + Ptr getMaskGenerator() CV_OVERRIDE; protected: enum { SUM_ALIGN = 64 }; @@ -311,7 +311,7 @@ protected: #define CALC_SUM_OFS(rect, ptr) CALC_SUM_OFS_((rect)[0], (rect)[1], (rect)[2], (rect)[3], ptr) //---------------------------------------------- HaarEvaluator --------------------------------------- -class HaarEvaluator : public FeatureEvaluator +class HaarEvaluator CV_FINAL : public FeatureEvaluator { public: struct Feature @@ -342,24 +342,24 @@ public: }; HaarEvaluator(); - virtual ~HaarEvaluator(); + virtual ~HaarEvaluator() CV_OVERRIDE; - virtual bool read( const FileNode& node, Size origWinSize); - virtual Ptr clone() const; - virtual int getFeatureType() const { return FeatureEvaluator::HAAR; } + virtual bool read( const FileNode& node, Size origWinSize) CV_OVERRIDE; + virtual Ptr clone() const CV_OVERRIDE; + virtual int getFeatureType() const CV_OVERRIDE { return FeatureEvaluator::HAAR; } - virtual bool setWindow(Point p, int scaleIdx); + virtual bool setWindow(Point p, int scaleIdx) CV_OVERRIDE; Rect getNormRect() const; int getSquaresOffset() const; float operator()(int featureIdx) const { return optfeaturesPtr[featureIdx].calc(pwin) * varianceNormFactor; } - virtual float calcOrd(int featureIdx) const + virtual float calcOrd(int featureIdx) const CV_OVERRIDE { return (*this)(featureIdx); } protected: - virtual void computeChannels( int i, InputArray img ); - virtual void computeOptFeatures(); + virtual void computeChannels( int i, InputArray img ) CV_OVERRIDE; + virtual void computeOptFeatures() CV_OVERRIDE; Ptr > features; Ptr > optfeatures; @@ -403,7 +403,7 @@ inline float HaarEvaluator::OptFeature :: calc( const int* ptr ) const //---------------------------------------------- LBPEvaluator ------------------------------------- -class LBPEvaluator : public FeatureEvaluator +class LBPEvaluator CV_FINAL : public FeatureEvaluator { public: struct Feature @@ -427,21 +427,21 @@ public: }; LBPEvaluator(); - virtual ~LBPEvaluator(); + virtual ~LBPEvaluator() CV_OVERRIDE; - virtual bool read( const FileNode& node, Size origWinSize ); - virtual Ptr clone() const; - virtual int getFeatureType() const { return FeatureEvaluator::LBP; } + virtual bool read( const FileNode& node, Size origWinSize ) CV_OVERRIDE; + virtual Ptr clone() const CV_OVERRIDE; + virtual int getFeatureType() const CV_OVERRIDE { return FeatureEvaluator::LBP; } - virtual bool setWindow(Point p, int scaleIdx); + virtual bool setWindow(Point p, int scaleIdx) CV_OVERRIDE; int operator()(int featureIdx) const { return optfeaturesPtr[featureIdx].calc(pwin); } - virtual int calcCat(int featureIdx) const + virtual int calcCat(int featureIdx) const CV_OVERRIDE { return (*this)(featureIdx); } protected: - virtual void computeChannels( int i, InputArray img ); - virtual void computeOptFeatures(); + virtual void computeChannels( int i, InputArray img ) CV_OVERRIDE; + virtual void computeOptFeatures() CV_OVERRIDE; Ptr > features; Ptr > optfeatures; diff --git a/modules/objdetect/src/haar.cpp b/modules/objdetect/src/haar.cpp index 3b0a151322..33110116b8 100644 --- a/modules/objdetect/src/haar.cpp +++ b/modules/objdetect/src/haar.cpp @@ -957,7 +957,7 @@ public: mtx = _mtx; } - void operator()( const Range& range ) const + void operator()(const Range& range) const CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -1137,7 +1137,7 @@ public: mtx = _mtx; } - void operator()( const Range& range ) const + void operator()(const Range& range) const CV_OVERRIDE { CV_INSTRUMENT_REGION() diff --git a/modules/objdetect/src/hog.cpp b/modules/objdetect/src/hog.cpp index b68b89d6e6..23b710b385 100644 --- a/modules/objdetect/src/hog.cpp +++ b/modules/objdetect/src/hog.cpp @@ -1793,7 +1793,7 @@ public: mtx = _mtx; } - void operator()( const Range& range ) const + void operator()(const Range& range) const CV_OVERRIDE { int i, i1 = range.start, i2 = range.end; double minScale = i1 > 0 ? levelScale[i1] : i2 > 1 ? levelScale[i1+1] : std::max(img.cols, img.rows); @@ -3501,7 +3501,7 @@ public: mtx = _mtx; } - void operator()( const Range& range ) const + void operator()(const Range& range) const CV_OVERRIDE { CV_INSTRUMENT_REGION() diff --git a/modules/photo/include/opencv2/photo.hpp b/modules/photo/include/opencv2/photo.hpp index 487b720fe0..8cd1971899 100644 --- a/modules/photo/include/opencv2/photo.hpp +++ b/modules/photo/include/opencv2/photo.hpp @@ -502,7 +502,7 @@ class CV_EXPORTS_W AlignMTB : public AlignExposures { public: CV_WRAP virtual void process(InputArrayOfArrays src, std::vector& dst, - InputArray times, InputArray response) = 0; + InputArray times, InputArray response) CV_OVERRIDE = 0; /** @brief Short version of process, that doesn't take extra arguments. @@ -646,7 +646,7 @@ class CV_EXPORTS_W MergeDebevec : public MergeExposures { public: CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, - InputArray times, InputArray response) = 0; + InputArray times, InputArray response) CV_OVERRIDE = 0; CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times) = 0; }; @@ -669,7 +669,7 @@ class CV_EXPORTS_W MergeMertens : public MergeExposures { public: CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, - InputArray times, InputArray response) = 0; + InputArray times, InputArray response) CV_OVERRIDE = 0; /** @brief Short version of process, that doesn't take extra arguments. @param src vector of input images @@ -705,7 +705,7 @@ class CV_EXPORTS_W MergeRobertson : public MergeExposures { public: CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, - InputArray times, InputArray response) = 0; + InputArray times, InputArray response) CV_OVERRIDE = 0; CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times) = 0; }; diff --git a/modules/photo/src/align.cpp b/modules/photo/src/align.cpp index 02087117e1..cfb8a5d84b 100644 --- a/modules/photo/src/align.cpp +++ b/modules/photo/src/align.cpp @@ -47,7 +47,7 @@ namespace cv { -class AlignMTBImpl : public AlignMTB +class AlignMTBImpl CV_FINAL : public AlignMTB { public: AlignMTBImpl(int _max_bits, int _exclude_range, bool _cut) : @@ -59,14 +59,14 @@ public: } void process(InputArrayOfArrays src, std::vector& dst, - InputArray, InputArray) + InputArray, InputArray) CV_OVERRIDE { CV_INSTRUMENT_REGION() process(src, dst); } - void process(InputArrayOfArrays _src, std::vector& dst) + void process(InputArrayOfArrays _src, std::vector& dst) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -116,7 +116,7 @@ public: } } - Point calculateShift(InputArray _img0, InputArray _img1) + Point calculateShift(InputArray _img0, InputArray _img1) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -164,7 +164,7 @@ public: return shift; } - void shiftMat(InputArray _src, OutputArray _dst, const Point shift) + void shiftMat(InputArray _src, OutputArray _dst, const Point shift) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -181,16 +181,16 @@ public: res.copyTo(dst); } - int getMaxBits() const { return max_bits; } - void setMaxBits(int val) { max_bits = val; } + int getMaxBits() const CV_OVERRIDE { return max_bits; } + void setMaxBits(int val) CV_OVERRIDE { max_bits = val; } - int getExcludeRange() const { return exclude_range; } - void setExcludeRange(int val) { exclude_range = val; } + int getExcludeRange() const CV_OVERRIDE { return exclude_range; } + void setExcludeRange(int val) CV_OVERRIDE { exclude_range = val; } - bool getCut() const { return cut; } - void setCut(bool val) { cut = val; } + bool getCut() const CV_OVERRIDE { return cut; } + void setCut(bool val) CV_OVERRIDE { cut = val; } - void write(FileStorage& fs) const + void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name @@ -199,7 +199,7 @@ public: << "cut" << static_cast(cut); } - void read(const FileNode& fn) + void read(const FileNode& fn) CV_OVERRIDE { FileNode n = fn["name"]; CV_Assert(n.isString() && String(n) == name); @@ -209,7 +209,7 @@ public: cut = (cut_val != 0); } - void computeBitmaps(InputArray _img, OutputArray _tb, OutputArray _eb) + void computeBitmaps(InputArray _img, OutputArray _tb, OutputArray _eb) CV_OVERRIDE { CV_INSTRUMENT_REGION() diff --git a/modules/photo/src/calibrate.cpp b/modules/photo/src/calibrate.cpp index a17f138bd3..088cfbb6e0 100644 --- a/modules/photo/src/calibrate.cpp +++ b/modules/photo/src/calibrate.cpp @@ -48,7 +48,7 @@ namespace cv { -class CalibrateDebevecImpl : public CalibrateDebevec +class CalibrateDebevecImpl CV_FINAL : public CalibrateDebevec { public: CalibrateDebevecImpl(int _samples, float _lambda, bool _random) : @@ -60,7 +60,7 @@ public: { } - void process(InputArrayOfArrays src, OutputArray dst, InputArray _times) + void process(InputArrayOfArrays src, OutputArray dst, InputArray _times) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -158,16 +158,16 @@ public: exp(result, result); } - int getSamples() const { return samples; } - void setSamples(int val) { samples = val; } + int getSamples() const CV_OVERRIDE { return samples; } + void setSamples(int val) CV_OVERRIDE { samples = val; } - float getLambda() const { return lambda; } - void setLambda(float val) { lambda = val; } + float getLambda() const CV_OVERRIDE { return lambda; } + void setLambda(float val) CV_OVERRIDE { lambda = val; } - bool getRandom() const { return random; } - void setRandom(bool val) { random = val; } + bool getRandom() const CV_OVERRIDE { return random; } + void setRandom(bool val) CV_OVERRIDE { random = val; } - void write(FileStorage& fs) const + void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name @@ -176,7 +176,7 @@ public: << "random" << static_cast(random); } - void read(const FileNode& fn) + void read(const FileNode& fn) CV_OVERRIDE { FileNode n = fn["name"]; CV_Assert(n.isString() && String(n) == name); @@ -199,7 +199,7 @@ Ptr createCalibrateDebevec(int samples, float lambda, bool ran return makePtr(samples, lambda, random); } -class CalibrateRobertsonImpl : public CalibrateRobertson +class CalibrateRobertsonImpl CV_FINAL : public CalibrateRobertson { public: CalibrateRobertsonImpl(int _max_iter, float _threshold) : @@ -210,7 +210,7 @@ public: { } - void process(InputArrayOfArrays src, OutputArray dst, InputArray _times) + void process(InputArrayOfArrays src, OutputArray dst, InputArray _times) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -272,15 +272,15 @@ public: } } - int getMaxIter() const { return max_iter; } - void setMaxIter(int val) { max_iter = val; } + int getMaxIter() const CV_OVERRIDE { return max_iter; } + void setMaxIter(int val) CV_OVERRIDE { max_iter = val; } - float getThreshold() const { return threshold; } - void setThreshold(float val) { threshold = val; } + float getThreshold() const CV_OVERRIDE { return threshold; } + void setThreshold(float val) CV_OVERRIDE { threshold = val; } - Mat getRadiance() const { return radiance; } + Mat getRadiance() const CV_OVERRIDE { return radiance; } - void write(FileStorage& fs) const + void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name @@ -288,7 +288,7 @@ public: << "threshold" << threshold; } - 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/photo/src/fast_nlmeans_denoising_invoker.hpp b/modules/photo/src/fast_nlmeans_denoising_invoker.hpp index b875ebc92d..1c71e107de 100644 --- a/modules/photo/src/fast_nlmeans_denoising_invoker.hpp +++ b/modules/photo/src/fast_nlmeans_denoising_invoker.hpp @@ -58,7 +58,7 @@ public: FastNlMeansDenoisingInvoker(const Mat& src, Mat& dst, int template_window_size, int search_window_size, const float *h); - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; private: void operator= (const FastNlMeansDenoisingInvoker&); diff --git a/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp b/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp index 3f13f400d5..4c0c784eec 100644 --- a/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp +++ b/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp @@ -59,7 +59,7 @@ public: int temporalWindowSize, Mat& dst, int template_window_size, int search_window_size, const float *h); - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; private: void operator= (const FastNlMeansMultiDenoisingInvoker&); diff --git a/modules/photo/src/merge.cpp b/modules/photo/src/merge.cpp index d04e7b8acc..77f919c11d 100644 --- a/modules/photo/src/merge.cpp +++ b/modules/photo/src/merge.cpp @@ -47,7 +47,7 @@ namespace cv { -class MergeDebevecImpl : public MergeDebevec +class MergeDebevecImpl CV_FINAL : public MergeDebevec { public: MergeDebevecImpl() : @@ -56,7 +56,7 @@ public: { } - void process(InputArrayOfArrays src, OutputArray dst, InputArray _times, InputArray input_response) + void process(InputArrayOfArrays src, OutputArray dst, InputArray _times, InputArray input_response) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -122,7 +122,7 @@ public: exp(result, result); } - void process(InputArrayOfArrays src, OutputArray dst, InputArray times) + void process(InputArrayOfArrays src, OutputArray dst, InputArray times) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -139,7 +139,7 @@ Ptr createMergeDebevec() return makePtr(); } -class MergeMertensImpl : public MergeMertens +class MergeMertensImpl CV_FINAL : public MergeMertens { public: MergeMertensImpl(float _wcon, float _wsat, float _wexp) : @@ -150,14 +150,14 @@ public: { } - void process(InputArrayOfArrays src, OutputArrayOfArrays dst, InputArray, InputArray) + void process(InputArrayOfArrays src, OutputArrayOfArrays dst, InputArray, InputArray) CV_OVERRIDE { CV_INSTRUMENT_REGION() process(src, dst); } - void process(InputArrayOfArrays src, OutputArray dst) + void process(InputArrayOfArrays src, OutputArray dst) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -262,16 +262,16 @@ public: res_pyr[0].copyTo(dst.getMat()); } - float getContrastWeight() const { return wcon; } - void setContrastWeight(float val) { wcon = val; } + float getContrastWeight() const CV_OVERRIDE { return wcon; } + void setContrastWeight(float val) CV_OVERRIDE { wcon = val; } - float getSaturationWeight() const { return wsat; } - void setSaturationWeight(float val) { wsat = val; } + float getSaturationWeight() const CV_OVERRIDE { return wsat; } + void setSaturationWeight(float val) CV_OVERRIDE { wsat = val; } - float getExposureWeight() const { return wexp; } - void setExposureWeight(float val) { wexp = val; } + float getExposureWeight() const CV_OVERRIDE { return wexp; } + void setExposureWeight(float val) CV_OVERRIDE { wexp = val; } - void write(FileStorage& fs) const + void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name @@ -280,7 +280,7 @@ public: << "exposure_weight" << wexp; } - void read(const FileNode& fn) + void read(const FileNode& fn) CV_OVERRIDE { FileNode n = fn["name"]; CV_Assert(n.isString() && String(n) == name); @@ -299,7 +299,7 @@ Ptr createMergeMertens(float wcon, float wsat, float wexp) return makePtr(wcon, wsat, wexp); } -class MergeRobertsonImpl : public MergeRobertson +class MergeRobertsonImpl CV_FINAL : public MergeRobertson { public: MergeRobertsonImpl() : @@ -308,7 +308,7 @@ public: { } - void process(InputArrayOfArrays src, OutputArray dst, InputArray _times, InputArray input_response) + void process(InputArrayOfArrays src, OutputArray dst, InputArray _times, InputArray input_response) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -347,7 +347,7 @@ public: result = result.mul(1 / wsum); } - void process(InputArrayOfArrays src, OutputArray dst, InputArray times) + void process(InputArrayOfArrays src, OutputArray dst, InputArray times) CV_OVERRIDE { CV_INSTRUMENT_REGION() diff --git a/modules/photo/src/tonemap.cpp b/modules/photo/src/tonemap.cpp index 4907c1ef12..2911fc55c8 100644 --- a/modules/photo/src/tonemap.cpp +++ b/modules/photo/src/tonemap.cpp @@ -53,14 +53,14 @@ inline void log_(const Mat& src, Mat& dst) log(dst, dst); } -class TonemapImpl : public Tonemap +class TonemapImpl CV_FINAL : public Tonemap { public: TonemapImpl(float _gamma) : name("Tonemap"), gamma(_gamma) { } - void process(InputArray _src, OutputArray _dst) + void process(InputArray _src, OutputArray _dst) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -80,17 +80,17 @@ public: pow(dst, 1.0f / gamma, dst); } - float getGamma() const { return gamma; } - void setGamma(float val) { gamma = val; } + float getGamma() const CV_OVERRIDE { return gamma; } + void setGamma(float val) CV_OVERRIDE { gamma = val; } - void write(FileStorage& fs) const + void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name << "gamma" << gamma; } - void read(const FileNode& fn) + void read(const FileNode& fn) CV_OVERRIDE { FileNode n = fn["name"]; CV_Assert(n.isString() && String(n) == name); @@ -107,7 +107,7 @@ Ptr createTonemap(float gamma) return makePtr(gamma); } -class TonemapDragoImpl : public TonemapDrago +class TonemapDragoImpl CV_FINAL : public TonemapDrago { public: TonemapDragoImpl(float _gamma, float _saturation, float _bias) : @@ -118,7 +118,7 @@ public: { } - void process(InputArray _src, OutputArray _dst) + void process(InputArray _src, OutputArray _dst) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -155,16 +155,16 @@ public: linear->process(img, img); } - float getGamma() const { return gamma; } - void setGamma(float val) { gamma = val; } + float getGamma() const CV_OVERRIDE { return gamma; } + void setGamma(float val) CV_OVERRIDE { gamma = val; } - float getSaturation() const { return saturation; } - void setSaturation(float val) { saturation = val; } + float getSaturation() const CV_OVERRIDE { return saturation; } + void setSaturation(float val) CV_OVERRIDE { saturation = val; } - float getBias() const { return bias; } - void setBias(float val) { bias = val; } + float getBias() const CV_OVERRIDE { return bias; } + void setBias(float val) CV_OVERRIDE { bias = val; } - void write(FileStorage& fs) const + void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name @@ -173,7 +173,7 @@ public: << "saturation" << saturation; } - void read(const FileNode& fn) + void read(const FileNode& fn) CV_OVERRIDE { FileNode n = fn["name"]; CV_Assert(n.isString() && String(n) == name); @@ -192,7 +192,7 @@ Ptr createTonemapDrago(float gamma, float saturation, float bias) return makePtr(gamma, saturation, bias); } -class TonemapDurandImpl : public TonemapDurand +class TonemapDurandImpl CV_FINAL : public TonemapDurand { public: TonemapDurandImpl(float _gamma, float _contrast, float _saturation, float _sigma_color, float _sigma_space) : @@ -205,7 +205,7 @@ public: { } - void process(InputArray _src, OutputArray _dst) + void process(InputArray _src, OutputArray _dst) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -233,22 +233,22 @@ public: pow(img, 1.0f / gamma, img); } - float getGamma() const { return gamma; } - void setGamma(float val) { gamma = val; } + float getGamma() const CV_OVERRIDE { return gamma; } + void setGamma(float val) CV_OVERRIDE { gamma = val; } - float getSaturation() const { return saturation; } - void setSaturation(float val) { saturation = val; } + float getSaturation() const CV_OVERRIDE { return saturation; } + void setSaturation(float val) CV_OVERRIDE { saturation = val; } - float getContrast() const { return contrast; } - void setContrast(float val) { contrast = val; } + float getContrast() const CV_OVERRIDE { return contrast; } + void setContrast(float val) CV_OVERRIDE { contrast = val; } - float getSigmaColor() const { return sigma_color; } - void setSigmaColor(float val) { sigma_color = val; } + float getSigmaColor() const CV_OVERRIDE { return sigma_color; } + void setSigmaColor(float val) CV_OVERRIDE { sigma_color = val; } - float getSigmaSpace() const { return sigma_space; } - void setSigmaSpace(float val) { sigma_space = val; } + float getSigmaSpace() const CV_OVERRIDE { return sigma_space; } + void setSigmaSpace(float val) CV_OVERRIDE { sigma_space = val; } - void write(FileStorage& fs) const + void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name @@ -259,7 +259,7 @@ public: << "saturation" << saturation; } - void read(const FileNode& fn) + void read(const FileNode& fn) CV_OVERRIDE { FileNode n = fn["name"]; CV_Assert(n.isString() && String(n) == name); @@ -280,7 +280,7 @@ Ptr createTonemapDurand(float gamma, float contrast, float satura return makePtr(gamma, contrast, saturation, sigma_color, sigma_space); } -class TonemapReinhardImpl : public TonemapReinhard +class TonemapReinhardImpl CV_FINAL : public TonemapReinhard { public: TonemapReinhardImpl(float _gamma, float _intensity, float _light_adapt, float _color_adapt) : @@ -292,7 +292,7 @@ public: { } - void process(InputArray _src, OutputArray _dst) + void process(InputArray _src, OutputArray _dst) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -336,19 +336,19 @@ public: linear->process(img, img); } - float getGamma() const { return gamma; } - void setGamma(float val) { gamma = val; } + float getGamma() const CV_OVERRIDE { return gamma; } + void setGamma(float val) CV_OVERRIDE { gamma = val; } - float getIntensity() const { return intensity; } - void setIntensity(float val) { intensity = val; } + float getIntensity() const CV_OVERRIDE { return intensity; } + void setIntensity(float val) CV_OVERRIDE { intensity = val; } - float getLightAdaptation() const { return light_adapt; } - void setLightAdaptation(float val) { light_adapt = val; } + float getLightAdaptation() const CV_OVERRIDE { return light_adapt; } + void setLightAdaptation(float val) CV_OVERRIDE { light_adapt = val; } - float getColorAdaptation() const { return color_adapt; } - void setColorAdaptation(float val) { color_adapt = val; } + float getColorAdaptation() const CV_OVERRIDE { return color_adapt; } + void setColorAdaptation(float val) CV_OVERRIDE { color_adapt = val; } - void write(FileStorage& fs) const + void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name @@ -358,7 +358,7 @@ public: << "color_adapt" << color_adapt; } - void read(const FileNode& fn) + void read(const FileNode& fn) CV_OVERRIDE { FileNode n = fn["name"]; CV_Assert(n.isString() && String(n) == name); @@ -378,7 +378,7 @@ Ptr createTonemapReinhard(float gamma, float contrast, float si return makePtr(gamma, contrast, sigma_color, sigma_space); } -class TonemapMantiukImpl : public TonemapMantiuk +class TonemapMantiukImpl CV_FINAL : public TonemapMantiuk { public: TonemapMantiukImpl(float _gamma, float _scale, float _saturation) : @@ -389,7 +389,7 @@ public: { } - void process(InputArray _src, OutputArray _dst) + void process(InputArray _src, OutputArray _dst) CV_OVERRIDE { CV_INSTRUMENT_REGION() @@ -449,16 +449,16 @@ public: linear->process(img, img); } - float getGamma() const { return gamma; } - void setGamma(float val) { gamma = val; } + float getGamma() const CV_OVERRIDE { return gamma; } + void setGamma(float val) CV_OVERRIDE { gamma = val; } - float getScale() const { return scale; } - void setScale(float val) { scale = val; } + float getScale() const CV_OVERRIDE { return scale; } + void setScale(float val) CV_OVERRIDE { scale = val; } - float getSaturation() const { return saturation; } - void setSaturation(float val) { saturation = val; } + float getSaturation() const CV_OVERRIDE { return saturation; } + void setSaturation(float val) CV_OVERRIDE { saturation = val; } - void write(FileStorage& fs) const + void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name @@ -467,7 +467,7 @@ public: << "saturation" << saturation; } - 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/python/src2/cv2.cpp b/modules/python/src2/cv2.cpp index 8ed6478bcc..63b631d399 100644 --- a/modules/python/src2/cv2.cpp +++ b/modules/python/src2/cv2.cpp @@ -158,7 +158,7 @@ public: return u; } - UMatData* allocate(int dims0, const int* sizes, int type, void* data, size_t* step, int flags, UMatUsageFlags usageFlags) const + UMatData* allocate(int dims0, const int* sizes, int type, void* data, size_t* step, int flags, UMatUsageFlags usageFlags) const CV_OVERRIDE { if( data != 0 ) { @@ -187,12 +187,12 @@ public: return allocate(o, dims0, sizes, type, step); } - bool allocate(UMatData* u, int accessFlags, UMatUsageFlags usageFlags) const + bool allocate(UMatData* u, int accessFlags, UMatUsageFlags usageFlags) const CV_OVERRIDE { return stdAllocator->allocate(u, accessFlags, usageFlags); } - void deallocate(UMatData* u) const + void deallocate(UMatData* u) const CV_OVERRIDE { if(!u) return; diff --git a/modules/shape/src/aff_trans.cpp b/modules/shape/src/aff_trans.cpp index 888d63483b..3316f0f41f 100644 --- a/modules/shape/src/aff_trans.cpp +++ b/modules/shape/src/aff_trans.cpp @@ -69,24 +69,24 @@ public: } //! the main operator - virtual void estimateTransformation(InputArray transformingShape, InputArray targetShape, std::vector &matches); - virtual float applyTransformation(InputArray input, OutputArray output=noArray()); + virtual void estimateTransformation(InputArray transformingShape, InputArray targetShape, std::vector &matches) CV_OVERRIDE; + virtual float applyTransformation(InputArray input, OutputArray output=noArray()) CV_OVERRIDE; virtual void warpImage(InputArray transformingImage, OutputArray output, - int flags, int borderMode, const Scalar& borderValue) const; + int flags, int borderMode, const Scalar& borderValue) const CV_OVERRIDE; //! Setters/Getters - virtual void setFullAffine(bool _fullAffine) {fullAffine=_fullAffine;} - virtual bool getFullAffine() const {return fullAffine;} + virtual void setFullAffine(bool _fullAffine) CV_OVERRIDE {fullAffine=_fullAffine;} + virtual bool getFullAffine() const CV_OVERRIDE {return fullAffine;} //! write/read - virtual void write(FileStorage& fs) const + virtual void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name_ << "affine_type" << int(fullAffine); } - virtual void read(const FileNode& fn) + virtual void read(const FileNode& fn) CV_OVERRIDE { CV_Assert( (String)fn["name"] == name_ ); fullAffine = int(fn["affine_type"])?true:false; diff --git a/modules/shape/src/haus_dis.cpp b/modules/shape/src/haus_dis.cpp index 732f288946..0f3126792e 100644 --- a/modules/shape/src/haus_dis.cpp +++ b/modules/shape/src/haus_dis.cpp @@ -44,7 +44,7 @@ namespace cv { -class HausdorffDistanceExtractorImpl : public HausdorffDistanceExtractor +class HausdorffDistanceExtractorImpl CV_FINAL : public HausdorffDistanceExtractor { public: /* Constructor */ @@ -61,21 +61,21 @@ public: } //! the main operator - virtual float computeDistance(InputArray contour1, InputArray contour2); + virtual float computeDistance(InputArray contour1, InputArray contour2) CV_OVERRIDE; //! Setters/Getters - virtual void setDistanceFlag(int _distanceFlag) {distanceFlag=_distanceFlag;} - virtual int getDistanceFlag() const {return distanceFlag;} + virtual void setDistanceFlag(int _distanceFlag) CV_OVERRIDE {distanceFlag=_distanceFlag;} + virtual int getDistanceFlag() const CV_OVERRIDE {return distanceFlag;} - virtual void setRankProportion(float _rankProportion) + virtual void setRankProportion(float _rankProportion) CV_OVERRIDE { CV_Assert((_rankProportion>0) && (_rankProportion<=1)); rankProportion=_rankProportion; } - virtual float getRankProportion() const {return rankProportion;} + virtual float getRankProportion() const CV_OVERRIDE {return rankProportion;} //! write/read - virtual void write(FileStorage& fs) const + virtual void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name_ @@ -83,7 +83,7 @@ public: << "rank" << rankProportion; } - virtual void read(const FileNode& fn) + virtual void read(const FileNode& fn) CV_OVERRIDE { CV_Assert( (String)fn["name"] == name_ ); distanceFlag = (int)fn["distance"]; diff --git a/modules/shape/src/hist_cost.cpp b/modules/shape/src/hist_cost.cpp index db1d42e562..902a199ad6 100644 --- a/modules/shape/src/hist_cost.cpp +++ b/modules/shape/src/hist_cost.cpp @@ -45,7 +45,7 @@ namespace cv { /*! */ -class NormHistogramCostExtractorImpl : public NormHistogramCostExtractor +class NormHistogramCostExtractorImpl CV_FINAL : public NormHistogramCostExtractor { public: /* Constructors */ @@ -58,46 +58,46 @@ public: } /* Destructor */ - ~NormHistogramCostExtractorImpl() + ~NormHistogramCostExtractorImpl() CV_OVERRIDE { } //! the main operator - virtual void buildCostMatrix(InputArray descriptors1, InputArray descriptors2, OutputArray costMatrix); + virtual void buildCostMatrix(InputArray descriptors1, InputArray descriptors2, OutputArray costMatrix) CV_OVERRIDE; //! Setters/Getters - void setNDummies(int _nDummies) + void setNDummies(int _nDummies) CV_OVERRIDE { nDummies=_nDummies; } - int getNDummies() const + int getNDummies() const CV_OVERRIDE { return nDummies; } - void setDefaultCost(float _defaultCost) + void setDefaultCost(float _defaultCost) CV_OVERRIDE { defaultCost=_defaultCost; } - float getDefaultCost() const + float getDefaultCost() const CV_OVERRIDE { return defaultCost; } - virtual void setNormFlag(int _flag) + virtual void setNormFlag(int _flag) CV_OVERRIDE { flag=_flag; } - virtual int getNormFlag() const + virtual int getNormFlag() const CV_OVERRIDE { return flag; } //! write/read - virtual void write(FileStorage& fs) const + virtual void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name_ @@ -106,7 +106,7 @@ public: << "default" << defaultCost; } - virtual void read(const FileNode& fn) + virtual void read(const FileNode& fn) CV_OVERRIDE { CV_Assert( (String)fn["name"] == name_ ); flag = (int)fn["flag"]; @@ -173,7 +173,7 @@ Ptr createNormHistogramCostExtractor(int flag, int nDum } /*! */ -class EMDHistogramCostExtractorImpl : public EMDHistogramCostExtractor +class EMDHistogramCostExtractorImpl CV_FINAL : public EMDHistogramCostExtractor { public: /* Constructors */ @@ -186,46 +186,46 @@ public: } /* Destructor */ - ~EMDHistogramCostExtractorImpl() + ~EMDHistogramCostExtractorImpl() CV_OVERRIDE { } //! the main operator - virtual void buildCostMatrix(InputArray descriptors1, InputArray descriptors2, OutputArray costMatrix); + virtual void buildCostMatrix(InputArray descriptors1, InputArray descriptors2, OutputArray costMatrix) CV_OVERRIDE; //! Setters/Getters - void setNDummies(int _nDummies) + void setNDummies(int _nDummies) CV_OVERRIDE { nDummies=_nDummies; } - int getNDummies() const + int getNDummies() const CV_OVERRIDE { return nDummies; } - void setDefaultCost(float _defaultCost) + void setDefaultCost(float _defaultCost) CV_OVERRIDE { defaultCost=_defaultCost; } - float getDefaultCost() const + float getDefaultCost() const CV_OVERRIDE { return defaultCost; } - virtual void setNormFlag(int _flag) + virtual void setNormFlag(int _flag) CV_OVERRIDE { flag=_flag; } - virtual int getNormFlag() const + virtual int getNormFlag() const CV_OVERRIDE { return flag; } //! write/read - virtual void write(FileStorage& fs) const + virtual void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name_ @@ -234,7 +234,7 @@ public: << "default" << defaultCost; } - virtual void read(const FileNode& fn) + virtual void read(const FileNode& fn) CV_OVERRIDE { CV_Assert( (String)fn["name"] == name_ ); flag = (int)fn["flag"]; @@ -313,7 +313,7 @@ Ptr createEMDHistogramCostExtractor(int flag, int nDumm } /*! */ -class ChiHistogramCostExtractorImpl : public ChiHistogramCostExtractor +class ChiHistogramCostExtractorImpl CV_FINAL : public ChiHistogramCostExtractor { public: /* Constructors */ @@ -325,36 +325,36 @@ public: } /* Destructor */ - ~ChiHistogramCostExtractorImpl() + ~ChiHistogramCostExtractorImpl() CV_OVERRIDE { } //! the main operator - virtual void buildCostMatrix(InputArray descriptors1, InputArray descriptors2, OutputArray costMatrix); + virtual void buildCostMatrix(InputArray descriptors1, InputArray descriptors2, OutputArray costMatrix) CV_OVERRIDE; //! setters / getters - void setNDummies(int _nDummies) + void setNDummies(int _nDummies) CV_OVERRIDE { nDummies=_nDummies; } - int getNDummies() const + int getNDummies() const CV_OVERRIDE { return nDummies; } - void setDefaultCost(float _defaultCost) + void setDefaultCost(float _defaultCost) CV_OVERRIDE { defaultCost=_defaultCost; } - float getDefaultCost() const + float getDefaultCost() const CV_OVERRIDE { return defaultCost; } //! write/read - virtual void write(FileStorage& fs) const + virtual void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name_ @@ -362,7 +362,7 @@ public: << "default" << defaultCost; } - virtual void read(const FileNode& fn) + virtual void read(const FileNode& fn) CV_OVERRIDE { CV_Assert( (String)fn["name"] == name_ ); nDummies = (int)fn["dummies"]; @@ -432,7 +432,7 @@ Ptr createChiHistogramCostExtractor(int nDummies, float } /*! */ -class EMDL1HistogramCostExtractorImpl : public EMDL1HistogramCostExtractor +class EMDL1HistogramCostExtractorImpl CV_FINAL : public EMDL1HistogramCostExtractor { public: /* Constructors */ @@ -444,36 +444,36 @@ public: } /* Destructor */ - ~EMDL1HistogramCostExtractorImpl() + ~EMDL1HistogramCostExtractorImpl() CV_OVERRIDE { } //! the main operator - virtual void buildCostMatrix(InputArray descriptors1, InputArray descriptors2, OutputArray costMatrix); + virtual void buildCostMatrix(InputArray descriptors1, InputArray descriptors2, OutputArray costMatrix) CV_OVERRIDE; //! setters / getters - void setNDummies(int _nDummies) + void setNDummies(int _nDummies) CV_OVERRIDE { nDummies=_nDummies; } - int getNDummies() const + int getNDummies() const CV_OVERRIDE { return nDummies; } - void setDefaultCost(float _defaultCost) + void setDefaultCost(float _defaultCost) CV_OVERRIDE { defaultCost=_defaultCost; } - float getDefaultCost() const + float getDefaultCost() const CV_OVERRIDE { return defaultCost; } //! write/read - virtual void write(FileStorage& fs) const + virtual void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name_ @@ -481,7 +481,7 @@ public: << "default" << defaultCost; } - virtual void read(const FileNode& fn) + virtual void read(const FileNode& fn) CV_OVERRIDE { CV_Assert( (String)fn["name"] == name_ ); nDummies = (int)fn["dummies"]; diff --git a/modules/shape/src/sc_dis.cpp b/modules/shape/src/sc_dis.cpp index 2b174d414e..26dd459378 100644 --- a/modules/shape/src/sc_dis.cpp +++ b/modules/shape/src/sc_dis.cpp @@ -76,45 +76,45 @@ public: } /* Destructor */ - ~ShapeContextDistanceExtractorImpl() + ~ShapeContextDistanceExtractorImpl() CV_OVERRIDE { } //! the main operator - virtual float computeDistance(InputArray contour1, InputArray contour2); + virtual float computeDistance(InputArray contour1, InputArray contour2) CV_OVERRIDE; //! Setters/Getters - virtual void setAngularBins(int _nAngularBins){CV_Assert(_nAngularBins>0); nAngularBins=_nAngularBins;} - virtual int getAngularBins() const {return nAngularBins;} + virtual void setAngularBins(int _nAngularBins) CV_OVERRIDE { CV_Assert(_nAngularBins>0); nAngularBins=_nAngularBins; } + virtual int getAngularBins() const CV_OVERRIDE { return nAngularBins; } - virtual void setRadialBins(int _nRadialBins){CV_Assert(_nRadialBins>0); nRadialBins=_nRadialBins;} - virtual int getRadialBins() const {return nRadialBins;} + virtual void setRadialBins(int _nRadialBins) CV_OVERRIDE { CV_Assert(_nRadialBins>0); nRadialBins=_nRadialBins; } + virtual int getRadialBins() const CV_OVERRIDE { return nRadialBins; } - virtual void setInnerRadius(float _innerRadius) {CV_Assert(_innerRadius>0); innerRadius=_innerRadius;} - virtual float getInnerRadius() const {return innerRadius;} + virtual void setInnerRadius(float _innerRadius) CV_OVERRIDE { CV_Assert(_innerRadius>0); innerRadius=_innerRadius; } + virtual float getInnerRadius() const CV_OVERRIDE { return innerRadius; } - virtual void setOuterRadius(float _outerRadius) {CV_Assert(_outerRadius>0); outerRadius=_outerRadius;} - virtual float getOuterRadius() const {return outerRadius;} + virtual void setOuterRadius(float _outerRadius) CV_OVERRIDE { CV_Assert(_outerRadius>0); outerRadius=_outerRadius; } + virtual float getOuterRadius() const CV_OVERRIDE { return outerRadius; } - virtual void setRotationInvariant(bool _rotationInvariant) {rotationInvariant=_rotationInvariant;} - virtual bool getRotationInvariant() const {return rotationInvariant;} + virtual void setRotationInvariant(bool _rotationInvariant) CV_OVERRIDE { rotationInvariant=_rotationInvariant; } + virtual bool getRotationInvariant() const CV_OVERRIDE { return rotationInvariant; } - virtual void setCostExtractor(Ptr _comparer) { comparer = _comparer; } - virtual Ptr getCostExtractor() const { return comparer; } + virtual void setCostExtractor(Ptr _comparer) CV_OVERRIDE { comparer = _comparer; } + virtual Ptr getCostExtractor() const CV_OVERRIDE { return comparer; } - virtual void setShapeContextWeight(float _shapeContextWeight) {shapeContextWeight=_shapeContextWeight;} - virtual float getShapeContextWeight() const {return shapeContextWeight;} + virtual void setShapeContextWeight(float _shapeContextWeight) CV_OVERRIDE { shapeContextWeight=_shapeContextWeight; } + virtual float getShapeContextWeight() const CV_OVERRIDE { return shapeContextWeight; } - virtual void setImageAppearanceWeight(float _imageAppearanceWeight) {imageAppearanceWeight=_imageAppearanceWeight;} - virtual float getImageAppearanceWeight() const {return imageAppearanceWeight;} + virtual void setImageAppearanceWeight(float _imageAppearanceWeight) CV_OVERRIDE { imageAppearanceWeight=_imageAppearanceWeight; } + virtual float getImageAppearanceWeight() const CV_OVERRIDE { return imageAppearanceWeight; } - virtual void setBendingEnergyWeight(float _bendingEnergyWeight) {bendingEnergyWeight=_bendingEnergyWeight;} - virtual float getBendingEnergyWeight() const {return bendingEnergyWeight;} + virtual void setBendingEnergyWeight(float _bendingEnergyWeight) CV_OVERRIDE { bendingEnergyWeight=_bendingEnergyWeight; } + virtual float getBendingEnergyWeight() const CV_OVERRIDE { return bendingEnergyWeight; } - virtual void setStdDev(float _sigma) {sigma=_sigma;} - virtual float getStdDev() const {return sigma;} + virtual void setStdDev(float _sigma) CV_OVERRIDE { sigma=_sigma; } + virtual float getStdDev() const CV_OVERRIDE { return sigma; } - virtual void setImages(InputArray _image1, InputArray _image2) + virtual void setImages(InputArray _image1, InputArray _image2) CV_OVERRIDE { Mat image1_=_image1.getMat(), image2_=_image2.getMat(); CV_Assert((image1_.depth()==0) && (image2_.depth()==0)); @@ -122,21 +122,21 @@ public: image2=image2_; } - virtual void getImages(OutputArray _image1, OutputArray _image2) const + virtual void getImages(OutputArray _image1, OutputArray _image2) const CV_OVERRIDE { CV_Assert((!image1.empty()) && (!image2.empty())); image1.copyTo(_image1); image2.copyTo(_image2); } - virtual void setIterations(int _iterations) {CV_Assert(_iterations>0); iterations=_iterations;} - virtual int getIterations() const {return iterations;} + virtual void setIterations(int _iterations) CV_OVERRIDE {CV_Assert(_iterations>0); iterations=_iterations;} + virtual int getIterations() const CV_OVERRIDE {return iterations;} - virtual void setTransformAlgorithm(Ptr _transformer) {transformer=_transformer;} - virtual Ptr getTransformAlgorithm() const {return transformer;} + virtual void setTransformAlgorithm(Ptr _transformer) CV_OVERRIDE {transformer=_transformer;} + virtual Ptr getTransformAlgorithm() const CV_OVERRIDE {return transformer;} //! write/read - virtual void write(FileStorage& fs) const + virtual void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name_ @@ -153,7 +153,7 @@ public: << "sigma" << sigma; } - virtual void read(const FileNode& fn) + virtual void read(const FileNode& fn) CV_OVERRIDE { CV_Assert( (String)fn["name"] == name_ ); nRadialBins = (int)fn["nRads"]; diff --git a/modules/shape/src/tps_trans.cpp b/modules/shape/src/tps_trans.cpp index 371562b70b..19031be201 100644 --- a/modules/shape/src/tps_trans.cpp +++ b/modules/shape/src/tps_trans.cpp @@ -45,7 +45,7 @@ namespace cv { -class ThinPlateSplineShapeTransformerImpl : public ThinPlateSplineShapeTransformer +class ThinPlateSplineShapeTransformerImpl CV_FINAL : public ThinPlateSplineShapeTransformer { public: /* Constructors */ @@ -66,29 +66,29 @@ public: } /* Destructor */ - ~ThinPlateSplineShapeTransformerImpl() + ~ThinPlateSplineShapeTransformerImpl() CV_OVERRIDE { } //! the main operators - virtual void estimateTransformation(InputArray transformingShape, InputArray targetShape, std::vector &matches); - virtual float applyTransformation(InputArray inPts, OutputArray output=noArray()); + virtual void estimateTransformation(InputArray transformingShape, InputArray targetShape, std::vector &matches) CV_OVERRIDE; + virtual float applyTransformation(InputArray inPts, OutputArray output=noArray()) CV_OVERRIDE; virtual void warpImage(InputArray transformingImage, OutputArray output, - int flags, int borderMode, const Scalar& borderValue) const; + int flags, int borderMode, const Scalar& borderValue) const CV_OVERRIDE; //! Setters/Getters - virtual void setRegularizationParameter(double _regularizationParameter) {regularizationParameter=_regularizationParameter;} - virtual double getRegularizationParameter() const {return regularizationParameter;} + virtual void setRegularizationParameter(double _regularizationParameter) CV_OVERRIDE { regularizationParameter=_regularizationParameter; } + virtual double getRegularizationParameter() const CV_OVERRIDE { return regularizationParameter; } //! write/read - virtual void write(FileStorage& fs) const + virtual void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name_ << "regularization" << regularizationParameter; } - virtual void read(const FileNode& fn) + virtual void read(const FileNode& fn) CV_OVERRIDE { CV_Assert( (String)fn["name"] == name_ ); regularizationParameter = (int)fn["regularization"]; diff --git a/modules/stitching/include/opencv2/stitching/detail/blenders.hpp b/modules/stitching/include/opencv2/stitching/detail/blenders.hpp index c89e00346a..07473d459e 100644 --- a/modules/stitching/include/opencv2/stitching/detail/blenders.hpp +++ b/modules/stitching/include/opencv2/stitching/detail/blenders.hpp @@ -104,9 +104,9 @@ public: float sharpness() const { return sharpness_; } void setSharpness(float val) { sharpness_ = val; } - void prepare(Rect dst_roi); - void feed(InputArray img, InputArray mask, Point tl); - void blend(InputOutputArray dst, InputOutputArray dst_mask); + void prepare(Rect dst_roi) CV_OVERRIDE; + void feed(InputArray img, InputArray mask, Point tl) CV_OVERRIDE; + void blend(InputOutputArray dst, InputOutputArray dst_mask) CV_OVERRIDE; //! Creates weight maps for fixed set of source images by their masks and top-left corners. //! Final image can be obtained by simple weighting of the source images. @@ -131,9 +131,9 @@ public: int numBands() const { return actual_num_bands_; } void setNumBands(int val) { actual_num_bands_ = val; } - void prepare(Rect dst_roi); - void feed(InputArray img, InputArray mask, Point tl); - void blend(InputOutputArray dst, InputOutputArray dst_mask); + void prepare(Rect dst_roi) CV_OVERRIDE; + void feed(InputArray img, InputArray mask, Point tl) CV_OVERRIDE; + void blend(InputOutputArray dst, InputOutputArray dst_mask) CV_OVERRIDE; private: int actual_num_bands_, num_bands_; diff --git a/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp b/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp index f5a8122b95..6c99407c18 100644 --- a/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp +++ b/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp @@ -92,8 +92,8 @@ class CV_EXPORTS NoExposureCompensator : public ExposureCompensator { public: void feed(const std::vector &/*corners*/, const std::vector &/*images*/, - const std::vector > &/*masks*/) { } - void apply(int /*index*/, Point /*corner*/, InputOutputArray /*image*/, InputArray /*mask*/) { } + const std::vector > &/*masks*/) CV_OVERRIDE { } + void apply(int /*index*/, Point /*corner*/, InputOutputArray /*image*/, InputArray /*mask*/) CV_OVERRIDE { } }; /** @brief Exposure compensator which tries to remove exposure related artifacts by adjusting image @@ -103,8 +103,8 @@ class CV_EXPORTS GainCompensator : public ExposureCompensator { public: void feed(const std::vector &corners, const std::vector &images, - const std::vector > &masks); - void apply(int index, Point corner, InputOutputArray image, InputArray mask); + const std::vector > &masks) CV_OVERRIDE; + void apply(int index, Point corner, InputOutputArray image, InputArray mask) CV_OVERRIDE; std::vector gains() const; private: @@ -120,8 +120,8 @@ public: BlocksGainCompensator(int bl_width = 32, int bl_height = 32) : bl_width_(bl_width), bl_height_(bl_height) {} void feed(const std::vector &corners, const std::vector &images, - const std::vector > &masks); - void apply(int index, Point corner, InputOutputArray image, InputArray mask); + const std::vector > &masks) CV_OVERRIDE; + void apply(int index, Point corner, InputOutputArray image, InputArray mask) CV_OVERRIDE; private: int bl_width_, bl_height_; diff --git a/modules/stitching/include/opencv2/stitching/detail/matchers.hpp b/modules/stitching/include/opencv2/stitching/detail/matchers.hpp index 009bdd9b70..4acebea5e1 100644 --- a/modules/stitching/include/opencv2/stitching/detail/matchers.hpp +++ b/modules/stitching/include/opencv2/stitching/detail/matchers.hpp @@ -130,7 +130,7 @@ public: int num_octaves_descr = /*4*/3, int num_layers_descr = /*2*/4); private: - void find(InputArray image, ImageFeatures &features); + void find(InputArray image, ImageFeatures &features) CV_OVERRIDE; Ptr detector_; Ptr extractor_; @@ -147,7 +147,7 @@ public: OrbFeaturesFinder(Size _grid_size = Size(3,1), int nfeatures=1500, float scaleFactor=1.3f, int nlevels=5); private: - void find(InputArray image, ImageFeatures &features); + void find(InputArray image, ImageFeatures &features) CV_OVERRIDE; Ptr orb; Size grid_size; @@ -169,7 +169,7 @@ public: int diffusivity = KAZE::DIFF_PM_G2); private: - void find(InputArray image, detail::ImageFeatures &features); + void find(InputArray image, ImageFeatures &features) CV_OVERRIDE; Ptr akaze; }; @@ -181,10 +181,10 @@ public: SurfFeaturesFinderGpu(double hess_thresh = 300., int num_octaves = 3, int num_layers = 4, int num_octaves_descr = 4, int num_layers_descr = 2); - void collectGarbage(); + void collectGarbage() CV_OVERRIDE; private: - void find(InputArray image, ImageFeatures &features); + void find(InputArray image, ImageFeatures &features) CV_OVERRIDE; cuda::GpuMat image_; cuda::GpuMat gray_image_; @@ -288,10 +288,10 @@ public: BestOf2NearestMatcher(bool try_use_gpu = false, float match_conf = 0.3f, int num_matches_thresh1 = 6, int num_matches_thresh2 = 6); - void collectGarbage(); + void collectGarbage() CV_OVERRIDE; protected: - void match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo &matches_info); + void match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo &matches_info) CV_OVERRIDE; int num_matches_thresh1_; int num_matches_thresh2_; @@ -342,7 +342,7 @@ public: full_affine_(full_affine) {} protected: - void match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo &matches_info); + void match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo &matches_info) CV_OVERRIDE; bool full_affine_; }; diff --git a/modules/stitching/include/opencv2/stitching/detail/motion_estimators.hpp b/modules/stitching/include/opencv2/stitching/detail/motion_estimators.hpp index 68d4b8c23c..40f12c32fc 100644 --- a/modules/stitching/include/opencv2/stitching/detail/motion_estimators.hpp +++ b/modules/stitching/include/opencv2/stitching/detail/motion_estimators.hpp @@ -104,7 +104,7 @@ public: private: virtual bool estimate(const std::vector &features, const std::vector &pairwise_matches, - std::vector &cameras); + std::vector &cameras) CV_OVERRIDE; bool is_focals_estimated_; }; @@ -121,7 +121,7 @@ class CV_EXPORTS AffineBasedEstimator : public Estimator private: virtual bool estimate(const std::vector &features, const std::vector &pairwise_matches, - std::vector &cameras); + std::vector &cameras) CV_OVERRIDE; }; /** @brief Base class for all camera parameters refinement methods. @@ -162,7 +162,7 @@ protected: // Runs bundle adjustment virtual bool estimate(const std::vector &features, const std::vector &pairwise_matches, - std::vector &cameras); + std::vector &cameras) CV_OVERRIDE; /** @brief Sets initial camera parameter to refine. @@ -221,14 +221,14 @@ public: private: bool estimate(const std::vector &, const std::vector &, - std::vector &) + std::vector &) CV_OVERRIDE { return true; } - void setUpInitialCameraParams(const std::vector &) {} - void obtainRefinedCameraParams(std::vector &) const {} - void calcError(Mat &) {} - void calcJacobian(Mat &) {} + void setUpInitialCameraParams(const std::vector &) CV_OVERRIDE {} + void obtainRefinedCameraParams(std::vector &) const CV_OVERRIDE {} + void calcError(Mat &) CV_OVERRIDE {} + void calcJacobian(Mat &) CV_OVERRIDE {} }; @@ -244,10 +244,10 @@ public: BundleAdjusterReproj() : BundleAdjusterBase(7, 2) {} private: - void setUpInitialCameraParams(const std::vector &cameras); - void obtainRefinedCameraParams(std::vector &cameras) const; - void calcError(Mat &err); - void calcJacobian(Mat &jac); + void setUpInitialCameraParams(const std::vector &cameras) CV_OVERRIDE; + void obtainRefinedCameraParams(std::vector &cameras) const CV_OVERRIDE; + void calcError(Mat &err) CV_OVERRIDE; + void calcJacobian(Mat &jac) CV_OVERRIDE; Mat err1_, err2_; }; @@ -264,10 +264,10 @@ public: BundleAdjusterRay() : BundleAdjusterBase(4, 3) {} private: - void setUpInitialCameraParams(const std::vector &cameras); - void obtainRefinedCameraParams(std::vector &cameras) const; - void calcError(Mat &err); - void calcJacobian(Mat &jac); + void setUpInitialCameraParams(const std::vector &cameras) CV_OVERRIDE; + void obtainRefinedCameraParams(std::vector &cameras) const CV_OVERRIDE; + void calcError(Mat &err) CV_OVERRIDE; + void calcJacobian(Mat &jac) CV_OVERRIDE; Mat err1_, err2_; }; @@ -288,10 +288,10 @@ public: BundleAdjusterAffine() : BundleAdjusterBase(6, 2) {} private: - void setUpInitialCameraParams(const std::vector &cameras); - void obtainRefinedCameraParams(std::vector &cameras) const; - void calcError(Mat &err); - void calcJacobian(Mat &jac); + void setUpInitialCameraParams(const std::vector &cameras) CV_OVERRIDE; + void obtainRefinedCameraParams(std::vector &cameras) const CV_OVERRIDE; + void calcError(Mat &err) CV_OVERRIDE; + void calcJacobian(Mat &jac) CV_OVERRIDE; Mat err1_, err2_; }; @@ -312,10 +312,10 @@ public: BundleAdjusterAffinePartial() : BundleAdjusterBase(4, 2) {} private: - void setUpInitialCameraParams(const std::vector &cameras); - void obtainRefinedCameraParams(std::vector &cameras) const; - void calcError(Mat &err); - void calcJacobian(Mat &jac); + void setUpInitialCameraParams(const std::vector &cameras) CV_OVERRIDE; + void obtainRefinedCameraParams(std::vector &cameras) const CV_OVERRIDE; + void calcError(Mat &err) CV_OVERRIDE; + void calcJacobian(Mat &jac) CV_OVERRIDE; Mat err1_, err2_; }; diff --git a/modules/stitching/include/opencv2/stitching/detail/seam_finders.hpp b/modules/stitching/include/opencv2/stitching/detail/seam_finders.hpp index a251f48351..fb91989fa9 100644 --- a/modules/stitching/include/opencv2/stitching/detail/seam_finders.hpp +++ b/modules/stitching/include/opencv2/stitching/detail/seam_finders.hpp @@ -74,7 +74,7 @@ public: class CV_EXPORTS NoSeamFinder : public SeamFinder { public: - void find(const std::vector&, const std::vector&, std::vector&) {} + void find(const std::vector&, const std::vector&, std::vector&) CV_OVERRIDE {} }; /** @brief Base class for all pairwise seam estimators. @@ -83,7 +83,7 @@ class CV_EXPORTS PairwiseSeamFinder : public SeamFinder { public: virtual void find(const std::vector &src, const std::vector &corners, - std::vector &masks); + std::vector &masks) CV_OVERRIDE; protected: void run(); @@ -107,11 +107,11 @@ class CV_EXPORTS VoronoiSeamFinder : public PairwiseSeamFinder { public: virtual void find(const std::vector &src, const std::vector &corners, - std::vector &masks); + std::vector &masks) CV_OVERRIDE; virtual void find(const std::vector &size, const std::vector &corners, std::vector &masks); private: - void findInPair(size_t first, size_t second, Rect roi); + void findInPair(size_t first, size_t second, Rect roi) CV_OVERRIDE; }; @@ -126,7 +126,7 @@ public: void setCostFunction(CostFunction val) { costFunc_ = val; } virtual void find(const std::vector &src, const std::vector &corners, - std::vector &masks); + std::vector &masks) CV_OVERRIDE; private: enum ComponentState @@ -242,7 +242,7 @@ public: ~GraphCutSeamFinder(); void find(const std::vector &src, const std::vector &corners, - std::vector &masks); + std::vector &masks) CV_OVERRIDE; private: // To avoid GCGraph dependency @@ -261,7 +261,7 @@ public: bad_region_penalty_(bad_region_penalty) {} void find(const std::vector &src, const std::vector &corners, - std::vector &masks); + std::vector &masks) CV_OVERRIDE; void findInPair(size_t first, size_t second, Rect roi); private: diff --git a/modules/stitching/include/opencv2/stitching/detail/timelapsers.hpp b/modules/stitching/include/opencv2/stitching/detail/timelapsers.hpp index ae37b03b75..74d797edf6 100644 --- a/modules/stitching/include/opencv2/stitching/detail/timelapsers.hpp +++ b/modules/stitching/include/opencv2/stitching/detail/timelapsers.hpp @@ -80,7 +80,7 @@ protected: class CV_EXPORTS TimelapserCrop : public Timelapser { public: - virtual void initialize(const std::vector &corners, const std::vector &sizes); + virtual void initialize(const std::vector &corners, const std::vector &sizes) CV_OVERRIDE; }; //! @} diff --git a/modules/stitching/include/opencv2/stitching/detail/warpers.hpp b/modules/stitching/include/opencv2/stitching/detail/warpers.hpp index ddb2fb51c0..1b05651f9a 100644 --- a/modules/stitching/include/opencv2/stitching/detail/warpers.hpp +++ b/modules/stitching/include/opencv2/stitching/detail/warpers.hpp @@ -141,20 +141,20 @@ template class CV_EXPORTS_TEMPLATE RotationWarperBase : public RotationWarper { public: - Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R); + Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R) CV_OVERRIDE; - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap); + Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE; Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, - OutputArray dst); + OutputArray dst) CV_OVERRIDE; void warpBackward(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, - Size dst_size, OutputArray dst); + Size dst_size, OutputArray dst) CV_OVERRIDE; - Rect warpRoi(Size src_size, InputArray K, InputArray R); + Rect warpRoi(Size src_size, InputArray K, InputArray R) CV_OVERRIDE; - float getScale() const { return projector_.scale; } - void setScale(float val) { projector_.scale = val; } + float getScale() const CV_OVERRIDE{ return projector_.scale; } + void setScale(float val) CV_OVERRIDE { projector_.scale = val; } protected: @@ -186,22 +186,22 @@ public: */ PlaneWarper(float scale = 1.f) { projector_.scale = scale; } - Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R); + Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R) CV_OVERRIDE; Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R, InputArray T); virtual Rect buildMaps(Size src_size, InputArray K, InputArray R, InputArray T, OutputArray xmap, OutputArray ymap); - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap); + Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE; Point warp(InputArray src, InputArray K, InputArray R, - int interp_mode, int border_mode, OutputArray dst); + int interp_mode, int border_mode, OutputArray dst) CV_OVERRIDE; virtual Point warp(InputArray src, InputArray K, InputArray R, InputArray T, int interp_mode, int border_mode, OutputArray dst); - Rect warpRoi(Size src_size, InputArray K, InputArray R); + Rect warpRoi(Size src_size, InputArray K, InputArray R) CV_OVERRIDE; Rect warpRoi(Size src_size, InputArray K, InputArray R, InputArray T); protected: - void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br); + void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE; }; @@ -219,11 +219,11 @@ public: */ AffineWarper(float scale = 1.f) : PlaneWarper(scale) {} - Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R); - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap); + Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R) CV_OVERRIDE; + Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE; Point warp(InputArray src, InputArray K, InputArray R, - int interp_mode, int border_mode, OutputArray dst); - Rect warpRoi(Size src_size, InputArray K, InputArray R); + int interp_mode, int border_mode, OutputArray dst) CV_OVERRIDE; + Rect warpRoi(Size src_size, InputArray K, InputArray R) CV_OVERRIDE; protected: /** @brief Extracts rotation and translation matrices from matrix H representing @@ -256,10 +256,10 @@ public: */ SphericalWarper(float scale) { projector_.scale = scale; } - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap); - Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, OutputArray dst); + Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE; + Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, OutputArray dst) CV_OVERRIDE; protected: - void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br); + void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE; }; @@ -281,10 +281,10 @@ public: */ CylindricalWarper(float scale) { projector_.scale = scale; } - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap); - Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, OutputArray dst); + Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE; + Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, OutputArray dst) CV_OVERRIDE; protected: - void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) + void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE { RotationWarperBase::detectResultRoiByBorder(src_size, dst_tl, dst_br); } @@ -437,7 +437,7 @@ class CV_EXPORTS PlaneWarperGpu : public PlaneWarper public: PlaneWarperGpu(float scale = 1.f) : PlaneWarper(scale) {} - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) + Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE { Rect result = buildMaps(src_size, K, R, d_xmap_, d_ymap_); d_xmap_.download(xmap); @@ -445,7 +445,7 @@ public: return result; } - Rect buildMaps(Size src_size, InputArray K, InputArray R, InputArray T, OutputArray xmap, OutputArray ymap) + Rect buildMaps(Size src_size, InputArray K, InputArray R, InputArray T, OutputArray xmap, OutputArray ymap) CV_OVERRIDE { Rect result = buildMaps(src_size, K, R, T, d_xmap_, d_ymap_); d_xmap_.download(xmap); @@ -454,7 +454,7 @@ public: } Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, - OutputArray dst) + OutputArray dst) CV_OVERRIDE { d_src_.upload(src); Point result = warp(d_src_, K, R, interp_mode, border_mode, d_dst_); @@ -463,7 +463,7 @@ public: } Point warp(InputArray src, InputArray K, InputArray R, InputArray T, int interp_mode, int border_mode, - OutputArray dst) + OutputArray dst) CV_OVERRIDE { d_src_.upload(src); Point result = warp(d_src_, K, R, T, interp_mode, border_mode, d_dst_); @@ -491,7 +491,7 @@ class CV_EXPORTS SphericalWarperGpu : public SphericalWarper public: SphericalWarperGpu(float scale) : SphericalWarper(scale) {} - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) + Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE { Rect result = buildMaps(src_size, K, R, d_xmap_, d_ymap_); d_xmap_.download(xmap); @@ -500,7 +500,7 @@ public: } Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, - OutputArray dst) + OutputArray dst) CV_OVERRIDE { d_src_.upload(src); Point result = warp(d_src_, K, R, interp_mode, border_mode, d_dst_); @@ -523,7 +523,7 @@ class CV_EXPORTS CylindricalWarperGpu : public CylindricalWarper public: CylindricalWarperGpu(float scale) : CylindricalWarper(scale) {} - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) + Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE { Rect result = buildMaps(src_size, K, R, d_xmap_, d_ymap_); d_xmap_.download(xmap); @@ -532,7 +532,7 @@ public: } Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, - OutputArray dst) + OutputArray dst) CV_OVERRIDE { d_src_.upload(src); Point result = warp(d_src_, K, R, interp_mode, border_mode, d_dst_); @@ -565,7 +565,7 @@ public: SphericalPortraitWarper(float scale) { projector_.scale = scale; } protected: - void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br); + void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE; }; struct CV_EXPORTS CylindricalPortraitProjector : ProjectorBase @@ -581,7 +581,7 @@ public: CylindricalPortraitWarper(float scale) { projector_.scale = scale; } protected: - void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) + void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE { RotationWarperBase::detectResultRoiByBorder(src_size, dst_tl, dst_br); } @@ -600,7 +600,7 @@ public: PlanePortraitWarper(float scale) { projector_.scale = scale; } protected: - void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) + void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE { RotationWarperBase::detectResultRoiByBorder(src_size, dst_tl, dst_br); } diff --git a/modules/stitching/include/opencv2/stitching/warpers.hpp b/modules/stitching/include/opencv2/stitching/warpers.hpp index 139e0522b9..cf7699c099 100644 --- a/modules/stitching/include/opencv2/stitching/warpers.hpp +++ b/modules/stitching/include/opencv2/stitching/warpers.hpp @@ -65,7 +65,7 @@ public: class PlaneWarper : public WarperCreator { public: - Ptr create(float scale) const { return makePtr(scale); } + Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } }; /** @brief Affine warper factory class. @@ -74,7 +74,7 @@ public: class AffineWarper : public WarperCreator { public: - Ptr create(float scale) const { return makePtr(scale); } + Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } }; /** @brief Cylindrical warper factory class. @@ -83,26 +83,26 @@ public: class CylindricalWarper: public WarperCreator { public: - Ptr create(float scale) const { return makePtr(scale); } + Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } }; /** @brief Spherical warper factory class */ class SphericalWarper: public WarperCreator { public: - Ptr create(float scale) const { return makePtr(scale); } + Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } }; class FisheyeWarper : public WarperCreator { public: - Ptr create(float scale) const { return makePtr(scale); } + Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } }; class StereographicWarper: public WarperCreator { public: - Ptr create(float scale) const { return makePtr(scale); } + Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } }; class CompressedRectilinearWarper: public WarperCreator @@ -113,7 +113,7 @@ public: { a = A; b = B; } - Ptr create(float scale) const { return makePtr(scale, a, b); } + Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale, a, b); } }; class CompressedRectilinearPortraitWarper: public WarperCreator @@ -124,7 +124,7 @@ public: { a = A; b = B; } - Ptr create(float scale) const { return makePtr(scale, a, b); } + Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale, a, b); } }; class PaniniWarper: public WarperCreator @@ -135,7 +135,7 @@ public: { a = A; b = B; } - Ptr create(float scale) const { return makePtr(scale, a, b); } + Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale, a, b); } }; class PaniniPortraitWarper: public WarperCreator @@ -146,19 +146,19 @@ public: { a = A; b = B; } - Ptr create(float scale) const { return makePtr(scale, a, b); } + Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale, a, b); } }; class MercatorWarper: public WarperCreator { public: - Ptr create(float scale) const { return makePtr(scale); } + Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } }; class TransverseMercatorWarper: public WarperCreator { public: - Ptr create(float scale) const { return makePtr(scale); } + Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } }; @@ -167,21 +167,21 @@ public: class PlaneWarperGpu: public WarperCreator { public: - Ptr create(float scale) const { return makePtr(scale); } + Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } }; class CylindricalWarperGpu: public WarperCreator { public: - Ptr create(float scale) const { return makePtr(scale); } + Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } }; class SphericalWarperGpu: public WarperCreator { public: - Ptr create(float scale) const { return makePtr(scale); } + Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } }; #endif diff --git a/modules/stitching/src/matchers.cpp b/modules/stitching/src/matchers.cpp index d517878ba8..140d4dae1e 100644 --- a/modules/stitching/src/matchers.cpp +++ b/modules/stitching/src/matchers.cpp @@ -74,7 +74,7 @@ struct MatchPairsBody : ParallelLoopBody : matcher(_matcher), features(_features), pairwise_matches(_pairwise_matches), near_pairs(_near_pairs) {} - void operator ()(const Range &r) const + void operator ()(const Range &r) const CV_OVERRIDE { cv::RNG rng = cv::theRNG(); // save entry rng state const int num_images = static_cast(features.size()); @@ -122,7 +122,7 @@ struct FindFeaturesBody : ParallelLoopBody std::vector &features, const std::vector > *rois) : finder_(finder), images_(images), features_(features), rois_(rois) {} - void operator ()(const Range &r) const + void operator ()(const Range &r) const CV_OVERRIDE { for (int i = r.start; i < r.end; ++i) { @@ -152,18 +152,18 @@ typedef std::set > MatchesSet; // These two classes are aimed to find features matches only, not to // estimate homography -class CpuMatcher : public FeaturesMatcher +class CpuMatcher CV_FINAL : public FeaturesMatcher { public: CpuMatcher(float match_conf) : FeaturesMatcher(true), match_conf_(match_conf) {} - void match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo& matches_info); + void match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo& matches_info) CV_OVERRIDE; private: float match_conf_; }; #ifdef HAVE_OPENCV_CUDAFEATURES2D -class GpuMatcher : public FeaturesMatcher +class GpuMatcher CV_FINAL : public FeaturesMatcher { public: GpuMatcher(float match_conf) : match_conf_(match_conf) {} diff --git a/modules/stitching/src/seam_finders.cpp b/modules/stitching/src/seam_finders.cpp index 31045ca7d7..ad9b0f2444 100644 --- a/modules/stitching/src/seam_finders.cpp +++ b/modules/stitching/src/seam_finders.cpp @@ -1068,7 +1068,7 @@ void DpSeamFinder::updateLabelsUsingSeam( } -class GraphCutSeamFinder::Impl : public PairwiseSeamFinder +class GraphCutSeamFinder::Impl CV_FINAL : public PairwiseSeamFinder { public: Impl(int cost_type, float terminal_cost, float bad_region_penalty) @@ -1076,8 +1076,8 @@ public: ~Impl() {} - void find(const std::vector &src, const std::vector &corners, std::vector &masks); - void findInPair(size_t first, size_t second, Rect roi); + void find(const std::vector &src, const std::vector &corners, std::vector &masks) CV_OVERRIDE; + void findInPair(size_t first, size_t second, Rect roi) CV_OVERRIDE; private: void setGraphWeightsColor(const Mat &img1, const Mat &img2, diff --git a/modules/superres/include/opencv2/superres.hpp b/modules/superres/include/opencv2/superres.hpp index e8bb5e5bc6..16c11acd52 100644 --- a/modules/superres/include/opencv2/superres.hpp +++ b/modules/superres/include/opencv2/superres.hpp @@ -97,8 +97,8 @@ namespace cv @param frame Output result */ - void nextFrame(OutputArray frame); - void reset(); + void nextFrame(OutputArray frame) CV_OVERRIDE; + void reset() CV_OVERRIDE; /** @brief Clear all inner buffers. */ diff --git a/modules/superres/src/btv_l1.cpp b/modules/superres/src/btv_l1.cpp index 558bbe0cad..95429817af 100644 --- a/modules/superres/src/btv_l1.cpp +++ b/modules/superres/src/btv_l1.cpp @@ -363,7 +363,7 @@ namespace template struct BtvRegularizationBody : ParallelLoopBody { - void operator ()(const Range& range) const; + void operator ()(const Range& range) const CV_OVERRIDE; Mat src; mutable Mat dst; @@ -470,18 +470,28 @@ namespace void process(InputArrayOfArrays src, OutputArray dst, InputArrayOfArrays forwardMotions, InputArrayOfArrays backwardMotions, int baseIdx); - void collectGarbage(); + void collectGarbage() CV_OVERRIDE; - CV_IMPL_PROPERTY(int, Scale, scale_) - CV_IMPL_PROPERTY(int, Iterations, iterations_) - CV_IMPL_PROPERTY(double, Tau, tau_) - CV_IMPL_PROPERTY(double, Labmda, lambda_) - CV_IMPL_PROPERTY(double, Alpha, alpha_) - CV_IMPL_PROPERTY(int, KernelSize, btvKernelSize_) - CV_IMPL_PROPERTY(int, BlurKernelSize, blurKernelSize_) - CV_IMPL_PROPERTY(double, BlurSigma, blurSigma_) - CV_IMPL_PROPERTY(int, TemporalAreaRadius, temporalAreaRadius_) - CV_IMPL_PROPERTY_S(Ptr, OpticalFlow, opticalFlow_) + inline int getScale() const CV_OVERRIDE { return scale_; } + inline void setScale(int val) CV_OVERRIDE { scale_ = val; } + inline int getIterations() const CV_OVERRIDE { return iterations_; } + inline void setIterations(int val) CV_OVERRIDE { iterations_ = val; } + inline double getTau() const CV_OVERRIDE { return tau_; } + inline void setTau(double val) CV_OVERRIDE { tau_ = val; } + inline double getLabmda() const CV_OVERRIDE { return lambda_; } + inline void setLabmda(double val) CV_OVERRIDE { lambda_ = val; } + inline double getAlpha() const CV_OVERRIDE { return alpha_; } + inline void setAlpha(double val) CV_OVERRIDE { alpha_ = val; } + inline int getKernelSize() const CV_OVERRIDE { return btvKernelSize_; } + inline void setKernelSize(int val) CV_OVERRIDE { btvKernelSize_ = val; } + inline int getBlurKernelSize() const CV_OVERRIDE { return blurKernelSize_; } + inline void setBlurKernelSize(int val) CV_OVERRIDE { blurKernelSize_ = val; } + inline double getBlurSigma() const CV_OVERRIDE { return blurSigma_; } + inline void setBlurSigma(double val) CV_OVERRIDE { blurSigma_ = val; } + inline int getTemporalAreaRadius() const CV_OVERRIDE { return temporalAreaRadius_; } + inline void setTemporalAreaRadius(int val) CV_OVERRIDE { temporalAreaRadius_ = val; } + inline Ptr getOpticalFlow() const CV_OVERRIDE { return opticalFlow_; } + inline void setOpticalFlow(const Ptr& val) CV_OVERRIDE { opticalFlow_ = val; } protected: int scale_; @@ -798,18 +808,18 @@ namespace //////////////////////////////////////////////////////////////////// - class BTVL1 : public BTVL1_Base + class BTVL1 CV_FINAL : public BTVL1_Base { public: BTVL1(); - void collectGarbage(); + void collectGarbage() CV_OVERRIDE; protected: - void initImpl(Ptr& frameSource); + void initImpl(Ptr& frameSource) CV_OVERRIDE; bool ocl_initImpl(Ptr& frameSource); - void processImpl(Ptr& frameSource, OutputArray output); + void processImpl(Ptr& frameSource, OutputArray output) CV_OVERRIDE; bool ocl_processImpl(Ptr& frameSource, OutputArray output); private: diff --git a/modules/superres/src/btv_l1_cuda.cpp b/modules/superres/src/btv_l1_cuda.cpp index b8d3eace12..357eadf071 100644 --- a/modules/superres/src/btv_l1_cuda.cpp +++ b/modules/superres/src/btv_l1_cuda.cpp @@ -218,16 +218,26 @@ namespace void collectGarbage(); - CV_IMPL_PROPERTY(int, Scale, scale_) - CV_IMPL_PROPERTY(int, Iterations, iterations_) - CV_IMPL_PROPERTY(double, Tau, tau_) - CV_IMPL_PROPERTY(double, Labmda, lambda_) - CV_IMPL_PROPERTY(double, Alpha, alpha_) - CV_IMPL_PROPERTY(int, KernelSize, btvKernelSize_) - CV_IMPL_PROPERTY(int, BlurKernelSize, blurKernelSize_) - CV_IMPL_PROPERTY(double, BlurSigma, blurSigma_) - CV_IMPL_PROPERTY(int, TemporalAreaRadius, temporalAreaRadius_) - CV_IMPL_PROPERTY_S(Ptr, OpticalFlow, opticalFlow_) + inline int getScale() const CV_OVERRIDE { return scale_; } + inline void setScale(int val) CV_OVERRIDE { scale_ = val; } + inline int getIterations() const CV_OVERRIDE { return iterations_; } + inline void setIterations(int val) CV_OVERRIDE { iterations_ = val; } + inline double getTau() const CV_OVERRIDE { return tau_; } + inline void setTau(double val) CV_OVERRIDE { tau_ = val; } + inline double getLabmda() const CV_OVERRIDE { return lambda_; } + inline void setLabmda(double val) CV_OVERRIDE { lambda_ = val; } + inline double getAlpha() const CV_OVERRIDE { return alpha_; } + inline void setAlpha(double val) CV_OVERRIDE { alpha_ = val; } + inline int getKernelSize() const CV_OVERRIDE { return btvKernelSize_; } + inline void setKernelSize(int val) CV_OVERRIDE { btvKernelSize_ = val; } + inline int getBlurKernelSize() const CV_OVERRIDE { return blurKernelSize_; } + inline void setBlurKernelSize(int val) CV_OVERRIDE { blurKernelSize_ = val; } + inline double getBlurSigma() const CV_OVERRIDE { return blurSigma_; } + inline void setBlurSigma(double val) CV_OVERRIDE { blurSigma_ = val; } + inline int getTemporalAreaRadius() const CV_OVERRIDE { return temporalAreaRadius_; } + inline void setTemporalAreaRadius(int val) CV_OVERRIDE { temporalAreaRadius_ = val; } + inline Ptr getOpticalFlow() const CV_OVERRIDE { return opticalFlow_; } + inline void setOpticalFlow(const Ptr& val) CV_OVERRIDE { opticalFlow_ = val; } protected: int scale_; diff --git a/modules/superres/src/frame_source.cpp b/modules/superres/src/frame_source.cpp index 12790b29fd..350f39c3fa 100644 --- a/modules/superres/src/frame_source.cpp +++ b/modules/superres/src/frame_source.cpp @@ -58,8 +58,8 @@ namespace class EmptyFrameSource : public FrameSource { public: - void nextFrame(OutputArray frame); - void reset(); + void nextFrame(OutputArray frame) CV_OVERRIDE; + void reset() CV_OVERRIDE; }; void EmptyFrameSource::nextFrame(OutputArray frame) @@ -103,7 +103,7 @@ namespace class CaptureFrameSource : public FrameSource { public: - void nextFrame(OutputArray frame); + void nextFrame(OutputArray frame) CV_OVERRIDE; protected: VideoCapture vc_; @@ -135,7 +135,7 @@ namespace public: VideoFrameSource(const String& fileName); - void reset(); + void reset() CV_OVERRIDE; private: String fileName_; @@ -158,7 +158,7 @@ namespace public: CameraFrameSource(int deviceId); - void reset(); + void reset() CV_OVERRIDE; private: int deviceId_; diff --git a/modules/superres/src/optical_flow.cpp b/modules/superres/src/optical_flow.cpp index 89a67899b4..b18b27c0d4 100644 --- a/modules/superres/src/optical_flow.cpp +++ b/modules/superres/src/optical_flow.cpp @@ -58,8 +58,8 @@ namespace public: explicit CpuOpticalFlow(int work_type); - void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2); - void collectGarbage(); + void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2) CV_OVERRIDE; + void collectGarbage() CV_OVERRIDE; protected: virtual void impl(InputArray input0, InputArray input1, OutputArray dst) = 0; @@ -179,23 +179,30 @@ namespace namespace { - class Farneback : public CpuOpticalFlow, public cv::superres::FarnebackOpticalFlow + class Farneback CV_FINAL : public CpuOpticalFlow, public cv::superres::FarnebackOpticalFlow { public: Farneback(); - void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2); - void collectGarbage(); + void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2) CV_OVERRIDE; + void collectGarbage() CV_OVERRIDE; - CV_IMPL_PROPERTY(double, PyrScale, pyrScale_) - CV_IMPL_PROPERTY(int, LevelsNumber, numLevels_) - CV_IMPL_PROPERTY(int, WindowSize, winSize_) - CV_IMPL_PROPERTY(int, Iterations, numIters_) - CV_IMPL_PROPERTY(int, PolyN, polyN_) - CV_IMPL_PROPERTY(double, PolySigma, polySigma_) - CV_IMPL_PROPERTY(int, Flags, flags_) + inline double getPyrScale() const CV_OVERRIDE { return pyrScale_; } + inline void setPyrScale(double val) CV_OVERRIDE { pyrScale_ = val; } + inline int getLevelsNumber() const CV_OVERRIDE { return numLevels_; } + inline void setLevelsNumber(int val) CV_OVERRIDE { numLevels_ = val; } + inline int getWindowSize() const CV_OVERRIDE { return winSize_; } + inline void setWindowSize(int val) CV_OVERRIDE { winSize_ = val; } + inline int getIterations() const CV_OVERRIDE { return numIters_; } + inline void setIterations(int val) CV_OVERRIDE { numIters_ = val; } + inline int getPolyN() const CV_OVERRIDE { return polyN_; } + inline void setPolyN(int val) CV_OVERRIDE { polyN_ = val; } + inline double getPolySigma() const CV_OVERRIDE { return polySigma_; } + inline void setPolySigma(double val) CV_OVERRIDE { polySigma_ = val; } + inline int getFlags() const CV_OVERRIDE { return flags_; } + inline void setFlags(int val) CV_OVERRIDE { flags_ = val; } protected: - void impl(InputArray input0, InputArray input1, OutputArray dst); + void impl(InputArray input0, InputArray input1, OutputArray dst) CV_OVERRIDE; private: double pyrScale_; @@ -336,24 +343,32 @@ Ptr cv::superres::createOptFlow_Simple() namespace { - class DualTVL1 : public CpuOpticalFlow, public virtual cv::superres::DualTVL1OpticalFlow + class DualTVL1 CV_FINAL : public CpuOpticalFlow, public virtual cv::superres::DualTVL1OpticalFlow { public: DualTVL1(); - void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2); - void collectGarbage(); + void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2) CV_OVERRIDE; + void collectGarbage() CV_OVERRIDE; - CV_WRAP_SAME_PROPERTY(double, Tau, (*alg_)) - CV_WRAP_SAME_PROPERTY(double, Lambda, (*alg_)) - CV_WRAP_SAME_PROPERTY(double, Theta, (*alg_)) - CV_WRAP_SAME_PROPERTY(int, ScalesNumber, (*alg_)) - CV_WRAP_SAME_PROPERTY(int, WarpingsNumber, (*alg_)) - CV_WRAP_SAME_PROPERTY(double, Epsilon, (*alg_)) - CV_WRAP_PROPERTY(int, Iterations, OuterIterations, (*alg_)) - CV_WRAP_SAME_PROPERTY(bool, UseInitialFlow, (*alg_)) + inline double getTau() const CV_OVERRIDE { return (*alg_).getTau(); } + inline void setTau(double val) CV_OVERRIDE { (*alg_).setTau(val); } + inline double getLambda() const CV_OVERRIDE { return (*alg_).getLambda(); } + inline void setLambda(double val) CV_OVERRIDE { (*alg_).setLambda(val); } + inline double getTheta() const CV_OVERRIDE { return (*alg_).getTheta(); } + inline void setTheta(double val) CV_OVERRIDE { (*alg_).setTheta(val); } + inline int getScalesNumber() const CV_OVERRIDE { return (*alg_).getScalesNumber(); } + inline void setScalesNumber(int val) CV_OVERRIDE { (*alg_).setScalesNumber(val); } + inline int getWarpingsNumber() const CV_OVERRIDE { return (*alg_).getWarpingsNumber(); } + inline void setWarpingsNumber(int val) CV_OVERRIDE { (*alg_).setWarpingsNumber(val); } + inline double getEpsilon() const CV_OVERRIDE { return (*alg_).getEpsilon(); } + inline void setEpsilon(double val) CV_OVERRIDE { (*alg_).setEpsilon(val); } + inline int getIterations() const CV_OVERRIDE { return (*alg_).getOuterIterations(); } + inline void setIterations(int val) CV_OVERRIDE { (*alg_).setOuterIterations(val); } + inline bool getUseInitialFlow() const CV_OVERRIDE { return (*alg_).getUseInitialFlow(); } + inline void setUseInitialFlow(bool val) CV_OVERRIDE { (*alg_).setUseInitialFlow(val); } protected: - void impl(InputArray input0, InputArray input1, OutputArray dst); + void impl(InputArray input0, InputArray input1, OutputArray dst) CV_OVERRIDE; private: Ptr alg_; @@ -498,12 +513,18 @@ namespace void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2); void collectGarbage(); - CV_IMPL_PROPERTY(double, Alpha, alpha_) - CV_IMPL_PROPERTY(double, Gamma, gamma_) - CV_IMPL_PROPERTY(double, ScaleFactor, scaleFactor_) - CV_IMPL_PROPERTY(int, InnerIterations, innerIterations_) - CV_IMPL_PROPERTY(int, OuterIterations, outerIterations_) - CV_IMPL_PROPERTY(int, SolverIterations, solverIterations_) + inline double getAlpha() const CV_OVERRIDE { return alpha_; } + inline void setAlpha(double val) CV_OVERRIDE { alpha_ = val; } + inline double getGamma() const CV_OVERRIDE { return gamma_; } + inline void setGamma(double val) CV_OVERRIDE { gamma_ = val; } + inline double getScaleFactor() const CV_OVERRIDE { return scaleFactor_; } + inline void setScaleFactor(double val) CV_OVERRIDE { scaleFactor_ = val; } + inline int getInnerIterations() const CV_OVERRIDE { return innerIterations_; } + inline void setInnerIterations(int val) CV_OVERRIDE { innerIterations_ = val; } + inline int getOuterIterations() const CV_OVERRIDE { return outerIterations_; } + inline void setOuterIterations(int val) CV_OVERRIDE { outerIterations_ = val; } + inline int getSolverIterations() const CV_OVERRIDE { return solverIterations_; } + inline void setSolverIterations(int val) CV_OVERRIDE { solverIterations_ = val; } protected: void impl(const GpuMat& input0, const GpuMat& input1, GpuMat& dst1, GpuMat& dst2); @@ -579,9 +600,12 @@ namespace void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2); void collectGarbage(); - CV_IMPL_PROPERTY(int, WindowSize, winSize_) - CV_IMPL_PROPERTY(int, MaxLevel, maxLevel_) - CV_IMPL_PROPERTY(int, Iterations, iterations_) + inline int getWindowSize() const CV_OVERRIDE { return winSize_; } + inline void setWindowSize(int val) CV_OVERRIDE { winSize_ = val; } + inline int getMaxLevel() const CV_OVERRIDE { return maxLevel_; } + inline void setMaxLevel(int val) CV_OVERRIDE { maxLevel_ = val; } + inline int getIterations() const CV_OVERRIDE { return iterations_; } + inline void setIterations(int val) CV_OVERRIDE { iterations_ = val; } protected: void impl(const GpuMat& input0, const GpuMat& input1, GpuMat& dst1, GpuMat& dst2); @@ -648,13 +672,20 @@ namespace void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2); void collectGarbage(); - CV_IMPL_PROPERTY(double, PyrScale, pyrScale_) - CV_IMPL_PROPERTY(int, LevelsNumber, numLevels_) - CV_IMPL_PROPERTY(int, WindowSize, winSize_) - CV_IMPL_PROPERTY(int, Iterations, numIters_) - CV_IMPL_PROPERTY(int, PolyN, polyN_) - CV_IMPL_PROPERTY(double, PolySigma, polySigma_) - CV_IMPL_PROPERTY(int, Flags, flags_) + inline double getPyrScale() const CV_OVERRIDE { return pyrScale_; } + inline void setPyrScale(double val) CV_OVERRIDE { pyrScale_ = val; } + inline int getLevelsNumber() const CV_OVERRIDE { return numLevels_; } + inline void setLevelsNumber(int val) CV_OVERRIDE { numLevels_ = val; } + inline int getWindowSize() const CV_OVERRIDE { return winSize_; } + inline void setWindowSize(int val) CV_OVERRIDE { winSize_ = val; } + inline int getIterations() const CV_OVERRIDE { return numIters_; } + inline void setIterations(int val) CV_OVERRIDE { numIters_ = val; } + inline int getPolyN() const CV_OVERRIDE { return polyN_; } + inline void setPolyN(int val) CV_OVERRIDE { polyN_ = val; } + inline double getPolySigma() const CV_OVERRIDE { return polySigma_; } + inline void setPolySigma(double val) CV_OVERRIDE { polySigma_ = val; } + inline int getFlags() const CV_OVERRIDE { return flags_; } + inline void setFlags(int val) CV_OVERRIDE { flags_ = val; } protected: void impl(const GpuMat& input0, const GpuMat& input1, GpuMat& dst1, GpuMat& dst2); @@ -733,14 +764,22 @@ namespace void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2); void collectGarbage(); - CV_IMPL_PROPERTY(double, Tau, tau_) - CV_IMPL_PROPERTY(double, Lambda, lambda_) - CV_IMPL_PROPERTY(double, Theta, theta_) - CV_IMPL_PROPERTY(int, ScalesNumber, nscales_) - CV_IMPL_PROPERTY(int, WarpingsNumber, warps_) - CV_IMPL_PROPERTY(double, Epsilon, epsilon_) - CV_IMPL_PROPERTY(int, Iterations, iterations_) - CV_IMPL_PROPERTY(bool, UseInitialFlow, useInitialFlow_) + inline double getTau() const CV_OVERRIDE { return tau_; } + inline void setTau(double val) CV_OVERRIDE { tau_ = val; } + inline double getLambda() const CV_OVERRIDE { return lambda_; } + inline void setLambda(double val) CV_OVERRIDE { lambda_ = val; } + inline double getTheta() const CV_OVERRIDE { return theta_; } + inline void setTheta(double val) CV_OVERRIDE { theta_ = val; } + inline int getScalesNumber() const CV_OVERRIDE { return nscales_; } + inline void setScalesNumber(int val) CV_OVERRIDE { nscales_ = val; } + inline int getWarpingsNumber() const CV_OVERRIDE { return warps_; } + inline void setWarpingsNumber(int val) CV_OVERRIDE { warps_ = val; } + inline double getEpsilon() const CV_OVERRIDE { return epsilon_; } + inline void setEpsilon(double val) CV_OVERRIDE { epsilon_ = val; } + inline int getIterations() const CV_OVERRIDE { return iterations_; } + inline void setIterations(int val) CV_OVERRIDE { iterations_ = val; } + inline bool getUseInitialFlow() const CV_OVERRIDE { return useInitialFlow_; } + inline void setUseInitialFlow(bool val) CV_OVERRIDE { useInitialFlow_ = val; } protected: void impl(const GpuMat& input0, const GpuMat& input1, GpuMat& dst1, GpuMat& dst2); diff --git a/modules/ts/include/opencv2/ts.hpp b/modules/ts/include/opencv2/ts.hpp index cd50c3ed50..5f0556b426 100644 --- a/modules/ts/include/opencv2/ts.hpp +++ b/modules/ts/include/opencv2/ts.hpp @@ -63,7 +63,14 @@ # endif #endif +#if defined(__OPENCV_BUILD) && defined(__GNUC__) && __GNUC__ >= 5 +//#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" +#endif #include "opencv2/ts/ts_gtest.h" +#if defined(__OPENCV_BUILD) && defined(__GNUC__) && __GNUC__ >= 5 +//#pragma GCC diagnostic pop +#endif #include "opencv2/ts/ts_ext.hpp" #ifndef GTEST_USES_SIMPLE_RE @@ -519,13 +526,13 @@ public: ArrayTest(); virtual ~ArrayTest(); - virtual void clear(); + virtual void clear() CV_OVERRIDE; protected: - virtual int read_params( CvFileStorage* fs ); - virtual int prepare_test_case( int test_case_idx ); - virtual int validate_test_results( int test_case_idx ); + virtual int read_params( CvFileStorage* fs ) CV_OVERRIDE; + virtual int prepare_test_case( int test_case_idx ) CV_OVERRIDE; + virtual int validate_test_results( int test_case_idx ) CV_OVERRIDE; virtual void prepare_to_validation( int test_case_idx ); virtual void get_test_array_types_and_sizes( int test_case_idx, vector >& sizes, vector >& types ); @@ -558,7 +565,7 @@ public: protected: virtual int run_test_case( int expected_code, const string& descr ); - virtual void run_func(void) = 0; + virtual void run_func(void) CV_OVERRIDE = 0; int test_case_idx; template diff --git a/modules/ts/include/opencv2/ts/ts_ext.hpp b/modules/ts/include/opencv2/ts/ts_ext.hpp index 3056f1f770..11ee1c9f20 100644 --- a/modules/ts/include/opencv2/ts/ts_ext.hpp +++ b/modules/ts/include/opencv2/ts/ts_ext.hpp @@ -48,7 +48,7 @@ extern int testThreads; public:\ GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\ private:\ - virtual void TestBody();\ + virtual void TestBody() CV_OVERRIDE;\ virtual void Body();\ static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\ GTEST_DISALLOW_COPY_AND_ASSIGN_(\ @@ -74,7 +74,7 @@ extern int testThreads; public:\ GTEST_TEST_CLASS_NAME_(test_fixture, test_name)() {}\ private:\ - virtual void TestBody();\ + virtual void TestBody() CV_OVERRIDE;\ virtual void Body(); \ static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\ GTEST_DISALLOW_COPY_AND_ASSIGN_(\ @@ -102,7 +102,7 @@ extern int testThreads; GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ private: \ virtual void bodyMethodName(); \ - virtual void TestBody(); \ + virtual void TestBody() CV_OVERRIDE; \ static int AddToRegistry() { \ ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ GetTestCasePatternHolder(\ diff --git a/modules/ts/include/opencv2/ts/ts_perf.hpp b/modules/ts/include/opencv2/ts/ts_perf.hpp index 59ff2a1bfd..a5d0acfa41 100644 --- a/modules/ts/include/opencv2/ts/ts_perf.hpp +++ b/modules/ts/include/opencv2/ts/ts_perf.hpp @@ -3,7 +3,6 @@ #include "opencv2/ts.hpp" -#include "ts_gtest.h" #include "ts_ext.hpp" #include @@ -397,8 +396,8 @@ public: protected: virtual void PerfTestBody() = 0; - virtual void SetUp(); - virtual void TearDown(); + virtual void SetUp() CV_OVERRIDE; + virtual void TearDown() CV_OVERRIDE; bool startTimer(); // bool is dummy for conditional loop void stopTimer(); diff --git a/modules/ts/src/ts_gtest.cpp b/modules/ts/src/ts_gtest.cpp index fd759e647f..ff9dd4a1bf 100644 --- a/modules/ts/src/ts_gtest.cpp +++ b/modules/ts/src/ts_gtest.cpp @@ -41,6 +41,9 @@ #ifdef __GNUC__ # pragma GCC diagnostic ignored "-Wmissing-declarations" # pragma GCC diagnostic ignored "-Wmissing-field-initializers" +# if __GNUC__ >= 5 +# pragma GCC diagnostic ignored "-Wsuggest-override" +# endif #endif // The following lines pull in the real gtest *.cc files. diff --git a/modules/video/include/opencv2/video/background_segm.hpp b/modules/video/include/opencv2/video/background_segm.hpp index ea7a897acb..e1dfa15a9a 100644 --- a/modules/video/include/opencv2/video/background_segm.hpp +++ b/modules/video/include/opencv2/video/background_segm.hpp @@ -205,7 +205,7 @@ public: rate. 0 means that the background model is not updated at all, 1 means that the background model is completely reinitialized from the last frame. */ - CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) = 0; + CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) CV_OVERRIDE = 0; }; /** @brief Creates MOG2 Background Subtractor diff --git a/modules/video/src/bgfg_KNN.cpp b/modules/video/src/bgfg_KNN.cpp index d8ec99c8e1..2866e2d767 100755 --- a/modules/video/src/bgfg_KNN.cpp +++ b/modules/video/src/bgfg_KNN.cpp @@ -64,7 +64,7 @@ static const float defaultDist2Threshold = 20.0f*20.0f;//threshold on distance f static const unsigned char defaultnShadowDetection2 = (unsigned char)127; // value to use in the segmentation mask for shadows, set 0 not to do shadow detection static const float defaultfTau = 0.5f; // Tau - shadow threshold, see the paper for explanation -class BackgroundSubtractorKNNImpl : public BackgroundSubtractorKNN +class BackgroundSubtractorKNNImpl CV_FINAL : public BackgroundSubtractorKNN { public: //! the default constructor @@ -128,12 +128,12 @@ public: #endif } //! the destructor - ~BackgroundSubtractorKNNImpl() {} + ~BackgroundSubtractorKNNImpl() CV_OVERRIDE {} //! the update operator - void apply(InputArray image, OutputArray fgmask, double learningRate=-1); + void apply(InputArray image, OutputArray fgmask, double learningRate) CV_OVERRIDE; //! computes a background image which are the mean of all background gaussians - virtual void getBackgroundImage(OutputArray backgroundImage) const; + virtual void getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE; //! re-initialization method void initialize(Size _frameSize, int _frameType) @@ -214,20 +214,20 @@ public: } } - virtual int getHistory() const { return history; } - virtual void setHistory(int _nframes) { history = _nframes; } + virtual int getHistory() const CV_OVERRIDE { return history; } + virtual void setHistory(int _nframes) CV_OVERRIDE { history = _nframes; } - virtual int getNSamples() const { return nN; } - virtual void setNSamples(int _nN) { nN = _nN; }//needs reinitialization! + virtual int getNSamples() const CV_OVERRIDE { return nN; } + virtual void setNSamples(int _nN) CV_OVERRIDE { nN = _nN; }//needs reinitialization! - virtual int getkNNSamples() const { return nkNN; } - virtual void setkNNSamples(int _nkNN) { nkNN = _nkNN; } + virtual int getkNNSamples() const CV_OVERRIDE { return nkNN; } + virtual void setkNNSamples(int _nkNN) CV_OVERRIDE { nkNN = _nkNN; } - virtual double getDist2Threshold() const { return fTb; } - virtual void setDist2Threshold(double _dist2Threshold) { fTb = (float)_dist2Threshold; } + virtual double getDist2Threshold() const CV_OVERRIDE { return fTb; } + virtual void setDist2Threshold(double _dist2Threshold) CV_OVERRIDE { fTb = (float)_dist2Threshold; } - virtual bool getDetectShadows() const { return bShadowDetection; } - virtual void setDetectShadows(bool detectshadows) + virtual bool getDetectShadows() const CV_OVERRIDE { return bShadowDetection; } + virtual void setDetectShadows(bool detectshadows) CV_OVERRIDE { if ((bShadowDetection && detectshadows) || (!bShadowDetection && !detectshadows)) return; @@ -241,13 +241,13 @@ public: #endif } - virtual int getShadowValue() const { return nShadowDetection; } - virtual void setShadowValue(int value) { nShadowDetection = (uchar)value; } + virtual int getShadowValue() const CV_OVERRIDE { return nShadowDetection; } + virtual void setShadowValue(int value) CV_OVERRIDE { nShadowDetection = (uchar)value; } - virtual double getShadowThreshold() const { return fTau; } - virtual void setShadowThreshold(double value) { fTau = (float)value; } + virtual double getShadowThreshold() const CV_OVERRIDE { return fTau; } + virtual void setShadowThreshold(double value) CV_OVERRIDE { fTau = (float)value; } - virtual void write(FileStorage& fs) const + virtual void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name_ @@ -260,7 +260,7 @@ public: << "shadowThreshold" << fTau; } - virtual void read(const FileNode& fn) + virtual void read(const FileNode& fn) CV_OVERRIDE { CV_Assert( (String)fn["name"] == name_ ); history = (int)fn["history"]; @@ -546,7 +546,7 @@ public: m_nShadowDetection = _nShadowDetection; } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { int y0 = range.start, y1 = range.end; int ncols = src->cols, nchannels = src->channels(); diff --git a/modules/video/src/bgfg_gaussmix2.cpp b/modules/video/src/bgfg_gaussmix2.cpp index 68d06d8447..f338b6c3ff 100644 --- a/modules/video/src/bgfg_gaussmix2.cpp +++ b/modules/video/src/bgfg_gaussmix2.cpp @@ -118,7 +118,7 @@ static const unsigned char defaultnShadowDetection2 = (unsigned char)127; // val static const float defaultfTau = 0.5f; // Tau - shadow threshold, see the paper for explanation -class BackgroundSubtractorMOG2Impl : public BackgroundSubtractorMOG2 +class BackgroundSubtractorMOG2Impl CV_FINAL : public BackgroundSubtractorMOG2 { public: //! the default constructor @@ -174,12 +174,12 @@ public: #endif } //! the destructor - ~BackgroundSubtractorMOG2Impl() {} + ~BackgroundSubtractorMOG2Impl() CV_OVERRIDE {} //! the update operator - void apply(InputArray image, OutputArray fgmask, double learningRate=-1); + void apply(InputArray image, OutputArray fgmask, double learningRate) CV_OVERRIDE; //! computes a background image which are the mean of all background gaussians - virtual void getBackgroundImage(OutputArray backgroundImage) const; + virtual void getBackgroundImage(OutputArray backgroundImage) const CV_OVERRIDE; //! re-initiaization method void initialize(Size _frameSize, int _frameType) @@ -236,35 +236,35 @@ public: } } - virtual int getHistory() const { return history; } - virtual void setHistory(int _nframes) { history = _nframes; } + virtual int getHistory() const CV_OVERRIDE { return history; } + virtual void setHistory(int _nframes) CV_OVERRIDE { history = _nframes; } - virtual int getNMixtures() const { return nmixtures; } - virtual void setNMixtures(int nmix) { nmixtures = nmix; } + virtual int getNMixtures() const CV_OVERRIDE { return nmixtures; } + virtual void setNMixtures(int nmix) CV_OVERRIDE { nmixtures = nmix; } - virtual double getBackgroundRatio() const { return backgroundRatio; } - virtual void setBackgroundRatio(double _backgroundRatio) { backgroundRatio = (float)_backgroundRatio; } + virtual double getBackgroundRatio() const CV_OVERRIDE { return backgroundRatio; } + virtual void setBackgroundRatio(double _backgroundRatio) CV_OVERRIDE { backgroundRatio = (float)_backgroundRatio; } - virtual double getVarThreshold() const { return varThreshold; } - virtual void setVarThreshold(double _varThreshold) { varThreshold = _varThreshold; } + virtual double getVarThreshold() const CV_OVERRIDE { return varThreshold; } + virtual void setVarThreshold(double _varThreshold) CV_OVERRIDE { varThreshold = _varThreshold; } - virtual double getVarThresholdGen() const { return varThresholdGen; } - virtual void setVarThresholdGen(double _varThresholdGen) { varThresholdGen = (float)_varThresholdGen; } + virtual double getVarThresholdGen() const CV_OVERRIDE { return varThresholdGen; } + virtual void setVarThresholdGen(double _varThresholdGen) CV_OVERRIDE { varThresholdGen = (float)_varThresholdGen; } - virtual double getVarInit() const { return fVarInit; } - virtual void setVarInit(double varInit) { fVarInit = (float)varInit; } + virtual double getVarInit() const CV_OVERRIDE { return fVarInit; } + virtual void setVarInit(double varInit) CV_OVERRIDE { fVarInit = (float)varInit; } - virtual double getVarMin() const { return fVarMin; } - virtual void setVarMin(double varMin) { fVarMin = (float)varMin; } + virtual double getVarMin() const CV_OVERRIDE { return fVarMin; } + virtual void setVarMin(double varMin) CV_OVERRIDE { fVarMin = (float)varMin; } - virtual double getVarMax() const { return fVarMax; } - virtual void setVarMax(double varMax) { fVarMax = (float)varMax; } + virtual double getVarMax() const CV_OVERRIDE { return fVarMax; } + virtual void setVarMax(double varMax) CV_OVERRIDE { fVarMax = (float)varMax; } - virtual double getComplexityReductionThreshold() const { return fCT; } - virtual void setComplexityReductionThreshold(double ct) { fCT = (float)ct; } + virtual double getComplexityReductionThreshold() const CV_OVERRIDE { return fCT; } + virtual void setComplexityReductionThreshold(double ct) CV_OVERRIDE { fCT = (float)ct; } - virtual bool getDetectShadows() const { return bShadowDetection; } - virtual void setDetectShadows(bool detectshadows) + virtual bool getDetectShadows() const CV_OVERRIDE { return bShadowDetection; } + virtual void setDetectShadows(bool detectshadows) CV_OVERRIDE { if ((bShadowDetection && detectshadows) || (!bShadowDetection && !detectshadows)) return; @@ -278,13 +278,13 @@ public: #endif } - virtual int getShadowValue() const { return nShadowDetection; } - virtual void setShadowValue(int value) { nShadowDetection = (uchar)value; } + virtual int getShadowValue() const CV_OVERRIDE { return nShadowDetection; } + virtual void setShadowValue(int value) CV_OVERRIDE { nShadowDetection = (uchar)value; } - virtual double getShadowThreshold() const { return fTau; } - virtual void setShadowThreshold(double value) { fTau = (float)value; } + virtual double getShadowThreshold() const CV_OVERRIDE { return fTau; } + virtual void setShadowThreshold(double value) CV_OVERRIDE { fTau = (float)value; } - virtual void write(FileStorage& fs) const + virtual void write(FileStorage& fs) const CV_OVERRIDE { writeFormat(fs); fs << "name" << name_ @@ -302,7 +302,7 @@ public: << "shadowThreshold" << fTau; } - virtual void read(const FileNode& fn) + virtual void read(const FileNode& fn) CV_OVERRIDE { CV_Assert( (String)fn["name"] == name_ ); history = (int)fn["history"]; @@ -565,7 +565,7 @@ public: shadowVal = _shadowVal; } - void operator()(const Range& range) const + void operator()(const Range& range) const CV_OVERRIDE { int y0 = range.start, y1 = range.end; int ncols = src->cols, nchannels = src->channels(); diff --git a/modules/video/src/lkpyramid.cpp b/modules/video/src/lkpyramid.cpp index e64602177d..48f896d4e0 100644 --- a/modules/video/src/lkpyramid.cpp +++ b/modules/video/src/lkpyramid.cpp @@ -819,25 +819,25 @@ namespace { } - virtual Size getWinSize() const {return winSize;} - virtual void setWinSize(Size winSize_){winSize = winSize_;} + virtual Size getWinSize() const CV_OVERRIDE { return winSize;} + virtual void setWinSize(Size winSize_) CV_OVERRIDE { winSize = winSize_;} - virtual int getMaxLevel() const {return maxLevel;} - virtual void setMaxLevel(int maxLevel_){maxLevel = maxLevel_;} + virtual int getMaxLevel() const CV_OVERRIDE { return maxLevel;} + virtual void setMaxLevel(int maxLevel_) CV_OVERRIDE { maxLevel = maxLevel_;} - virtual TermCriteria getTermCriteria() const {return criteria;} - virtual void setTermCriteria(TermCriteria& crit_){criteria=crit_;} + virtual TermCriteria getTermCriteria() const CV_OVERRIDE { return criteria;} + virtual void setTermCriteria(TermCriteria& crit_) CV_OVERRIDE { criteria=crit_;} - virtual int getFlags() const {return flags; } - virtual void setFlags(int flags_){flags=flags_;} + virtual int getFlags() const CV_OVERRIDE { return flags; } + virtual void setFlags(int flags_) CV_OVERRIDE { flags=flags_;} - virtual double getMinEigThreshold() const {return minEigThreshold;} - virtual void setMinEigThreshold(double minEigThreshold_){minEigThreshold=minEigThreshold_;} + virtual double getMinEigThreshold() const CV_OVERRIDE { return minEigThreshold;} + virtual void setMinEigThreshold(double minEigThreshold_) CV_OVERRIDE { minEigThreshold=minEigThreshold_;} virtual void calc(InputArray prevImg, InputArray nextImg, InputArray prevPts, InputOutputArray nextPts, OutputArray status, - OutputArray err = cv::noArray()); + OutputArray err = cv::noArray()) CV_OVERRIDE; private: #ifdef HAVE_OPENCL diff --git a/modules/video/src/lkpyramid.hpp b/modules/video/src/lkpyramid.hpp index 1b9d50bc64..9e62d06b81 100644 --- a/modules/video/src/lkpyramid.hpp +++ b/modules/video/src/lkpyramid.hpp @@ -15,7 +15,7 @@ namespace detail Size _winSize, TermCriteria _criteria, int _level, int _maxLevel, int _flags, float _minEigThreshold ); - void operator()(const Range& range) const; + void operator()(const Range& range) const CV_OVERRIDE; const Mat* prevImg; const Mat* nextImg; diff --git a/modules/video/src/optflowgf.cpp b/modules/video/src/optflowgf.cpp index cb2dc5948c..448dea2bb8 100644 --- a/modules/video/src/optflowgf.cpp +++ b/modules/video/src/optflowgf.cpp @@ -597,31 +597,31 @@ public: { } - virtual int getNumLevels() const { return numLevels_; } - virtual void setNumLevels(int numLevels) { numLevels_ = numLevels; } + virtual int getNumLevels() const CV_OVERRIDE { return numLevels_; } + virtual void setNumLevels(int numLevels) CV_OVERRIDE { numLevels_ = numLevels; } - virtual double getPyrScale() const { return pyrScale_; } - virtual void setPyrScale(double pyrScale) { pyrScale_ = pyrScale; } + virtual double getPyrScale() const CV_OVERRIDE { return pyrScale_; } + virtual void setPyrScale(double pyrScale) CV_OVERRIDE { pyrScale_ = pyrScale; } - virtual bool getFastPyramids() const { return fastPyramids_; } - virtual void setFastPyramids(bool fastPyramids) { fastPyramids_ = fastPyramids; } + virtual bool getFastPyramids() const CV_OVERRIDE { return fastPyramids_; } + virtual void setFastPyramids(bool fastPyramids) CV_OVERRIDE { fastPyramids_ = fastPyramids; } - virtual int getWinSize() const { return winSize_; } - virtual void setWinSize(int winSize) { winSize_ = winSize; } + virtual int getWinSize() const CV_OVERRIDE { return winSize_; } + virtual void setWinSize(int winSize) CV_OVERRIDE { winSize_ = winSize; } - virtual int getNumIters() const { return numIters_; } - virtual void setNumIters(int numIters) { numIters_ = numIters; } + virtual int getNumIters() const CV_OVERRIDE { return numIters_; } + virtual void setNumIters(int numIters) CV_OVERRIDE { numIters_ = numIters; } - virtual int getPolyN() const { return polyN_; } - virtual void setPolyN(int polyN) { polyN_ = polyN; } + virtual int getPolyN() const CV_OVERRIDE { return polyN_; } + virtual void setPolyN(int polyN) CV_OVERRIDE { polyN_ = polyN; } - virtual double getPolySigma() const { return polySigma_; } - virtual void setPolySigma(double polySigma) { polySigma_ = polySigma; } + virtual double getPolySigma() const CV_OVERRIDE { return polySigma_; } + virtual void setPolySigma(double polySigma) CV_OVERRIDE { polySigma_ = polySigma; } - virtual int getFlags() const { return flags_; } - virtual void setFlags(int flags) { flags_ = flags; } + virtual int getFlags() const CV_OVERRIDE { return flags_; } + virtual void setFlags(int flags) CV_OVERRIDE { flags_ = flags; } - virtual void calc(InputArray I0, InputArray I1, InputOutputArray flow); + virtual void calc(InputArray I0, InputArray I1, InputOutputArray flow) CV_OVERRIDE; private: int numLevels_; @@ -800,7 +800,7 @@ private: flowy = curFlowY; return true; } - virtual void collectGarbage(){ + virtual void collectGarbage() CV_OVERRIDE { releaseMemory(); } void releaseMemory() @@ -1089,7 +1089,7 @@ private: return true; } #else // HAVE_OPENCL - virtual void collectGarbage(){} + virtual void collectGarbage() CV_OVERRIDE {} #endif }; diff --git a/modules/video/src/tvl1flow.cpp b/modules/video/src/tvl1flow.cpp index 42de2a3917..061d0472c8 100644 --- a/modules/video/src/tvl1flow.cpp +++ b/modules/video/src/tvl1flow.cpp @@ -102,21 +102,33 @@ public: } OpticalFlowDual_TVL1(); - void calc(InputArray I0, InputArray I1, InputOutputArray flow); - void collectGarbage(); + void calc(InputArray I0, InputArray I1, InputOutputArray flow) CV_OVERRIDE; + void collectGarbage() CV_OVERRIDE; - CV_IMPL_PROPERTY(double, Tau, tau) - CV_IMPL_PROPERTY(double, Lambda, lambda) - CV_IMPL_PROPERTY(double, Theta, theta) - CV_IMPL_PROPERTY(double, Gamma, gamma) - CV_IMPL_PROPERTY(int, ScalesNumber, nscales) - CV_IMPL_PROPERTY(int, WarpingsNumber, warps) - CV_IMPL_PROPERTY(double, Epsilon, epsilon) - CV_IMPL_PROPERTY(int, InnerIterations, innerIterations) - CV_IMPL_PROPERTY(int, OuterIterations, outerIterations) - CV_IMPL_PROPERTY(bool, UseInitialFlow, useInitialFlow) - CV_IMPL_PROPERTY(double, ScaleStep, scaleStep) - CV_IMPL_PROPERTY(int, MedianFiltering, medianFiltering) + inline double getTau() const CV_OVERRIDE { return tau; } + inline void setTau(double val) CV_OVERRIDE { tau = val; } + inline double getLambda() const CV_OVERRIDE { return lambda; } + inline void setLambda(double val) CV_OVERRIDE { lambda = val; } + inline double getTheta() const CV_OVERRIDE { return theta; } + inline void setTheta(double val) CV_OVERRIDE { theta = val; } + inline double getGamma() const CV_OVERRIDE { return gamma; } + inline void setGamma(double val) CV_OVERRIDE { gamma = val; } + inline int getScalesNumber() const CV_OVERRIDE { return nscales; } + inline void setScalesNumber(int val) CV_OVERRIDE { nscales = val; } + inline int getWarpingsNumber() const CV_OVERRIDE { return warps; } + inline void setWarpingsNumber(int val) CV_OVERRIDE { warps = val; } + inline double getEpsilon() const CV_OVERRIDE { return epsilon; } + inline void setEpsilon(double val) CV_OVERRIDE { epsilon = val; } + inline int getInnerIterations() const CV_OVERRIDE { return innerIterations; } + inline void setInnerIterations(int val) CV_OVERRIDE { innerIterations = val; } + inline int getOuterIterations() const CV_OVERRIDE { return outerIterations; } + inline void setOuterIterations(int val) CV_OVERRIDE { outerIterations = val; } + inline bool getUseInitialFlow() const CV_OVERRIDE { return useInitialFlow; } + inline void setUseInitialFlow(bool val) CV_OVERRIDE { useInitialFlow = val; } + inline double getScaleStep() const CV_OVERRIDE { return scaleStep; } + inline void setScaleStep(double val) CV_OVERRIDE { scaleStep = val; } + inline int getMedianFiltering() const CV_OVERRIDE { return medianFiltering; } + inline void setMedianFiltering(int val) CV_OVERRIDE { medianFiltering = val; } protected: double tau; @@ -628,7 +640,7 @@ bool OpticalFlowDual_TVL1::calc_ocl(InputArray _I0, InputArray _I1, InputOutputA struct BuildFlowMapBody : ParallelLoopBody { - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; Mat_ u1; Mat_ u2; @@ -675,7 +687,7 @@ void buildFlowMap(const Mat_& u1, const Mat_& u2, Mat_& map struct CenteredGradientBody : ParallelLoopBody { - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; Mat_ src; mutable Mat_ dx; @@ -762,7 +774,7 @@ void centeredGradient(const Mat_& src, Mat_& dx, Mat_& dy) struct ForwardGradientBody : ParallelLoopBody { - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; Mat_ src; mutable Mat_ dx; @@ -832,7 +844,7 @@ void forwardGradient(const Mat_& src, Mat_& dx, Mat_& dy) struct DivergenceBody : ParallelLoopBody { - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; Mat_ v1; Mat_ v2; @@ -891,7 +903,7 @@ void divergence(const Mat_& v1, const Mat_& v2, Mat_& div) struct CalcGradRhoBody : ParallelLoopBody { - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; Mat_ I0; Mat_ I1w; @@ -961,7 +973,7 @@ void calcGradRho(const Mat_& I0, const Mat_& I1w, const Mat_ I1wx; Mat_ I1wy; @@ -1108,7 +1120,7 @@ float estimateU(const Mat_& v1, const Mat_& v2, const Mat_& struct EstimateDualVariablesBody : ParallelLoopBody { - void operator() (const Range& range) const; + void operator() (const Range& range) const CV_OVERRIDE; Mat_ u1x; Mat_ u1y; diff --git a/modules/videoio/src/cap_aravis.cpp b/modules/videoio/src/cap_aravis.cpp index f2fc9da775..165284b917 100644 --- a/modules/videoio/src/cap_aravis.cpp +++ b/modules/videoio/src/cap_aravis.cpp @@ -103,11 +103,11 @@ public: virtual bool open(int); virtual void close(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); - virtual int getCaptureDomain() + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; + virtual int getCaptureDomain() CV_OVERRIDE { return cv::CAP_ARAVIS; } diff --git a/modules/videoio/src/cap_cmu.cpp b/modules/videoio/src/cap_cmu.cpp index 90bb1ced17..a98fec8632 100644 --- a/modules/videoio/src/cap_cmu.cpp +++ b/modules/videoio/src/cap_cmu.cpp @@ -68,10 +68,10 @@ public: virtual bool open(int cameraId); virtual void close(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; protected: C1394Camera* camera(); diff --git a/modules/videoio/src/cap_dc1394.cpp b/modules/videoio/src/cap_dc1394.cpp index 7e593d688b..7ba1713b8f 100644 --- a/modules/videoio/src/cap_dc1394.cpp +++ b/modules/videoio/src/cap_dc1394.cpp @@ -1049,11 +1049,11 @@ public: virtual bool open( int index ); virtual void close(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); - virtual int getCaptureDomain() { return CV_CAP_DC1394; } // Return the type of the capture object: CV_CAP_VFW, etc... + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; + virtual int getCaptureDomain() CV_OVERRIDE { return CV_CAP_DC1394; } // Return the type of the capture object: CV_CAP_VFW, etc... protected: CvCaptureCAM_DC1394* captureDC1394; diff --git a/modules/videoio/src/cap_dc1394_v2.cpp b/modules/videoio/src/cap_dc1394_v2.cpp index 00fe6b5bbb..d3cb2f5eef 100644 --- a/modules/videoio/src/cap_dc1394_v2.cpp +++ b/modules/videoio/src/cap_dc1394_v2.cpp @@ -207,11 +207,11 @@ public: virtual bool open(int index); virtual void close(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); - virtual int getCaptureDomain() { return CV_CAP_DC1394; } // Return the type of the capture object: CV_CAP_VFW, etc... + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; + virtual int getCaptureDomain() CV_OVERRIDE { return CV_CAP_DC1394; } // Return the type of the capture object: CV_CAP_VFW, etc... protected: diff --git a/modules/videoio/src/cap_dshow.hpp b/modules/videoio/src/cap_dshow.hpp index 46998c1863..f5bf80ca3b 100644 --- a/modules/videoio/src/cap_dshow.hpp +++ b/modules/videoio/src/cap_dshow.hpp @@ -12,8 +12,6 @@ #ifndef _CAP_DSHOW_HPP_ #define _CAP_DSHOW_HPP_ -#include "precomp.hpp" - #ifdef HAVE_DSHOW class videoInput; @@ -26,12 +24,12 @@ public: VideoCapture_DShow(int index); virtual ~VideoCapture_DShow(); - virtual double getProperty(int propIdx) const; - virtual bool setProperty(int propIdx, double propVal); + virtual double getProperty(int propIdx) const CV_OVERRIDE; + virtual bool setProperty(int propIdx, double propVal) CV_OVERRIDE; - virtual bool grabFrame(); - virtual bool retrieveFrame(int outputType, OutputArray frame); - virtual int getCaptureDomain(); + virtual bool grabFrame() CV_OVERRIDE; + virtual bool retrieveFrame(int outputType, OutputArray frame) CV_OVERRIDE; + virtual int getCaptureDomain() CV_OVERRIDE; virtual bool isOpened() const; protected: void open(int index); diff --git a/modules/videoio/src/cap_ffmpeg.cpp b/modules/videoio/src/cap_ffmpeg.cpp index 5439f4304a..5232ab1206 100644 --- a/modules/videoio/src/cap_ffmpeg.cpp +++ b/modules/videoio/src/cap_ffmpeg.cpp @@ -196,26 +196,26 @@ private: }; -class CvCapture_FFMPEG_proxy : +class CvCapture_FFMPEG_proxy CV_FINAL : public CvCapture { public: CvCapture_FFMPEG_proxy() { ffmpegCapture = 0; } virtual ~CvCapture_FFMPEG_proxy() { close(); } - virtual double getProperty(int propId) const + virtual double getProperty(int propId) const CV_OVERRIDE { return ffmpegCapture ? icvGetCaptureProperty_FFMPEG_p(ffmpegCapture, propId) : 0; } - virtual bool setProperty(int propId, double value) + virtual bool setProperty(int propId, double value) CV_OVERRIDE { return ffmpegCapture ? icvSetCaptureProperty_FFMPEG_p(ffmpegCapture, propId, value)!=0 : false; } - virtual bool grabFrame() + virtual bool grabFrame() CV_OVERRIDE { return ffmpegCapture ? icvGrabFrame_FFMPEG_p(ffmpegCapture)!=0 : false; } - virtual IplImage* retrieveFrame(int) + virtual IplImage* retrieveFrame(int) CV_OVERRIDE { unsigned char* data = 0; int step=0, width=0, height=0, cn=0; @@ -260,14 +260,14 @@ CvCapture* cvCreateFileCapture_FFMPEG_proxy(const char * filename) return 0; } -class CvVideoWriter_FFMPEG_proxy : +class CvVideoWriter_FFMPEG_proxy CV_FINAL : public CvVideoWriter { public: CvVideoWriter_FFMPEG_proxy() { ffmpegWriter = 0; } virtual ~CvVideoWriter_FFMPEG_proxy() { close(); } - virtual bool writeFrame( const IplImage* image ) + virtual bool writeFrame( const IplImage* image ) CV_OVERRIDE { if(!ffmpegWriter) return false; diff --git a/modules/videoio/src/cap_giganetix.cpp b/modules/videoio/src/cap_giganetix.cpp index a71009ba09..98fba269b0 100644 --- a/modules/videoio/src/cap_giganetix.cpp +++ b/modules/videoio/src/cap_giganetix.cpp @@ -294,11 +294,11 @@ class CvCaptureCAM_Giganetix : public CvCapture virtual bool open( int index ); virtual void close(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); - virtual int getCaptureDomain() + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; + virtual int getCaptureDomain() CV_OVERRIDE { return CV_CAP_GIGANETIX; } diff --git a/modules/videoio/src/cap_gphoto2.cpp b/modules/videoio/src/cap_gphoto2.cpp index 33ac02914c..7a6b64d5fd 100644 --- a/modules/videoio/src/cap_gphoto2.cpp +++ b/modules/videoio/src/cap_gphoto2.cpp @@ -65,7 +65,7 @@ public: result = gPhoto2Result; method = methodStr; } - virtual const char * what() const throw () + virtual const char * what() const throw() CV_OVERRIDE { return gp_result_as_string(result); } @@ -137,14 +137,14 @@ public: DigitalCameraCapture(); DigitalCameraCapture(int index); DigitalCameraCapture(const String &deviceName); - virtual ~DigitalCameraCapture(); + virtual ~DigitalCameraCapture() CV_OVERRIDE; - virtual bool isOpened() const; - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual bool retrieveFrame(int, OutputArray); - virtual int getCaptureDomain() + virtual bool isOpened() const CV_OVERRIDE; + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual bool retrieveFrame(int, OutputArray) CV_OVERRIDE; + virtual int getCaptureDomain() CV_OVERRIDE { return CV_CAP_GPHOTO2; } // Return the type of the capture object: CV_CAP_VFW, etc... diff --git a/modules/videoio/src/cap_gstreamer.cpp b/modules/videoio/src/cap_gstreamer.cpp index 7cbddee8bc..83d5dc2033 100644 --- a/modules/videoio/src/cap_gstreamer.cpp +++ b/modules/videoio/src/cap_gstreamer.cpp @@ -130,7 +130,7 @@ private: * \brief The CvCapture_GStreamer class * Use GStreamer to capture video */ -class CvCapture_GStreamer : public CvCapture +class CvCapture_GStreamer CV_FINAL : public CvCapture { public: CvCapture_GStreamer() { init(); } @@ -139,10 +139,10 @@ public: virtual bool open( int type, const char* filename ); virtual void close(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; protected: void init(); @@ -1262,12 +1262,12 @@ class CvVideoWriter_GStreamer : public CvVideoWriter { public: CvVideoWriter_GStreamer() { init(); } - virtual ~CvVideoWriter_GStreamer() { close(); } + virtual ~CvVideoWriter_GStreamer() CV_OVERRIDE { close(); } virtual bool open( const char* filename, int fourcc, double fps, CvSize frameSize, bool isColor ); virtual void close(); - virtual bool writeFrame( const IplImage* image ); + virtual bool writeFrame( const IplImage* image ) CV_OVERRIDE; protected: void init(); const char* filenameToMimetype(const char* filename); diff --git a/modules/videoio/src/cap_images.cpp b/modules/videoio/src/cap_images.cpp index 9eac7db84d..9d4d0fc0a1 100644 --- a/modules/videoio/src/cap_images.cpp +++ b/modules/videoio/src/cap_images.cpp @@ -74,17 +74,17 @@ public: grabbedInOpen = false; } - virtual ~CvCapture_Images() + virtual ~CvCapture_Images() CV_OVERRIDE { close(); } virtual bool open(const char* _filename); virtual void close(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; protected: char* filename; // actually a printf-pattern @@ -321,7 +321,7 @@ CvCapture* cvCreateFileCapture_Images(const char * filename) // image sequence writer // // -class CvVideoWriter_Images : public CvVideoWriter +class CvVideoWriter_Images CV_FINAL : public CvVideoWriter { public: CvVideoWriter_Images() @@ -333,8 +333,8 @@ public: virtual bool open( const char* _filename ); virtual void close(); - virtual bool setProperty( int, double ); - virtual bool writeFrame( const IplImage* ); + virtual bool setProperty( int, double ); // FIXIT doesn't work: IVideoWriter interface only! + virtual bool writeFrame( const IplImage* ) CV_OVERRIDE; protected: char* filename; diff --git a/modules/videoio/src/cap_intelperc.hpp b/modules/videoio/src/cap_intelperc.hpp index 430a714f0e..209cd4736a 100644 --- a/modules/videoio/src/cap_intelperc.hpp +++ b/modules/videoio/src/cap_intelperc.hpp @@ -94,13 +94,13 @@ public: VideoCapture_IntelPerC(); virtual ~VideoCapture_IntelPerC(); - virtual double getProperty(int propIdx) const; - virtual bool setProperty(int propIdx, double propVal); + virtual double getProperty(int propIdx) const CV_OVERRIDE; + virtual bool setProperty(int propIdx, double propVal) CV_OVERRIDE; - virtual bool grabFrame(); - virtual bool retrieveFrame(int outputType, OutputArray frame); - virtual int getCaptureDomain(); - virtual bool isOpened() const; + virtual bool grabFrame() CV_OVERRIDE; + virtual bool retrieveFrame(int outputType, OutputArray frame) CV_OVERRIDE; + virtual int getCaptureDomain() CV_OVERRIDE; + virtual bool isOpened() const CV_OVERRIDE; protected: bool m_contextOpened; diff --git a/modules/videoio/src/cap_libv4l.cpp b/modules/videoio/src/cap_libv4l.cpp index f1e1c6d00c..4e1927fb7d 100644 --- a/modules/videoio/src/cap_libv4l.cpp +++ b/modules/videoio/src/cap_libv4l.cpp @@ -1924,10 +1924,10 @@ public: virtual bool open( const char* deviceName ); virtual void close(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; protected: CvCaptureCAM_V4L* captureV4L; diff --git a/modules/videoio/src/cap_mfx_reader.hpp b/modules/videoio/src/cap_mfx_reader.hpp index 1d2fa8b009..cad5297b8a 100644 --- a/modules/videoio/src/cap_mfx_reader.hpp +++ b/modules/videoio/src/cap_mfx_reader.hpp @@ -20,12 +20,12 @@ class VideoCapture_IntelMFX : public cv::IVideoCapture public: VideoCapture_IntelMFX(const cv::String &filename); virtual ~VideoCapture_IntelMFX(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual bool retrieveFrame(int, cv::OutputArray out); - virtual bool isOpened() const; - virtual int getCaptureDomain(); + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual bool retrieveFrame(int, cv::OutputArray out) CV_OVERRIDE; + virtual bool isOpened() const CV_OVERRIDE; + virtual int getCaptureDomain() CV_OVERRIDE; private: MFXVideoSession *session; Plugin *plugin; diff --git a/modules/videoio/src/cap_mjpeg_decoder.cpp b/modules/videoio/src/cap_mjpeg_decoder.cpp index cd2d841d04..f8ba6857f3 100644 --- a/modules/videoio/src/cap_mjpeg_decoder.cpp +++ b/modules/videoio/src/cap_mjpeg_decoder.cpp @@ -48,13 +48,13 @@ namespace cv class MotionJpegCapture: public IVideoCapture { public: - virtual ~MotionJpegCapture(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual bool retrieveFrame(int, OutputArray); - virtual bool isOpened() const; - virtual int getCaptureDomain() { return CAP_ANY; } // Return the type of the capture object: CAP_VFW, etc... + virtual ~MotionJpegCapture() CV_OVERRIDE; + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual bool retrieveFrame(int, OutputArray) CV_OVERRIDE; + virtual bool isOpened() const CV_OVERRIDE; + virtual int getCaptureDomain() CV_OVERRIDE { return CAP_ANY; } // Return the type of the capture object: CAP_VFW, etc... MotionJpegCapture(const String&); bool open(const String&); diff --git a/modules/videoio/src/cap_mjpeg_encoder.cpp b/modules/videoio/src/cap_mjpeg_encoder.cpp index 60d727039e..a518404e94 100644 --- a/modules/videoio/src/cap_mjpeg_encoder.cpp +++ b/modules/videoio/src/cap_mjpeg_encoder.cpp @@ -438,9 +438,9 @@ public: return true; } - bool isOpened() const { return container.isOpenedStream(); } + bool isOpened() const CV_OVERRIDE { return container.isOpenedStream(); } - void write(InputArray _img) + void write(InputArray _img) CV_OVERRIDE { Mat img = _img.getMat(); size_t chunkPointer = container.getStreamPos(); @@ -493,7 +493,7 @@ public: } } - double getProperty(int propId) const + double getProperty(int propId) const CV_OVERRIDE { if( propId == VIDEOWRITER_PROP_QUALITY ) return quality; @@ -507,7 +507,7 @@ public: return 0.; } - bool setProperty(int propId, double value) + bool setProperty(int propId, double value) CV_OVERRIDE { if( propId == VIDEOWRITER_PROP_QUALITY ) { @@ -1186,7 +1186,7 @@ public: m_buffer_list.allocate_buffers(stripes_count, (height*width*2)/stripes_count); } - void operator()( const cv::Range& range ) const + void operator()( const cv::Range& range ) const CV_OVERRIDE { const int CAT_TAB_SIZE = 4096; unsigned code = 0; diff --git a/modules/videoio/src/cap_msmf.cpp b/modules/videoio/src/cap_msmf.cpp index 9232dd6431..b4e8d2b99a 100644 --- a/modules/videoio/src/cap_msmf.cpp +++ b/modules/videoio/src/cap_msmf.cpp @@ -3440,11 +3440,11 @@ public: virtual ~CvCaptureCAM_MSMF(); virtual bool open( int index ); virtual void close(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); - virtual int getCaptureDomain() { return CV_CAP_MSMF; } // Return the type of the capture object: CV_CAP_VFW, etc... + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; + virtual int getCaptureDomain() CV_OVERRIDE { return CV_CAP_MSMF; } // Return the type of the capture object: CV_CAP_VFW, etc... protected: void init(); int index, width, height, fourcc; diff --git a/modules/videoio/src/cap_openni.cpp b/modules/videoio/src/cap_openni.cpp index e2f9ba6fec..5b0018f1e4 100644 --- a/modules/videoio/src/cap_openni.cpp +++ b/modules/videoio/src/cap_openni.cpp @@ -442,10 +442,10 @@ public: CvCapture_OpenNI(const char * filename); virtual ~CvCapture_OpenNI(); - virtual double getProperty(int propIdx) const; - virtual bool setProperty(int probIdx, double propVal); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int outputType); + virtual double getProperty(int propIdx) const CV_OVERRIDE; + virtual bool setProperty(int probIdx, double propVal) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int outputType) CV_OVERRIDE; bool isOpened() const; diff --git a/modules/videoio/src/cap_openni2.cpp b/modules/videoio/src/cap_openni2.cpp index 200c026bf2..18fd5b66df 100644 --- a/modules/videoio/src/cap_openni2.cpp +++ b/modules/videoio/src/cap_openni2.cpp @@ -90,10 +90,10 @@ public: CvCapture_OpenNI2(const char * filename); virtual ~CvCapture_OpenNI2(); - virtual double getProperty(int propIdx) const; - virtual bool setProperty(int probIdx, double propVal); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int outputType); + virtual double getProperty(int propIdx) const CV_OVERRIDE; + virtual bool setProperty(int probIdx, double propVal) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int outputType) CV_OVERRIDE; bool isOpened() const; diff --git a/modules/videoio/src/cap_pvapi.cpp b/modules/videoio/src/cap_pvapi.cpp index d64842f295..c793191e5d 100644 --- a/modules/videoio/src/cap_pvapi.cpp +++ b/modules/videoio/src/cap_pvapi.cpp @@ -81,11 +81,11 @@ public: virtual bool open( int index ); virtual void close(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); - virtual int getCaptureDomain() + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; + virtual int getCaptureDomain() CV_OVERRIDE { return CV_CAP_PVAPI; } diff --git a/modules/videoio/src/cap_qt.cpp b/modules/videoio/src/cap_qt.cpp index 3f9835a81b..a75ff2ac16 100644 --- a/modules/videoio/src/cap_qt.cpp +++ b/modules/videoio/src/cap_qt.cpp @@ -1441,11 +1441,11 @@ public: virtual bool open( const char* filename ); virtual void close(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); - virtual int getCaptureDomain() { return CV_CAP_QT; } // Return the type of the capture object: CV_CAP_VFW, etc... + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; + virtual int getCaptureDomain() CV_OVERRIDE { return CV_CAP_QT; } // Return the type of the capture object: CV_CAP_VFW, etc... protected: CvCapture_QT_Movie* captureQT; diff --git a/modules/videoio/src/cap_unicap.cpp b/modules/videoio/src/cap_unicap.cpp index 57dc55aa89..f369197a57 100644 --- a/modules/videoio/src/cap_unicap.cpp +++ b/modules/videoio/src/cap_unicap.cpp @@ -62,11 +62,11 @@ struct CvCapture_Unicap : public CvCapture virtual bool open( int index ); virtual void close(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); - virtual int getCaptureDomain() { return CV_CAP_UNICAP; } // Return the type of the capture object: CV_CAP_VFW, etc... + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; + virtual int getCaptureDomain() CV_OVERRIDE { return CV_CAP_UNICAP; } // Return the type of the capture object: CV_CAP_VFW, etc... bool shutdownDevice(); bool initDevice(); diff --git a/modules/videoio/src/cap_v4l.cpp b/modules/videoio/src/cap_v4l.cpp index e0db6f1ae9..9f53dceb55 100644 --- a/modules/videoio/src/cap_v4l.cpp +++ b/modules/videoio/src/cap_v4l.cpp @@ -265,7 +265,7 @@ struct buffer static unsigned int n_buffers = 0; -struct CvCaptureCAM_V4L : public CvCapture +struct CvCaptureCAM_V4L CV_FINAL : public CvCapture { int deviceHandle; int bufferIndex; @@ -301,10 +301,10 @@ struct CvCaptureCAM_V4L : public CvCapture bool open(int _index); bool open(const char* deviceName); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; Range getRange(int property_id) const { switch (property_id) { diff --git a/modules/videoio/src/cap_vfw.cpp b/modules/videoio/src/cap_vfw.cpp index 43a977212e..0d71a0c2a5 100644 --- a/modules/videoio/src/cap_vfw.cpp +++ b/modules/videoio/src/cap_vfw.cpp @@ -99,11 +99,11 @@ public: virtual bool open( const char* filename ); virtual void close(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); - virtual int getCaptureDomain() { return CV_CAP_VFW; } // Return the type of the capture object: CV_CAP_VFW, etc... + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; + virtual int getCaptureDomain() CV_OVERRIDE { return CV_CAP_VFW; } // Return the type of the capture object: CV_CAP_VFW, etc... protected: void init(); diff --git a/modules/videoio/src/cap_ximea.cpp b/modules/videoio/src/cap_ximea.cpp index 00ea2f7150..afc0887941 100644 --- a/modules/videoio/src/cap_ximea.cpp +++ b/modules/videoio/src/cap_ximea.cpp @@ -20,11 +20,11 @@ public: virtual bool open( int index ); bool open( const char* deviceName ); virtual void close(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); - virtual int getCaptureDomain() { return CV_CAP_XIAPI; } // Return the type of the capture object: CV_CAP_VFW, etc... + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; + virtual int getCaptureDomain() CV_OVERRIDE { return CV_CAP_XIAPI; } // Return the type of the capture object: CV_CAP_VFW, etc... private: bool _open(); diff --git a/modules/videoio/src/cap_xine.cpp b/modules/videoio/src/cap_xine.cpp index d25d007fc6..7ae4d4eb6b 100644 --- a/modules/videoio/src/cap_xine.cpp +++ b/modules/videoio/src/cap_xine.cpp @@ -786,10 +786,10 @@ public: virtual bool open( const char* filename ); virtual void close(); - virtual double getProperty(int) const; - virtual bool setProperty(int, double); - virtual bool grabFrame(); - virtual IplImage* retrieveFrame(int); + virtual double getProperty(int) const CV_OVERRIDE; + virtual bool setProperty(int, double) CV_OVERRIDE; + virtual bool grabFrame() CV_OVERRIDE; + virtual IplImage* retrieveFrame(int) CV_OVERRIDE; protected: CvCaptureAVI_XINE* captureXINE; diff --git a/modules/videoio/test/test_ffmpeg.cpp b/modules/videoio/test/test_ffmpeg.cpp index ecfc98d856..2baeeb8b41 100644 --- a/modules/videoio/test/test_ffmpeg.cpp +++ b/modules/videoio/test/test_ffmpeg.cpp @@ -232,7 +232,7 @@ public: { } - 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) { @@ -278,7 +278,7 @@ public: circle(frame, Center, i + 2, ObjectColor, 2, CV_AA); } - 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) { @@ -320,7 +320,7 @@ public: { } - 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) { @@ -342,7 +342,7 @@ public: { } - 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) { diff --git a/modules/videostab/include/opencv2/videostab/deblurring.hpp b/modules/videostab/include/opencv2/videostab/deblurring.hpp index b383f0d45a..c6656401eb 100644 --- a/modules/videostab/include/opencv2/videostab/deblurring.hpp +++ b/modules/videostab/include/opencv2/videostab/deblurring.hpp @@ -90,7 +90,7 @@ protected: class CV_EXPORTS NullDeblurer : public DeblurerBase { public: - virtual void deblur(int /*idx*/, Mat &/*frame*/) {} + virtual void deblur(int /*idx*/, Mat &/*frame*/) CV_OVERRIDE {} }; class CV_EXPORTS WeightingDeblurer : public DeblurerBase @@ -101,7 +101,7 @@ public: void setSensitivity(float val) { sensitivity_ = val; } float sensitivity() const { return sensitivity_; } - virtual void deblur(int idx, Mat &frame); + virtual void deblur(int idx, Mat &frame) CV_OVERRIDE; private: float sensitivity_; diff --git a/modules/videostab/include/opencv2/videostab/frame_source.hpp b/modules/videostab/include/opencv2/videostab/frame_source.hpp index e4e00b59a6..171c637c8e 100644 --- a/modules/videostab/include/opencv2/videostab/frame_source.hpp +++ b/modules/videostab/include/opencv2/videostab/frame_source.hpp @@ -65,8 +65,8 @@ public: class CV_EXPORTS NullFrameSource : public IFrameSource { public: - virtual void reset() {} - virtual Mat nextFrame() { return Mat(); } + virtual void reset() CV_OVERRIDE {} + virtual Mat nextFrame() CV_OVERRIDE { return Mat(); } }; class CV_EXPORTS VideoFileSource : public IFrameSource @@ -74,8 +74,8 @@ class CV_EXPORTS VideoFileSource : public IFrameSource public: VideoFileSource(const String &path, bool volatileFrame = false); - virtual void reset(); - virtual Mat nextFrame(); + virtual void reset() CV_OVERRIDE; + virtual Mat nextFrame() CV_OVERRIDE; int width(); int height(); diff --git a/modules/videostab/include/opencv2/videostab/global_motion.hpp b/modules/videostab/include/opencv2/videostab/global_motion.hpp index 1fbe0c8402..fedca2cf5e 100644 --- a/modules/videostab/include/opencv2/videostab/global_motion.hpp +++ b/modules/videostab/include/opencv2/videostab/global_motion.hpp @@ -139,7 +139,7 @@ public: void setMinInlierRatio(float val) { minInlierRatio_ = val; } float minInlierRatio() const { return minInlierRatio_; } - virtual Mat estimate(InputArray points0, InputArray points1, bool *ok = 0); + virtual Mat estimate(InputArray points0, InputArray points1, bool *ok = 0) CV_OVERRIDE; private: RansacParams ransacParams_; @@ -155,7 +155,7 @@ class CV_EXPORTS MotionEstimatorL1 : public MotionEstimatorBase public: MotionEstimatorL1(MotionModel model = MM_AFFINE); - virtual Mat estimate(InputArray points0, InputArray points1, bool *ok = 0); + virtual Mat estimate(InputArray points0, InputArray points1, bool *ok = 0) CV_OVERRIDE; private: std::vector obj_, collb_, colub_; @@ -194,7 +194,7 @@ class CV_EXPORTS FromFileMotionReader : public ImageMotionEstimatorBase public: FromFileMotionReader(const String &path); - virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0); + virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0) CV_OVERRIDE; private: std::ifstream file_; @@ -205,10 +205,10 @@ class CV_EXPORTS ToFileMotionWriter : public ImageMotionEstimatorBase public: ToFileMotionWriter(const String &path, Ptr estimator); - virtual void setMotionModel(MotionModel val) { motionEstimator_->setMotionModel(val); } - virtual MotionModel motionModel() const { return motionEstimator_->motionModel(); } + virtual void setMotionModel(MotionModel val) CV_OVERRIDE { motionEstimator_->setMotionModel(val); } + virtual MotionModel motionModel() const CV_OVERRIDE { return motionEstimator_->motionModel(); } - virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0); + virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0) CV_OVERRIDE; private: std::ofstream file_; @@ -223,8 +223,8 @@ class CV_EXPORTS KeypointBasedMotionEstimator : public ImageMotionEstimatorBase public: KeypointBasedMotionEstimator(Ptr estimator); - virtual void setMotionModel(MotionModel val) { motionEstimator_->setMotionModel(val); } - virtual MotionModel motionModel() const { return motionEstimator_->motionModel(); } + virtual void setMotionModel(MotionModel val) CV_OVERRIDE { motionEstimator_->setMotionModel(val); } + virtual MotionModel motionModel() const CV_OVERRIDE { return motionEstimator_->motionModel(); } void setDetector(Ptr val) { detector_ = val; } Ptr detector() const { return detector_; } @@ -235,7 +235,7 @@ public: void setOutlierRejector(Ptr val) { outlierRejector_ = val; } Ptr outlierRejector() const { return outlierRejector_; } - virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0); + virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0) CV_OVERRIDE; Mat estimate(InputArray frame0, InputArray frame1, bool *ok = 0); private: @@ -257,13 +257,13 @@ class CV_EXPORTS KeypointBasedMotionEstimatorGpu : public ImageMotionEstimatorBa public: KeypointBasedMotionEstimatorGpu(Ptr estimator); - virtual void setMotionModel(MotionModel val) { motionEstimator_->setMotionModel(val); } - virtual MotionModel motionModel() const { return motionEstimator_->motionModel(); } + virtual void setMotionModel(MotionModel val) CV_OVERRIDE { motionEstimator_->setMotionModel(val); } + virtual MotionModel motionModel() const CV_OVERRIDE { return motionEstimator_->motionModel(); } void setOutlierRejector(Ptr val) { outlierRejector_ = val; } Ptr outlierRejector() const { return outlierRejector_; } - virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0); + virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0) CV_OVERRIDE; Mat estimate(const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, bool *ok = 0); private: diff --git a/modules/videostab/include/opencv2/videostab/inpainting.hpp b/modules/videostab/include/opencv2/videostab/inpainting.hpp index 61eeec357c..9c123f02ac 100644 --- a/modules/videostab/include/opencv2/videostab/inpainting.hpp +++ b/modules/videostab/include/opencv2/videostab/inpainting.hpp @@ -102,7 +102,7 @@ protected: class CV_EXPORTS NullInpainter : public InpainterBase { public: - virtual void inpaint(int /*idx*/, Mat &/*frame*/, Mat &/*mask*/) {} + virtual void inpaint(int /*idx*/, Mat &/*frame*/, Mat &/*mask*/) CV_OVERRIDE {} }; class CV_EXPORTS InpaintingPipeline : public InpainterBase @@ -111,14 +111,14 @@ public: void pushBack(Ptr inpainter) { inpainters_.push_back(inpainter); } bool empty() const { return inpainters_.empty(); } - virtual void setRadius(int val); - virtual void setMotionModel(MotionModel val); - virtual void setFrames(const std::vector &val); - virtual void setMotions(const std::vector &val); - virtual void setStabilizedFrames(const std::vector &val); - virtual void setStabilizationMotions(const std::vector &val); + virtual void setRadius(int val) CV_OVERRIDE; + virtual void setMotionModel(MotionModel val) CV_OVERRIDE; + virtual void setFrames(const std::vector &val) CV_OVERRIDE; + virtual void setMotions(const std::vector &val) CV_OVERRIDE; + virtual void setStabilizedFrames(const std::vector &val) CV_OVERRIDE; + virtual void setStabilizationMotions(const std::vector &val) CV_OVERRIDE; - virtual void inpaint(int idx, Mat &frame, Mat &mask); + virtual void inpaint(int idx, Mat &frame, Mat &mask) CV_OVERRIDE; private: std::vector > inpainters_; @@ -132,7 +132,7 @@ public: void setStdevThresh(float val) { stdevThresh_ = val; } float stdevThresh() const { return stdevThresh_; } - virtual void inpaint(int idx, Mat &frame, Mat &mask); + virtual void inpaint(int idx, Mat &frame, Mat &mask) CV_OVERRIDE; private: float stdevThresh_; @@ -155,7 +155,7 @@ public: void setBorderMode(int val) { borderMode_ = val; } int borderMode() const { return borderMode_; } - virtual void inpaint(int idx, Mat &frame, Mat &mask); + virtual void inpaint(int idx, Mat &frame, Mat &mask) CV_OVERRIDE; private: FastMarchingMethod fmm_; @@ -174,7 +174,7 @@ private: class CV_EXPORTS ColorAverageInpainter : public InpainterBase { public: - virtual void inpaint(int idx, Mat &frame, Mat &mask); + virtual void inpaint(int idx, Mat &frame, Mat &mask) CV_OVERRIDE; private: FastMarchingMethod fmm_; @@ -185,7 +185,7 @@ class CV_EXPORTS ColorInpainter : public InpainterBase public: ColorInpainter(int method = INPAINT_TELEA, double radius = 2.); - virtual void inpaint(int idx, Mat &frame, Mat &mask); + virtual void inpaint(int idx, Mat &frame, Mat &mask) CV_OVERRIDE; private: int method_; diff --git a/modules/videostab/include/opencv2/videostab/log.hpp b/modules/videostab/include/opencv2/videostab/log.hpp index 81c634a3d8..73e704996d 100644 --- a/modules/videostab/include/opencv2/videostab/log.hpp +++ b/modules/videostab/include/opencv2/videostab/log.hpp @@ -63,13 +63,13 @@ public: class CV_EXPORTS NullLog : public ILog { public: - virtual void print(const char * /*format*/, ...) {} + virtual void print(const char * /*format*/, ...) CV_OVERRIDE {} }; class CV_EXPORTS LogToStdout : public ILog { public: - virtual void print(const char *format, ...); + virtual void print(const char *format, ...) CV_OVERRIDE; }; //! @} diff --git a/modules/videostab/include/opencv2/videostab/motion_stabilizing.hpp b/modules/videostab/include/opencv2/videostab/motion_stabilizing.hpp index 5ea5a65a68..c50095bb12 100644 --- a/modules/videostab/include/opencv2/videostab/motion_stabilizing.hpp +++ b/modules/videostab/include/opencv2/videostab/motion_stabilizing.hpp @@ -75,7 +75,7 @@ public: virtual void stabilize( int size, const std::vector &motions, std::pair range, - Mat *stabilizationMotions); + Mat *stabilizationMotions) CV_OVERRIDE; private: std::vector > stabilizers_; @@ -91,7 +91,7 @@ public: virtual void stabilize( int size, const std::vector &motions, std::pair range, - Mat *stabilizationMotions); + Mat *stabilizationMotions) CV_OVERRIDE; }; class CV_EXPORTS GaussianMotionFilter : public MotionFilterBase @@ -104,7 +104,7 @@ public: float stdev() const { return stdev_; } virtual Mat stabilize( - int idx, const std::vector &motions, std::pair range); + int idx, const std::vector &motions, std::pair range) CV_OVERRIDE; private: int radius_; @@ -142,7 +142,7 @@ public: virtual void stabilize( int size, const std::vector &motions, std::pair range, - Mat *stabilizationMotions); + Mat *stabilizationMotions) CV_OVERRIDE; private: MotionModel model_; diff --git a/modules/videostab/include/opencv2/videostab/optical_flow.hpp b/modules/videostab/include/opencv2/videostab/optical_flow.hpp index d631488999..63f0f3b827 100644 --- a/modules/videostab/include/opencv2/videostab/optical_flow.hpp +++ b/modules/videostab/include/opencv2/videostab/optical_flow.hpp @@ -99,7 +99,7 @@ class CV_EXPORTS SparsePyrLkOptFlowEstimator public: virtual void run( InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, - OutputArray status, OutputArray errors); + OutputArray status, OutputArray errors) CV_OVERRIDE; }; #ifdef HAVE_OPENCV_CUDAOPTFLOW @@ -112,7 +112,7 @@ public: virtual void run( InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, - OutputArray status, OutputArray errors); + OutputArray status, OutputArray errors) CV_OVERRIDE; void run(const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, const cuda::GpuMat &points0, cuda::GpuMat &points1, cuda::GpuMat &status, cuda::GpuMat &errors); diff --git a/modules/videostab/include/opencv2/videostab/outlier_rejection.hpp b/modules/videostab/include/opencv2/videostab/outlier_rejection.hpp index 9b9b3844cc..1d29896bf3 100644 --- a/modules/videostab/include/opencv2/videostab/outlier_rejection.hpp +++ b/modules/videostab/include/opencv2/videostab/outlier_rejection.hpp @@ -68,7 +68,7 @@ class CV_EXPORTS NullOutlierRejector : public IOutlierRejector { public: virtual void process( - Size frameSize, InputArray points0, InputArray points1, OutputArray mask); + Size frameSize, InputArray points0, InputArray points1, OutputArray mask) CV_OVERRIDE; }; class CV_EXPORTS TranslationBasedLocalOutlierRejector : public IOutlierRejector @@ -83,7 +83,7 @@ public: RansacParams ransacParams() const { return ransacParams_; } virtual void process( - Size frameSize, InputArray points0, InputArray points1, OutputArray mask); + Size frameSize, InputArray points0, InputArray points1, OutputArray mask) CV_OVERRIDE; private: Size cellSize_; diff --git a/modules/videostab/include/opencv2/videostab/stabilizer.hpp b/modules/videostab/include/opencv2/videostab/stabilizer.hpp index b78b4eaef4..634a0aa9c6 100644 --- a/modules/videostab/include/opencv2/videostab/stabilizer.hpp +++ b/modules/videostab/include/opencv2/videostab/stabilizer.hpp @@ -144,14 +144,14 @@ public: void setMotionFilter(Ptr val) { motionFilter_ = val; } Ptr motionFilter() const { return motionFilter_; } - virtual void reset(); - virtual Mat nextFrame() { return nextStabilizedFrame(); } + virtual void reset() CV_OVERRIDE; + virtual Mat nextFrame() CV_OVERRIDE { return nextStabilizedFrame(); } protected: - virtual void setUp(const Mat &firstFrame); - virtual Mat estimateMotion(); - virtual Mat estimateStabilizationMotion(); - virtual Mat postProcessFrame(const Mat &frame); + virtual void setUp(const Mat &firstFrame) CV_OVERRIDE; + virtual Mat estimateMotion() CV_OVERRIDE; + virtual Mat estimateStabilizationMotion() CV_OVERRIDE; + virtual Mat postProcessFrame(const Mat &frame) CV_OVERRIDE; Ptr motionFilter_; }; @@ -170,16 +170,16 @@ public: void setEstimateTrimRatio(bool val) { mustEstTrimRatio_ = val; } bool mustEstimateTrimaRatio() const { return mustEstTrimRatio_; } - virtual void reset(); - virtual Mat nextFrame(); + virtual void reset() CV_OVERRIDE; + virtual Mat nextFrame() CV_OVERRIDE; protected: void runPrePassIfNecessary(); - virtual void setUp(const Mat &firstFrame); - virtual Mat estimateMotion(); - virtual Mat estimateStabilizationMotion(); - virtual Mat postProcessFrame(const Mat &frame); + virtual void setUp(const Mat &firstFrame) CV_OVERRIDE; + virtual Mat estimateMotion() CV_OVERRIDE; + virtual Mat estimateStabilizationMotion() CV_OVERRIDE; + virtual Mat postProcessFrame(const Mat &frame) CV_OVERRIDE; Ptr motionStabilizer_; Ptr wobbleSuppressor_; diff --git a/modules/videostab/include/opencv2/videostab/wobble_suppression.hpp b/modules/videostab/include/opencv2/videostab/wobble_suppression.hpp index a44410bfd6..19a5a74b82 100644 --- a/modules/videostab/include/opencv2/videostab/wobble_suppression.hpp +++ b/modules/videostab/include/opencv2/videostab/wobble_suppression.hpp @@ -95,7 +95,7 @@ protected: class CV_EXPORTS NullWobbleSuppressor : public WobbleSuppressorBase { public: - virtual void suppress(int idx, const Mat &frame, Mat &result); + virtual void suppress(int idx, const Mat &frame, Mat &result) CV_OVERRIDE; }; class CV_EXPORTS MoreAccurateMotionWobbleSuppressorBase : public WobbleSuppressorBase @@ -113,7 +113,7 @@ protected: class CV_EXPORTS MoreAccurateMotionWobbleSuppressor : public MoreAccurateMotionWobbleSuppressorBase { public: - virtual void suppress(int idx, const Mat &frame, Mat &result); + virtual void suppress(int idx, const Mat &frame, Mat &result) CV_OVERRIDE; private: Mat_ mapx_, mapy_; diff --git a/modules/videostab/src/frame_source.cpp b/modules/videostab/src/frame_source.cpp index 07237de2a4..a0176f131e 100644 --- a/modules/videostab/src/frame_source.cpp +++ b/modules/videostab/src/frame_source.cpp @@ -62,7 +62,7 @@ public: VideoFileSourceImpl(const String &path, bool volatileFrame) : path_(path), volatileFrame_(volatileFrame) { reset(); } - virtual void reset() + virtual void reset() CV_OVERRIDE { #ifdef HAVE_OPENCV_VIDEOIO vc.release(); @@ -74,7 +74,7 @@ public: #endif } - virtual Mat nextFrame() + virtual Mat nextFrame() CV_OVERRIDE { Mat frame; #ifdef HAVE_OPENCV_VIDEOIO diff --git a/modules/viz/CMakeLists.txt b/modules/viz/CMakeLists.txt index 3575a0cb6e..903022bbaf 100644 --- a/modules/viz/CMakeLists.txt +++ b/modules/viz/CMakeLists.txt @@ -24,7 +24,7 @@ if(NOT BUILD_SHARED_LIBS) endif() endif() -ocv_warnings_disable(CMAKE_CXX_FLAGS -Winconsistent-missing-override) +ocv_warnings_disable(CMAKE_CXX_FLAGS -Winconsistent-missing-override -Wsuggest-override) ocv_define_module(viz opencv_core WRAP python) ocv_target_link_libraries(${the_module} LINK_PRIVATE ${VTK_LIBRARIES}) diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt index 5cb736e19d..a96b9e6ad8 100644 --- a/samples/cpp/CMakeLists.txt +++ b/samples/cpp/CMakeLists.txt @@ -43,6 +43,9 @@ ocv_list_filterout(cpp_samples "real_time_pose_estimation/") foreach(sample_filename ${cpp_samples}) if(sample_filename MATCHES "/viz/") include(${VTK_USE_FILE}) + if(COMMAND ocv_warnings_disable) # eliminate warnings from VTK headers (include directory is not "SYSTEM") + ocv_warnings_disable(CMAKE_CXX_FLAGS -Winconsistent-missing-override -Wsuggest-override) + endif() endif() set(package "cpp") if(sample_filename MATCHES "tutorial_code") diff --git a/samples/cpp/dbt_face_detection.cpp b/samples/cpp/dbt_face_detection.cpp index a46ec12c4a..8e5112f121 100644 --- a/samples/cpp/dbt_face_detection.cpp +++ b/samples/cpp/dbt_face_detection.cpp @@ -24,12 +24,12 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector CV_Assert(detector); } - void detect(const cv::Mat &Image, std::vector &objects) + void detect(const cv::Mat &Image, std::vector &objects) CV_OVERRIDE { Detector->detectMultiScale(Image, objects, scaleFactor, minNeighbours, 0, minObjSize, maxObjSize); } - virtual ~CascadeDetectorAdapter() + virtual ~CascadeDetectorAdapter() CV_OVERRIDE {} private: diff --git a/samples/cpp/tutorial_code/core/how_to_use_OpenCV_parallel_for_/how_to_use_OpenCV_parallel_for_.cpp b/samples/cpp/tutorial_code/core/how_to_use_OpenCV_parallel_for_/how_to_use_OpenCV_parallel_for_.cpp index ed7d4a0155..2dcc1ff107 100644 --- a/samples/cpp/tutorial_code/core/how_to_use_OpenCV_parallel_for_/how_to_use_OpenCV_parallel_for_.cpp +++ b/samples/cpp/tutorial_code/core/how_to_use_OpenCV_parallel_for_/how_to_use_OpenCV_parallel_for_.cpp @@ -42,7 +42,7 @@ public: { } - virtual void operator ()(const Range& range) const + virtual void operator ()(const Range& range) const CV_OVERRIDE { for (int r = range.start; r < range.end; r++) { diff --git a/samples/cpp/videostab.cpp b/samples/cpp/videostab.cpp index e9afd0f4fe..15d68dc2dd 100644 --- a/samples/cpp/videostab.cpp +++ b/samples/cpp/videostab.cpp @@ -192,7 +192,7 @@ public: MotionEstimatorRansacL2Builder(CommandLineParser &command, bool use_gpu, const string &_prefix = "") : IMotionEstimatorBuilder(command), gpu(use_gpu), prefix(_prefix) {} - virtual Ptr build() + virtual Ptr build() CV_OVERRIDE { Ptr est = makePtr(motionModel(arg(prefix + "model"))); @@ -245,7 +245,7 @@ public: MotionEstimatorL1Builder(CommandLineParser &command, bool use_gpu, const string &_prefix = "") : IMotionEstimatorBuilder(command), gpu(use_gpu), prefix(_prefix) {} - virtual Ptr build() + virtual Ptr build() CV_OVERRIDE { Ptr est = makePtr(motionModel(arg(prefix + "model")));