ximgproc: apply CV_OVERRIDE/CV_FINAL

pull/1588/head
Alexander Alekhin 7 years ago
parent ec65e5b29c
commit 64d5886186
  1. 72
      modules/ximgproc/src/adaptive_manifold_filter_n.cpp
  2. 2
      modules/ximgproc/src/anisodiff.cpp
  3. 8
      modules/ximgproc/src/deriche_filter.cpp
  4. 28
      modules/ximgproc/src/disparity_filters.cpp
  5. 34
      modules/ximgproc/src/dtfilter_cpu.hpp
  6. 24
      modules/ximgproc/src/dtfilter_cpu.inl.hpp
  7. 50
      modules/ximgproc/src/edgeboxes.cpp
  8. 4
      modules/ximgproc/src/fast_line_detector.cpp
  9. 12
      modules/ximgproc/src/fgs_filter.cpp
  10. 20
      modules/ximgproc/src/graphsegmentation.cpp
  11. 20
      modules/ximgproc/src/guided_filter.cpp
  12. 26
      modules/ximgproc/src/joint_bilateral_filter.cpp
  13. 6
      modules/ximgproc/src/l0_smooth.cpp
  14. 20
      modules/ximgproc/src/lsc.cpp
  15. 8
      modules/ximgproc/src/paillou_filter.cpp
  16. 2
      modules/ximgproc/src/ridgedetectionfilter.cpp
  17. 8
      modules/ximgproc/src/seeds.cpp
  18. 74
      modules/ximgproc/src/selectivesearchsegmentation.cpp
  19. 18
      modules/ximgproc/src/slic.cpp
  20. 32
      modules/ximgproc/src/sparse_match_interpolators.cpp
  21. 10
      modules/ximgproc/src/structured_edge_detection.cpp
  22. 28
      modules/ximgproc/test/test_adaptive_manifold_ref_impl.cpp

@ -2,26 +2,26 @@
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3 - clause BSD License)
*
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met :
*
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and / or other materials provided with the distribution.
*
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
@ -109,16 +109,22 @@ class AdaptiveManifoldFilterN : public AdaptiveManifoldFilter
public:
AdaptiveManifoldFilterN();
void filter(InputArray src, OutputArray dst, InputArray joint);
void filter(InputArray src, OutputArray dst, InputArray joint) CV_OVERRIDE;
void collectGarbage();
void collectGarbage() CV_OVERRIDE;
CV_IMPL_PROPERTY(double, SigmaS, sigma_s_)
CV_IMPL_PROPERTY(double, SigmaR, sigma_r_)
CV_IMPL_PROPERTY(int, TreeHeight, tree_height_)
CV_IMPL_PROPERTY(int, PCAIterations, num_pca_iterations_)
CV_IMPL_PROPERTY(bool, AdjustOutliers, adjust_outliers_)
CV_IMPL_PROPERTY(bool, UseRNG, useRNG)
inline double getSigmaS() const CV_OVERRIDE { return sigma_s_; }
inline void setSigmaS(double val) CV_OVERRIDE { sigma_s_ = val; }
inline double getSigmaR() const CV_OVERRIDE { return sigma_r_; }
inline void setSigmaR(double val) CV_OVERRIDE { sigma_r_ = val; }
inline int getTreeHeight() const CV_OVERRIDE { return tree_height_; }
inline void setTreeHeight(int val) CV_OVERRIDE { tree_height_ = val; }
inline int getPCAIterations() const CV_OVERRIDE { return num_pca_iterations_; }
inline void setPCAIterations(int val) CV_OVERRIDE { num_pca_iterations_ = val; }
inline bool getAdjustOutliers() const CV_OVERRIDE { return adjust_outliers_; }
inline void setAdjustOutliers(bool val) CV_OVERRIDE { adjust_outliers_ = val; }
inline bool getUseRNG() const CV_OVERRIDE { return useRNG; }
inline void setUseRNG(bool val) CV_OVERRIDE { useRNG = val; }
protected:
@ -130,7 +136,7 @@ protected:
bool useRNG;
private:
Size srcSize;
Size smallSize;
int jointCnNum;
@ -142,14 +148,14 @@ private:
vector<Mat> etaFull;
vector<Mat> sum_w_ki_Psi_blur_;
Mat sum_w_ki_Psi_blur_0_;
Mat sum_w_ki_Psi_blur_0_;
Mat w_k;
Mat Psi_splat_0_small;
vector<Mat> Psi_splat_small;
Mat1f minDistToManifoldSquared;
int curTreeHeight;
float sigma_r_over_sqrt_2;
@ -256,8 +262,8 @@ private: /*Parallelization routines*/
MapFunc transform;
const vector<Mat>& srcv;
vector<Mat>& dstv;
void operator () (const Range& range) const
void operator () (const Range& range) const CV_OVERRIDE
{
for (int i = range.start; i < range.end; i++)
(instancePtr->*transform)(srcv[i], dstv[i]);
@ -299,7 +305,7 @@ void AdaptiveManifoldFilterN::initBuffers(InputArray src_, InputArray joint_)
sum_w_ki_Psi_blur_0_ = Mat::zeros(srcSize, CV_32FC1);
w_k.create(srcSize, CV_32FC1);
Psi_splat_0_small.create(smallSize, CV_32FC1);
if (adjust_outliers_)
minDistToManifoldSquared.create(srcSize);
}
@ -335,7 +341,7 @@ void AdaptiveManifoldFilterN::initSrcAndJoint(InputArray src_, InputArray joint_
else
{
splitChannels(joint_, jointCn);
jointCnNum = (int)jointCn.size();
int jointDepth = jointCn[0].depth();
Size jointSize = jointCn[0].size();
@ -364,7 +370,7 @@ void AdaptiveManifoldFilterN::filter(InputArray src, OutputArray dst, InputArray
const double seedCoef = jointCn[0].at<float>(srcSize.height/2, srcSize.width/2);
const uint64 baseCoef = numeric_limits<uint64>::max() / 0xFFFF;
rnd.state = static_cast<int64>(baseCoef*seedCoef);
Mat1b cluster0(srcSize, 0xFF);
vector<Mat> eta0(jointCnNum);
for (int i = 0; i < jointCnNum; i++)
@ -431,7 +437,7 @@ void AdaptiveManifoldFilterN::buildManifoldsAndPerformFiltering(vector<Mat>& eta
upsample(eta, etaFull);
compute_w_k(etaFull, w_k, sigma_r_over_sqrt_2, treeLevel);
}
//blurring
Psi_splat_small.resize(srcCnNum);
for (int si = 0; si < srcCnNum; si++)
@ -611,13 +617,13 @@ void AdaptiveManifoldFilterN::computeDTHor(vector<Mat>& srcCn, Mat& dst, float s
else
add_sqr_dif(dstRow, curCnRow, curCnRow + 1, w - 1);
}
mad(dstRow, dstRow, sigmaRatioSqr, 1.0f, w - 1);
sqrt_(dstRow, dstRow, w - 1);
mul(dstRow, dstRow, lnAlpha, w - 1);
//Exp_32f(dstRow, dstRow, w - 1);
}
cv::exp(dst, dst);
}
@ -680,7 +686,7 @@ void AdaptiveManifoldFilterN::RFFilterPass(vector<Mat>& joint, vector<Mat>& Psi_
void AdaptiveManifoldFilterN::computeClusters(Mat1b& cluster, Mat1b& cluster_minus, Mat1b& cluster_plus)
{
Mat1f difOreientation;
if (jointCnNum > 1)
{
@ -723,7 +729,7 @@ void AdaptiveManifoldFilterN::computeEta(Mat& teta, Mat1b& cluster, vector<Mat>&
Mat1f tetaMasked = Mat1f::zeros(srcSize);
teta.copyTo(tetaMasked, cluster);
float sigma_s = (float)(sigma_s_ / getResizeRatio());
Mat1f tetaMaskedBlur;
@ -750,7 +756,7 @@ void AdaptiveManifoldFilterN::computeEigenVector(const vector<Mat>& X, const Mat
vecDst.create(1, cnNum);
CV_Assert(vecRand.size() == Size(cnNum, 1) && vecDst.size() == Size(cnNum, 1));
CV_Assert(mask.rows == height && mask.cols == width);
const float *pVecRand = vecRand.ptr<float>();
Mat1d vecDstd(1, cnNum, 0.0);
double *pVecDst = vecDstd.ptr<double>();
@ -763,7 +769,7 @@ void AdaptiveManifoldFilterN::computeEigenVector(const vector<Mat>& X, const Mat
const uchar *maskRow = mask.ptr<uchar>(i);
float *mulRow = Xw.ptr<float>(i);
//first multiplication
//first multiplication
for (int cn = 0; cn < cnNum; cn++)
{
const float *srcRow = X[cn].ptr<float>(i);
@ -793,7 +799,7 @@ void AdaptiveManifoldFilterN::computeEigenVector(const vector<Mat>& X, const Mat
for (int j = 0; j < width; j++)
curCnSum += mulRow[j]*srcRow[j];
//TODO: parallel reduce
//TODO: parallel reduce
pVecDst[cn] += curCnSum;
}
}
@ -852,7 +858,7 @@ Ptr<AdaptiveManifoldFilter> AdaptiveManifoldFilter::create()
Ptr<AdaptiveManifoldFilter> createAMFilter(double sigma_s, double sigma_r, bool adjust_outliers)
{
Ptr<AdaptiveManifoldFilter> amf(new AdaptiveManifoldFilterN());
amf->setSigmaS(sigma_s);
amf->setSigmaR(sigma_r);
amf->setAdjustOutliers(adjust_outliers);

@ -92,7 +92,7 @@ public:
alpha_ = alpha;
}
void operator()(const Range& range) const
void operator()(const Range& range) const CV_OVERRIDE
{
const int cn = 3;
int cols = src->cols;

@ -162,7 +162,7 @@ public:
verbose(false)
{}
void Verbose(bool b) { verbose = b; }
virtual void operator()(const Range& range) const
virtual void operator()(const Range& range) const CV_OVERRIDE
{
CV_Assert(img.depth()==CV_8UC1 || img.depth()==CV_8SC1 || img.depth()==CV_16SC1 || img.depth()==CV_16UC1);
CV_Assert(dst.depth()==CV_32FC1);
@ -209,7 +209,7 @@ public:
verbose(false)
{}
void Verbose(bool b) { verbose = b; }
virtual void operator()(const Range& range) const
virtual void operator()(const Range& range) const CV_OVERRIDE
{
CV_Assert(img.depth()==CV_32FC1);
CV_Assert(dst.depth()==CV_32FC1);
@ -282,7 +282,7 @@ public:
verbose(false)
{}
void Verbose(bool b) { verbose = b; }
virtual void operator()(const Range& range) const
virtual void operator()(const Range& range) const CV_OVERRIDE
{
CV_Assert(img.depth()==CV_32FC1);
CV_Assert(dst.depth()==CV_32FC1);
@ -357,7 +357,7 @@ public:
verbose(false)
{}
void Verbose(bool b) { verbose = b; }
virtual void operator()(const Range& range) const
virtual void operator()(const Range& range) const CV_OVERRIDE
{
CV_Assert(img.depth()==CV_8UC1 || img.depth()==CV_8SC1 || img.depth()==CV_16SC1 || img.depth()==CV_16UC1);
CV_Assert(dst.depth()==CV_32FC1);

@ -76,7 +76,7 @@ protected:
int nstripes, stripe_sz;
ComputeDiscontinuityAwareLRC_ParBody(DisparityWLSFilterImpl& _wls, Mat& _left_disp, Mat& _right_disp, Mat& _left_disc, Mat& _right_disc, Mat& _dst, Rect _left_ROI, Rect _right_ROI, int _nstripes);
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
struct ComputeDepthDisc_ParBody : public ParallelLoopBody
@ -86,7 +86,7 @@ protected:
int nstripes, stripe_sz;
ComputeDepthDisc_ParBody(DisparityWLSFilterImpl& _wls, Mat& _disp, Mat& _disp_squares, Mat& _dst, int _nstripes);
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
typedef void (DisparityWLSFilterImpl::*MatOp)(Mat& src, Mat& dst);
@ -99,7 +99,7 @@ protected:
vector<Mat*> dst;
ParallelMatOp_ParBody(DisparityWLSFilterImpl& _wls, vector<MatOp> _ops, vector<Mat*>& _src, vector<Mat*>& _dst);
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
void boxFilterOp(Mat& src,Mat& dst)
@ -121,23 +121,23 @@ protected:
public:
static Ptr<DisparityWLSFilterImpl> create(bool _use_confidence, int l_offs, int r_offs, int t_offs, int b_offs, int min_disp);
void filter(InputArray disparity_map_left, InputArray left_view, OutputArray filtered_disparity_map, InputArray disparity_map_right, Rect ROI, InputArray);
void filter(InputArray disparity_map_left, InputArray left_view, OutputArray filtered_disparity_map, InputArray disparity_map_right, Rect ROI, InputArray) CV_OVERRIDE;
void filter_(InputArray disparity_map_left, InputArray left_view, OutputArray filtered_disparity_map, InputArray disparity_map_right, Rect ROI);
double getLambda() {return lambda;}
void setLambda(double _lambda) {lambda = _lambda;}
double getLambda() CV_OVERRIDE { return lambda; }
void setLambda(double _lambda) CV_OVERRIDE { lambda = _lambda; }
double getSigmaColor() {return sigma_color;}
void setSigmaColor(double _sigma_color) {sigma_color = _sigma_color;}
double getSigmaColor() CV_OVERRIDE { return sigma_color; }
void setSigmaColor(double _sigma_color) CV_OVERRIDE { sigma_color = _sigma_color; }
int getLRCthresh() {return LRC_thresh;}
void setLRCthresh(int _LRC_thresh) {LRC_thresh = _LRC_thresh;}
int getLRCthresh() CV_OVERRIDE { return LRC_thresh; }
void setLRCthresh(int _LRC_thresh) CV_OVERRIDE { LRC_thresh = _LRC_thresh; }
int getDepthDiscontinuityRadius() {return depth_discontinuity_radius;}
void setDepthDiscontinuityRadius(int _disc_radius) {depth_discontinuity_radius = _disc_radius;}
int getDepthDiscontinuityRadius() CV_OVERRIDE { return depth_discontinuity_radius; }
void setDepthDiscontinuityRadius(int _disc_radius) CV_OVERRIDE { depth_discontinuity_radius = _disc_radius; }
Mat getConfidenceMap() {return confidence_map;}
Rect getROI() {return valid_disp_ROI;}
Mat getConfidenceMap() CV_OVERRIDE { return confidence_map; }
Rect getROI() CV_OVERRIDE { return valid_disp_ROI; }
};
void DisparityWLSFilterImpl::init(double _lambda, double _sigma_color, bool _use_confidence, int l_offs, int r_offs, int t_offs, int b_offs, int _min_disp)

@ -2,26 +2,26 @@
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3 - clause BSD License)
*
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met :
*
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and / or other materials provided with the distribution.
*
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
@ -59,7 +59,7 @@ public: /*Non-template methods*/
static Ptr<DTFilterCPU> createRF(InputArray adistHor, InputArray adistVert, double sigmaSpatial, double sigmaColor, int numIters = 3);
void filter(InputArray src, OutputArray dst, int dDepth = -1);
void filter(InputArray src, OutputArray dst, int dDepth = -1) CV_OVERRIDE;
void setSingleFilterCall(bool value);
@ -141,7 +141,7 @@ protected: /*Wrappers for parallelization*/
float radius;
FilterNC_horPass(Mat& src_, Mat& idist_, Mat& dst_);
void operator() (const Range& range) const;
void operator() (const Range& range) const CV_OVERRIDE;
};
template <typename WorkVec>
@ -151,7 +151,7 @@ protected: /*Wrappers for parallelization*/
float radius;
FilterIC_horPass(Mat& src_, Mat& idist_, Mat& dist_, Mat& dst_);
void operator() (const Range& range) const;
void operator() (const Range& range) const CV_OVERRIDE;
};
template <typename WorkVec>
@ -161,7 +161,7 @@ protected: /*Wrappers for parallelization*/
int iteration;
FilterRF_horPass(Mat& res_, Mat& alphaD_, int iteration_);
void operator() (const Range& range) const;
void operator() (const Range& range) const CV_OVERRIDE;
Range getRange() const { return Range(0, res.rows); }
};
@ -172,7 +172,7 @@ protected: /*Wrappers for parallelization*/
int iteration;
FilterRF_vertPass(Mat& res_, Mat& alphaD_, int iteration_);
void operator() (const Range& range) const;
void operator() (const Range& range) const CV_OVERRIDE;
#ifdef CV_GET_NUM_THREAD_WORKS_PROPERLY
Range getRange() const { return Range(0, cv::getNumThreads()); }
#else
@ -187,7 +187,7 @@ protected: /*Wrappers for parallelization*/
Mat &guide, &dst;
ComputeIDTHor_ParBody(DTFilterCPU& dtf_, Mat& guide_, Mat& dst_);
void operator() (const Range& range) const;
void operator() (const Range& range) const CV_OVERRIDE;
Range getRange() { return Range(0, guide.rows); }
};
@ -199,7 +199,7 @@ protected: /*Wrappers for parallelization*/
IDistType maxRadius;
ComputeDTandIDTHor_ParBody(DTFilterCPU& dtf_, Mat& guide_, Mat& dist_, Mat& idist_);
void operator() (const Range& range) const;
void operator() (const Range& range) const CV_OVERRIDE;
Range getRange() { return Range(0, guide.rows); }
};
@ -211,7 +211,7 @@ protected: /*Wrappers for parallelization*/
float lna;
ComputeA0DTHor_ParBody(DTFilterCPU& dtf_, Mat& guide_);
void operator() (const Range& range) const;
void operator() (const Range& range) const CV_OVERRIDE;
Range getRange() { return Range(0, guide.rows); }
~ComputeA0DTHor_ParBody();
};
@ -224,7 +224,7 @@ protected: /*Wrappers for parallelization*/
float lna;
ComputeA0DTVert_ParBody(DTFilterCPU& dtf_, Mat& guide_);
void operator() (const Range& range) const;
void operator() (const Range& range) const CV_OVERRIDE;
Range getRange() const { return Range(0, guide.rows - 1); }
~ComputeA0DTVert_ParBody();
};
@ -291,4 +291,4 @@ void domainTransformFilter( const Mat& guide,
#include "dtfilter_cpu.inl.hpp"
#endif
#endif

@ -2,26 +2,26 @@
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3 - clause BSD License)
*
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met :
*
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and / or other materials provided with the distribution.
*
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
@ -137,7 +137,7 @@ void DTFilterCPU::filter_(const Mat& src, Mat& dst, int dDepth)
Mat res;
if (dDepth == -1) dDepth = src.depth();
//small optimization to avoid extra copying of data
bool useDstAsRes = (dDepth == traits::Depth<WorkVec>::value && (mode == DTF_NC || mode == DTF_RF));
if (useDstAsRes)
@ -193,7 +193,7 @@ void DTFilterCPU::filter_(const Mat& src, Mat& dst, int dDepth)
bool useA0DT = (singleFilterCall || iter == 1);
Mat& a0dHor = (useA0DT) ? a0distHor : adistHor;
Mat& a0dVert = (useA0DT) ? a0distVert : adistVert;
FilterRF_horPass<WorkVec> horParBody(res, a0dHor, iter);
FilterRF_vertPass<WorkVec> vertParBody(res, a0dVert, iter);
parallel_for_(horParBody.getRange(), horParBody);
@ -261,7 +261,7 @@ void DTFilterCPU::prepareSrcImg_IC(const Mat& src, Mat& dst, Mat& dstT)
{
line = dstOutT.ptr<WorkVec>(i);
line[0] = topLine[i];
line[ri] = bottomLine[i];
line[ri] = bottomLine[i];
}
}
@ -514,7 +514,7 @@ void DTFilterCPU::ComputeDTandIDTHor_ParBody<GuideVec>::operator()(const Range&
DistType curDist;
IDistType curIDist = (IDistType)0;
int j;
distLine[-1] = maxRadius;
//idistLine[-1] = curIDist - maxRadius;
idistLine[0] = curIDist;
@ -621,4 +621,4 @@ void domainTransformFilter( const Mat& guide,
}
}
#endif
#endif

@ -79,10 +79,10 @@ public:
float gamma,
float kappa);
virtual void getBoundingBoxes(InputArray edge_map, InputArray orientation_map, std::vector<Rect> &boxes);
virtual void getBoundingBoxes(InputArray edge_map, InputArray orientation_map, std::vector<Rect> &boxes) CV_OVERRIDE;
float getAlpha() const { return _alpha; }
void setAlpha(float value)
float getAlpha() const CV_OVERRIDE { return _alpha; }
void setAlpha(float value) CV_OVERRIDE
{
_alpha = value;
_sxStep = sqrt(1 / _alpha);
@ -90,38 +90,38 @@ public:
_xyStepRatio = (1 - _alpha) / (1 + _alpha);
}
float getBeta() const { return _beta; }
void setBeta(float value) { _beta = value; }
float getBeta() const CV_OVERRIDE { return _beta; }
void setBeta(float value) CV_OVERRIDE { _beta = value; }
float getEta() const { return _eta; }
void setEta(float value) { _eta = value; }
float getEta() const CV_OVERRIDE { return _eta; }
void setEta(float value) CV_OVERRIDE { _eta = value; }
float getMinScore() const { return _minScore; }
void setMinScore(float value) { _minScore = value; }
float getMinScore() const CV_OVERRIDE { return _minScore; }
void setMinScore(float value) CV_OVERRIDE { _minScore = value; }
int getMaxBoxes() const { return _maxBoxes; }
void setMaxBoxes(int value) { _maxBoxes = value; }
int getMaxBoxes() const CV_OVERRIDE { return _maxBoxes; }
void setMaxBoxes(int value) CV_OVERRIDE { _maxBoxes = value; }
float getEdgeMinMag() const { return _edgeMinMag; }
void setEdgeMinMag(float value) { _edgeMinMag = value; }
float getEdgeMinMag() const CV_OVERRIDE { return _edgeMinMag; }
void setEdgeMinMag(float value) CV_OVERRIDE { _edgeMinMag = value; }
float getEdgeMergeThr() const { return _edgeMergeThr; }
void setEdgeMergeThr(float value) { _edgeMergeThr = value; }
float getEdgeMergeThr() const CV_OVERRIDE { return _edgeMergeThr; }
void setEdgeMergeThr(float value) CV_OVERRIDE { _edgeMergeThr = value; }
float getClusterMinMag() const { return _clusterMinMag; }
void setClusterMinMag(float value) { _clusterMinMag = value; }
float getClusterMinMag() const CV_OVERRIDE { return _clusterMinMag; }
void setClusterMinMag(float value) CV_OVERRIDE { _clusterMinMag = value; }
float getMaxAspectRatio() const { return _maxAspectRatio; }
void setMaxAspectRatio(float value) { _maxAspectRatio = value; }
float getMaxAspectRatio() const CV_OVERRIDE { return _maxAspectRatio; }
void setMaxAspectRatio(float value) CV_OVERRIDE { _maxAspectRatio = value; }
float getMinBoxArea() const { return _minBoxArea; }
void setMinBoxArea(float value) { _minBoxArea = value; }
float getMinBoxArea() const CV_OVERRIDE { return _minBoxArea; }
void setMinBoxArea(float value) CV_OVERRIDE { _minBoxArea = value; }
float getGamma() const { return _gamma; }
void setGamma(float value) { _gamma = value; }
float getGamma() const CV_OVERRIDE { return _gamma; }
void setGamma(float value) CV_OVERRIDE { _gamma = value; }
float getKappa() const { return _kappa; }
void setKappa(float value)
float getKappa() const CV_OVERRIDE { return _kappa; }
void setKappa(float value) CV_OVERRIDE
{
_kappa = value;
_scaleNorm.resize(10000);

@ -49,7 +49,7 @@ class FastLineDetectorImpl : public FastLineDetector
* a line. Where Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 is the end.
* Returned lines are directed so that the brighter side is placed on left.
*/
void detect(InputArray _image, OutputArray _lines);
void detect(InputArray _image, OutputArray _lines) CV_OVERRIDE;
/**
* Draw lines on the given canvas.
@ -59,7 +59,7 @@ class FastLineDetectorImpl : public FastLineDetector
* @param lines The lines that need to be drawn
* @param draw_arrow If true, arrow heads will be drawn
*/
void drawSegments(InputOutputArray _image, InputArray lines, bool draw_arrow = false);
void drawSegments(InputOutputArray _image, InputArray lines, bool draw_arrow = false) CV_OVERRIDE;
private:
int imagewidth, imageheight, threshold_length;

@ -62,7 +62,7 @@ class FastGlobalSmootherFilterImpl : public FastGlobalSmootherFilter
{
public:
static Ptr<FastGlobalSmootherFilterImpl> create(InputArray guide, double lambda, double sigma_color, int num_iter,double lambda_attenuation);
void filter(InputArray src, OutputArray dst);
void filter(InputArray src, OutputArray dst) CV_OVERRIDE;
protected:
int w,h;
@ -85,7 +85,7 @@ protected:
int h;
HorizontalPass_ParBody(FastGlobalSmootherFilterImpl &_fgs, Mat& _cur, int _nstripes, int _h);
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
inline void process_4row_block(Mat* cur,int i);
inline void process_row(Mat* cur,int i);
@ -98,7 +98,7 @@ protected:
int w;
VerticalPass_ParBody(FastGlobalSmootherFilterImpl &_fgs, Mat& _cur, int _nstripes, int _w);
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
template<get_weight_op get_weight, const int num_ch>
@ -110,7 +110,7 @@ protected:
int h;
ComputeHorizontalWeights_ParBody(FastGlobalSmootherFilterImpl &_fgs, Mat& _guide, int _nstripes, int _h);
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
template<get_weight_op get_weight, const int num_ch>
@ -122,7 +122,7 @@ protected:
int w;
ComputeVerticalWeights_ParBody(FastGlobalSmootherFilterImpl &_fgs, Mat& _guide, int _nstripes, int _w);
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
struct ComputeLUT_ParBody : public ParallelLoopBody
@ -133,7 +133,7 @@ protected:
int sz;
ComputeLUT_ParBody(FastGlobalSmootherFilterImpl &_fgs, WorkType* _LUT, int _nstripes, int _sz);
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
};

@ -106,28 +106,28 @@ namespace cv {
name_ = "GraphSegmentation";
}
~GraphSegmentationImpl() {
~GraphSegmentationImpl() CV_OVERRIDE {
};
virtual void processImage(InputArray src, OutputArray dst);
virtual void processImage(InputArray src, OutputArray dst) CV_OVERRIDE;
virtual void setSigma(double sigma_) { if (sigma_ <= 0) { sigma_ = 0.001; } sigma = sigma_; }
virtual double getSigma() { return sigma; }
virtual void setSigma(double sigma_) CV_OVERRIDE { if (sigma_ <= 0) { sigma_ = 0.001; } sigma = sigma_; }
virtual double getSigma() CV_OVERRIDE { return sigma; }
virtual void setK(float k_) { k = k_; }
virtual float getK() { return k; }
virtual void setK(float k_) CV_OVERRIDE { k = k_; }
virtual float getK() CV_OVERRIDE { return k; }
virtual void setMinSize(int min_size_) { min_size = min_size_; }
virtual int getMinSize() { return min_size; }
virtual void setMinSize(int min_size_) CV_OVERRIDE { min_size = min_size_; }
virtual int getMinSize() CV_OVERRIDE { return min_size; }
virtual void write(FileStorage& fs) const {
virtual void write(FileStorage& fs) const CV_OVERRIDE {
fs << "name" << name_
<< "sigma" << sigma
<< "k" << k
<< "min_size" << (int)min_size;
}
virtual void read(const FileNode& fn) {
virtual void read(const FileNode& fn) CV_OVERRIDE {
CV_Assert( (String)fn["name"] == name_ );
sigma = (double)fn["sigma"];

@ -130,7 +130,7 @@ public:
static Ptr<GuidedFilterImpl> create(InputArray guide, int radius, double eps);
void filter(InputArray src, OutputArray dst, int dDepth = -1);
void filter(InputArray src, OutputArray dst, int dDepth = -1) CV_OVERRIDE;
protected:
@ -181,7 +181,7 @@ private: /*Routines to parallelize boxFilter and convertTo*/
GFTransform_ParBody(GuidedFilterImpl& gf_, vector<Mat>& srcv, vector<Mat>& dstv, TransformFunc func_);
GFTransform_ParBody(GuidedFilterImpl& gf_, vector<vector<Mat> >& srcvv, vector<vector<Mat> >& dstvv, TransformFunc func_);
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
Range getRange() const
{
@ -218,7 +218,7 @@ private: /*Parallel body classes*/
MulChannelsGuide_ParBody(GuidedFilterImpl& gf_, SymArray2D<Mat>& covars_)
: gf(gf_), covars(covars_) {}
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
struct ComputeCovGuideFromChannelsMul_ParBody : public ParallelLoopBody
@ -229,7 +229,7 @@ private: /*Parallel body classes*/
ComputeCovGuideFromChannelsMul_ParBody(GuidedFilterImpl& gf_, SymArray2D<Mat>& covars_)
: gf(gf_), covars(covars_) {}
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
struct ComputeCovGuideInv_ParBody : public ParallelLoopBody
@ -239,7 +239,7 @@ private: /*Parallel body classes*/
ComputeCovGuideInv_ParBody(GuidedFilterImpl& gf_, SymArray2D<Mat>& covars_);
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
@ -252,7 +252,7 @@ private: /*Parallel body classes*/
MulChannelsGuideAndSrc_ParBody(GuidedFilterImpl& gf_, vector<Mat>& srcCn_, vector<vector<Mat> >& cov_)
: gf(gf_), cov(cov_), srcCn(srcCn_) {}
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
struct ComputeCovFromSrcChannelsMul_ParBody : public ParallelLoopBody
@ -264,7 +264,7 @@ private: /*Parallel body classes*/
ComputeCovFromSrcChannelsMul_ParBody(GuidedFilterImpl& gf_, vector<Mat>& srcCnMean_, vector<vector<Mat> >& cov_)
: gf(gf_), cov(cov_), srcCnMean(srcCnMean_) {}
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
struct ComputeAlpha_ParBody : public ParallelLoopBody
@ -276,7 +276,7 @@ private: /*Parallel body classes*/
ComputeAlpha_ParBody(GuidedFilterImpl& gf_, vector<vector<Mat> >& alpha_, vector<vector<Mat> >& covSrc_)
: gf(gf_), alpha(alpha_), covSrc(covSrc_) {}
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
struct ComputeBeta_ParBody : public ParallelLoopBody
@ -289,7 +289,7 @@ private: /*Parallel body classes*/
ComputeBeta_ParBody(GuidedFilterImpl& gf_, vector<vector<Mat> >& alpha_, vector<Mat>& srcCnMean_, vector<Mat>& beta_)
: gf(gf_), alpha(alpha_), srcCnMean(srcCnMean_), beta(beta_) {}
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
struct ApplyTransform_ParBody : public ParallelLoopBody
@ -301,7 +301,7 @@ private: /*Parallel body classes*/
ApplyTransform_ParBody(GuidedFilterImpl& gf_, vector<vector<Mat> >& alpha_, vector<Mat>& beta_)
: gf(gf_), alpha(alpha_), beta(beta_) {}
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
};

@ -2,26 +2,26 @@
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3 - clause BSD License)
*
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met :
*
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and / or other materials provided with the distribution.
*
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
@ -74,7 +74,7 @@ public:
JointBilateralFilter_32f(Mat& joint_, Mat& src_, Mat& dst_, int radius_,
int maxk_, float scaleIndex_, int *spaceOfs_, float *spaceWeights_, float *expLUT_)
:
joint(joint_), src(src_), dst(dst_), radius(radius_), maxk(maxk_),
joint(joint_), src(src_), dst(dst_), radius(radius_), maxk(maxk_),
scaleIndex(scaleIndex_), spaceOfs(spaceOfs_), spaceWeights(spaceWeights_), expLUT(expLUT_)
{
CV_DbgAssert(joint.type() == traits::Type<JointVec>::value && src.type() == dst.type() && src.type() == traits::Type<SrcVec>::value);
@ -82,7 +82,7 @@ public:
CV_DbgAssert(joint.cols == src.cols && src.cols == dst.cols + 2*radius);
}
void operator () (const Range& range) const
void operator () (const Range& range) const CV_OVERRIDE
{
for (int i = radius + range.start; i < radius + range.end; i++)
{
@ -122,7 +122,7 @@ public:
void jointBilateralFilter_32f(Mat& joint, Mat& src, Mat& dst, int radius, double sigmaColor, double sigmaSpace, int borderType)
{
CV_DbgAssert(joint.depth() == CV_32F && src.depth() == CV_32F);
int d = 2*radius + 1;
int jCn = joint.channels();
const int kExpNumBinsPerChannel = 1 << 12;
@ -228,7 +228,7 @@ public:
CV_DbgAssert(joint.cols == src.cols && src.cols == dst.cols + 2 * radius);
}
void operator () (const Range& range) const
void operator () (const Range& range) const CV_OVERRIDE
{
typedef Vec<int, JointVec::channels> JointVeci;
typedef Vec<float, SrcVec::channels> SrcVecf;
@ -250,7 +250,7 @@ public:
int alpha = 0;
for (int cn = 0; cn < JointVec::channels; cn++)
alpha += std::abs(jointPix0[cn] - (int)jointPix[cn]);
float weight = spaceWeights[k] * expLUT[alpha];
uchar *srcPix = reinterpret_cast<uchar*>(srcCenterPixPtr + spaceOfs[k]);
@ -399,4 +399,4 @@ void jointBilateralFilter(InputArray joint_, InputArray src_, OutputArray dst_,
}
}
}
}

@ -54,7 +54,7 @@ namespace
{
src_ = s;
}
void operator() (const Range& range) const
void operator() (const Range& range) const CV_OVERRIDE
{
for (int i = range.start; i != range.end; i++)
{
@ -72,7 +72,7 @@ namespace
{
src_ = s;
}
void operator() (const Range& range) const
void operator() (const Range& range) const CV_OVERRIDE
{
for (int i = range.start; i != range.end; i++)
{
@ -95,7 +95,7 @@ namespace
denom_ = denom;
dst_ = dst;
}
void operator() (const Range& range) const
void operator() (const Range& range) const CV_OVERRIDE
{
for (int i = range.start; i != range.end; i++)
{

@ -59,22 +59,22 @@ public:
SuperpixelLSCImpl( InputArray image, int region_size, float ratio );
virtual ~SuperpixelLSCImpl();
virtual ~SuperpixelLSCImpl() CV_OVERRIDE;
// perform amount of iteration
virtual void iterate( int num_iterations = 10 );
virtual void iterate( int num_iterations = 10 ) CV_OVERRIDE;
// get amount of superpixels
virtual int getNumberOfSuperpixels() const;
virtual int getNumberOfSuperpixels() const CV_OVERRIDE;
// get image with labels
virtual void getLabels( OutputArray labels_out ) const;
virtual void getLabels( OutputArray labels_out ) const CV_OVERRIDE;
// get mask image with contour
virtual void getLabelContourMask( OutputArray image, bool thick_line = true ) const;
virtual void getLabelContourMask( OutputArray image, bool thick_line = true ) const CV_OVERRIDE;
// enforce connectivity over labels
virtual void enforceLabelConnectivity( int min_element_size );
virtual void enforceLabelConnectivity( int min_element_size ) CV_OVERRIDE;
protected:
@ -1075,7 +1075,7 @@ struct FeatureSpaceWeights : ParallelLoopBody
sigmaC1 = _sigmaC1; sigmaC2 = _sigmaC2;
}
void operator()( const Range& range ) const
void operator()( const Range& range ) const CV_OVERRIDE
{
for( int x = range.start; x < range.end; x++ )
{
@ -1222,7 +1222,7 @@ struct FeatureSpaceCenters : ParallelLoopBody
centerC1 = _centerC1; centerC2 = _centerC2;
}
void operator()( const Range& range ) const
void operator()( const Range& range ) const CV_OVERRIDE
{
for( int i = range.start; i < range.end; i++ )
{
@ -1364,7 +1364,7 @@ struct FeatureSpaceKmeans : ParallelLoopBody
centerC1 = _centerC1; centerC2 = _centerC2;
}
void operator()( const Range& range ) const
void operator()( const Range& range ) const CV_OVERRIDE
{
for( int i = range.start; i < range.end; i++ )
{
@ -1693,7 +1693,7 @@ struct FeatureNormals : ParallelLoopBody
centerC1 = _centerC1; centerC2 = _centerC2;
}
void operator()( const Range& range ) const
void operator()( const Range& range ) const CV_OVERRIDE
{
for( int i = range.start; i < range.end; i++ )
{

@ -145,7 +145,7 @@ public:
verbose(false)
{}
void Verbose(bool b){verbose=b;}
virtual void operator()(const Range& range) const
virtual void operator()(const Range& range) const CV_OVERRIDE
{
CV_Assert(img.depth()==CV_8UC1 || img.depth()==CV_16SC1 || img.depth()==CV_16UC1);
CV_Assert(dst.depth()==CV_32FC1);
@ -193,7 +193,7 @@ public:
verbose(false)
{}
void Verbose(bool b){verbose=b;}
virtual void operator()(const Range& range) const
virtual void operator()(const Range& range) const CV_OVERRIDE
{
CV_Assert(img.depth()==CV_32FC1);
if (verbose)
@ -263,7 +263,7 @@ public:
verbose(false)
{}
void Verbose(bool b){verbose=b;}
virtual void operator()(const Range& range) const
virtual void operator()(const Range& range) const CV_OVERRIDE
{
CV_Assert(img.depth()==CV_32FC1);
if (verbose)
@ -333,7 +333,7 @@ public:
verbose(false)
{}
void Verbose(bool b){verbose=b;}
virtual void operator()(const Range& range) const
virtual void operator()(const Range& range) const CV_OVERRIDE
{
if (verbose)
std::cout << getThreadNum()<<"# :Start from row " << range.start << " to " << range.end-1<<" ("<<range.end-range.start<<" loops)" << std::endl;

@ -28,7 +28,7 @@ public:
_borderType = borderType;
_out_dtype = out_dtype;
}
virtual void getRidgeFilteredImage(InputArray _img, OutputArray out);
virtual void getRidgeFilteredImage(InputArray _img, OutputArray out) CV_OVERRIDE;
};
void RidgeDetectionFilterImpl::getRidgeFilteredImage(InputArray _img, OutputArray out)

@ -79,13 +79,13 @@ public:
virtual ~SuperpixelSEEDSImpl();
virtual int getNumberOfSuperpixels() { return nrLabels(seeds_top_level); }
virtual int getNumberOfSuperpixels() CV_OVERRIDE { return nrLabels(seeds_top_level); }
virtual void iterate(InputArray img, int num_iterations = 4);
virtual void iterate(InputArray img, int num_iterations = 4) CV_OVERRIDE;
virtual void getLabels(OutputArray labels_out);
virtual void getLabelContourMask(OutputArray image, bool thick_line = false);
virtual void getLabels(OutputArray labels_out) CV_OVERRIDE;
virtual void getLabelContourMask(OutputArray image, bool thick_line = false) CV_OVERRIDE;
private:
/* initialization */

@ -113,16 +113,16 @@ namespace cv {
* Stragegy / Color
***************************************/
class SelectiveSearchSegmentationStrategyColorImpl : public SelectiveSearchSegmentationStrategyColor {
class SelectiveSearchSegmentationStrategyColorImpl CV_FINAL : public SelectiveSearchSegmentationStrategyColor {
public:
SelectiveSearchSegmentationStrategyColorImpl() {
name_ = "SelectiveSearchSegmentationStrategyColor";
last_image_id = -1;
}
virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1);
virtual float get(int r1, int r2);
virtual void merge(int r1, int r2);
virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1) CV_OVERRIDE;
virtual float get(int r1, int r2) CV_OVERRIDE;
virtual void merge(int r1, int r2) CV_OVERRIDE;
private:
String name_;
@ -242,19 +242,19 @@ namespace cv {
* Stragegy / Multiple
***************************************/
class SelectiveSearchSegmentationStrategyMultipleImpl : public SelectiveSearchSegmentationStrategyMultiple {
class SelectiveSearchSegmentationStrategyMultipleImpl CV_FINAL : public SelectiveSearchSegmentationStrategyMultiple {
public:
SelectiveSearchSegmentationStrategyMultipleImpl() {
name_ = "SelectiveSearchSegmentationStrategyMultiple";
weights_total = 0;
}
virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1);
virtual float get(int r1, int r2);
virtual void merge(int r1, int r2);
virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1) CV_OVERRIDE;
virtual float get(int r1, int r2) CV_OVERRIDE;
virtual void merge(int r1, int r2) CV_OVERRIDE;
virtual void addStrategy(Ptr<SelectiveSearchSegmentationStrategy> g, float weight);
virtual void clearStrategies();
virtual void addStrategy(Ptr<SelectiveSearchSegmentationStrategy> g, float weight) CV_OVERRIDE;
virtual void clearStrategies() CV_OVERRIDE;
private:
String name_;
@ -346,15 +346,15 @@ namespace cv {
* Stragegy / Size
***************************************/
class SelectiveSearchSegmentationStrategySizeImpl : public SelectiveSearchSegmentationStrategySize {
class SelectiveSearchSegmentationStrategySizeImpl CV_FINAL : public SelectiveSearchSegmentationStrategySize {
public:
SelectiveSearchSegmentationStrategySizeImpl() {
name_ = "SelectiveSearchSegmentationStrategySize";
}
virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1);
virtual float get(int r1, int r2);
virtual void merge(int r1, int r2);
virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1) CV_OVERRIDE;
virtual float get(int r1, int r2) CV_OVERRIDE;
virtual void merge(int r1, int r2) CV_OVERRIDE;
private:
String name_;
@ -393,15 +393,15 @@ namespace cv {
* Stragegy / Fill
***************************************/
class SelectiveSearchSegmentationStrategyFillImpl : public SelectiveSearchSegmentationStrategyFill {
class SelectiveSearchSegmentationStrategyFillImpl CV_FINAL : public SelectiveSearchSegmentationStrategyFill {
public:
SelectiveSearchSegmentationStrategyFillImpl() {
name_ = "SelectiveSearchSegmentationStrategyFill";
}
virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1);
virtual float get(int r1, int r2);
virtual void merge(int r1, int r2);
virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1) CV_OVERRIDE;
virtual float get(int r1, int r2) CV_OVERRIDE;
virtual void merge(int r1, int r2) CV_OVERRIDE;
private:
String name_;
@ -471,16 +471,16 @@ namespace cv {
* Stragegy / Texture
***************************************/
class SelectiveSearchSegmentationStrategyTextureImpl : public SelectiveSearchSegmentationStrategyTexture {
class SelectiveSearchSegmentationStrategyTextureImpl CV_FINAL : public SelectiveSearchSegmentationStrategyTexture {
public:
SelectiveSearchSegmentationStrategyTextureImpl() {
name_ = "SelectiveSearchSegmentationStrategyTexture";
last_image_id = -1;
}
virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1);
virtual float get(int r1, int r2);
virtual void merge(int r1, int r2);
virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1) CV_OVERRIDE;
virtual float get(int r1, int r2) CV_OVERRIDE;
virtual void merge(int r1, int r2) CV_OVERRIDE;
private:
String name_;
@ -678,39 +678,39 @@ namespace cv {
// Core
class SelectiveSearchSegmentationImpl : public SelectiveSearchSegmentation {
class SelectiveSearchSegmentationImpl CV_FINAL : public SelectiveSearchSegmentation {
public:
SelectiveSearchSegmentationImpl() {
name_ = "SelectiveSearchSegmentation";
}
~SelectiveSearchSegmentationImpl() {
~SelectiveSearchSegmentationImpl() CV_OVERRIDE {
};
virtual void write(FileStorage& fs) const {
virtual void write(FileStorage& fs) const CV_OVERRIDE {
fs << "name" << name_;
}
virtual void read(const FileNode& fn) {
virtual void read(const FileNode& fn) CV_OVERRIDE {
CV_Assert( (String)fn["name"] == name_);
}
virtual void setBaseImage(InputArray img);
virtual void setBaseImage(InputArray img) CV_OVERRIDE;
virtual void switchToSingleStrategy(int k = 200, float sigma = 0.8);
virtual void switchToSelectiveSearchFast(int base_k = 150, int inc_k = 150, float sigma = 0.8);
virtual void switchToSelectiveSearchQuality(int base_k = 150, int inc_k = 150, float sigma = 0.8);
virtual void switchToSingleStrategy(int k = 200, float sigma = 0.8) CV_OVERRIDE;
virtual void switchToSelectiveSearchFast(int base_k = 150, int inc_k = 150, float sigma = 0.8) CV_OVERRIDE;
virtual void switchToSelectiveSearchQuality(int base_k = 150, int inc_k = 150, float sigma = 0.8) CV_OVERRIDE;
virtual void addImage(InputArray img);
virtual void clearImages();
virtual void addImage(InputArray img) CV_OVERRIDE;
virtual void clearImages() CV_OVERRIDE;
virtual void addGraphSegmentation(Ptr<GraphSegmentation> g);
virtual void clearGraphSegmentations();
virtual void addGraphSegmentation(Ptr<GraphSegmentation> g) CV_OVERRIDE;
virtual void clearGraphSegmentations() CV_OVERRIDE;
virtual void addStrategy(Ptr<SelectiveSearchSegmentationStrategy> s);
virtual void clearStrategies();
virtual void addStrategy(Ptr<SelectiveSearchSegmentationStrategy> s) CV_OVERRIDE;
virtual void clearStrategies() CV_OVERRIDE;
virtual void process(std::vector<Rect>& rects);
virtual void process(std::vector<Rect>& rects) CV_OVERRIDE;
private:

@ -72,22 +72,22 @@ public:
SuperpixelSLICImpl( InputArray image, int algorithm, int region_size, float ruler );
virtual ~SuperpixelSLICImpl();
virtual ~SuperpixelSLICImpl() CV_OVERRIDE;
// perform amount of iteration
virtual void iterate( int num_iterations = 10 );
virtual void iterate( int num_iterations = 10 ) CV_OVERRIDE;
// get amount of superpixels
virtual int getNumberOfSuperpixels() const;
virtual int getNumberOfSuperpixels() const CV_OVERRIDE;
// get image with labels
virtual void getLabels( OutputArray labels_out ) const;
virtual void getLabels( OutputArray labels_out ) const CV_OVERRIDE;
// get mask image with contour
virtual void getLabelContourMask( OutputArray image, bool thick_line = true ) const;
virtual void getLabelContourMask( OutputArray image, bool thick_line = true ) const CV_OVERRIDE;
// enforce connectivity over labels
virtual void enforceLabelConnectivity( int min_element_size = 25 );
virtual void enforceLabelConnectivity( int min_element_size = 25 ) CV_OVERRIDE;
protected:
@ -840,7 +840,7 @@ struct SeedNormInvoker : ParallelLoopBody
clustersize = _clustersize;
}
void operator ()(const cv::Range& range) const
void operator ()(const cv::Range& range) const CV_OVERRIDE
{
for (int k = range.start; k < range.end; ++k)
{
@ -1009,7 +1009,7 @@ struct SLICOGrowInvoker : ParallelLoopBody
nr_channels = _nr_channels;
}
void operator ()(const cv::Range& range) const
void operator ()(const cv::Range& range) const CV_OVERRIDE
{
int cols = klabels->cols;
int rows = klabels->rows;
@ -1221,7 +1221,7 @@ struct SLICGrowInvoker : ParallelLoopBody
nr_channels = _nr_channels;
}
void operator ()(const cv::Range& range) const
void operator ()(const cv::Range& range) const CV_OVERRIDE
{
for (int y = range.start; y < range.end; ++y)
{

@ -69,11 +69,11 @@ struct node
node(short l,float d): dist(d), label(l) {}
};
class EdgeAwareInterpolatorImpl : public EdgeAwareInterpolator
class EdgeAwareInterpolatorImpl CV_FINAL : public EdgeAwareInterpolator
{
public:
static Ptr<EdgeAwareInterpolatorImpl> create();
void interpolate(InputArray from_image, InputArray from_points, InputArray to_image, InputArray to_points, OutputArray dense_flow);
void interpolate(InputArray from_image, InputArray from_points, InputArray to_image, InputArray to_points, OutputArray dense_flow) CV_OVERRIDE;
protected:
int w,h;
@ -115,7 +115,7 @@ protected:
int stripe_sz;
GetKNNMatches_ParBody(EdgeAwareInterpolatorImpl& _inst, int _num_stripes);
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
struct RansacInterpolation_ParBody : public ParallelLoopBody
@ -130,22 +130,22 @@ protected:
int inc;
RansacInterpolation_ParBody(EdgeAwareInterpolatorImpl& _inst, Mat* _transforms, float* _weighted_inlier_nums, float* _eps, SparseMatch* _matches, int _num_stripes, int _inc);
void operator () (const Range& range) const;
void operator () (const Range& range) const CV_OVERRIDE;
};
public:
void setK(int _k) {k=_k;}
int getK() {return k;}
void setSigma(float _sigma) {sigma=_sigma;}
float getSigma() {return sigma;}
void setLambda(float _lambda) {lambda=_lambda;}
float getLambda() {return lambda;}
void setUsePostProcessing(bool _use_post_proc) {use_post_proc=_use_post_proc;}
bool getUsePostProcessing() {return use_post_proc;}
void setFGSLambda(float _lambda) {fgs_lambda=_lambda;}
float getFGSLambda() {return fgs_lambda;}
void setFGSSigma(float _sigma) {fgs_sigma = _sigma;}
float getFGSSigma() {return fgs_sigma;}
void setK(int _k) CV_OVERRIDE {k=_k;}
int getK() CV_OVERRIDE {return k;}
void setSigma(float _sigma) CV_OVERRIDE {sigma=_sigma;}
float getSigma() CV_OVERRIDE {return sigma;}
void setLambda(float _lambda) CV_OVERRIDE {lambda=_lambda;}
float getLambda() CV_OVERRIDE {return lambda;}
void setUsePostProcessing(bool _use_post_proc) CV_OVERRIDE {use_post_proc=_use_post_proc;}
bool getUsePostProcessing() CV_OVERRIDE {return use_post_proc;}
void setFGSLambda(float _lambda) CV_OVERRIDE {fgs_lambda=_lambda;}
float getFGSLambda() CV_OVERRIDE {return fgs_lambda;}
void setFGSSigma(float _sigma) CV_OVERRIDE {fgs_sigma = _sigma;}
float getFGSSigma() CV_OVERRIDE {return fgs_sigma;}
};
void EdgeAwareInterpolatorImpl::init()

@ -281,7 +281,7 @@ public:
{
}
void operator()(const cv::Range &range) const
void operator()(const cv::Range &range) const CV_OVERRIDE
{
for (int x = range.start; x < range.end; x++)
{
@ -359,7 +359,7 @@ public:
* \param gradNum : __rf.options.numberOfGradientOrientations
*/
virtual void getFeatures(const Mat &src, Mat &features, const int gnrmRad, const int gsmthRad,
const int shrink, const int outNum, const int gradNum) const
const int shrink, const int outNum, const int gradNum) const CV_OVERRIDE
{
cv::Mat luvImg = rgb2luv(src);
@ -524,7 +524,7 @@ public:
* \param _dst : destination image (grayscale, float, in [0;1])
* where edges are drawn
*/
void detectEdges(cv::InputArray _src, cv::OutputArray _dst) const
void detectEdges(cv::InputArray _src, cv::OutputArray _dst) const CV_OVERRIDE
{
CV_Assert( _src.type() == CV_32FC3 );
@ -556,7 +556,7 @@ public:
* \param dst : orientation image.
* \param r : filter radius.
*/
void computeOrientation(cv::InputArray _src, cv::OutputArray _dst) const
void computeOrientation(cv::InputArray _src, cv::OutputArray _dst) const CV_OVERRIDE
{
CV_Assert( _src.type() == CV_32FC1 );
@ -596,7 +596,7 @@ public:
* \param m : multiplier for conservative suppression.
* \param isParallel: enables/disables parallel computing.
*/
void edgesNms(cv::InputArray edge_image, cv::InputArray orientation_image, cv::OutputArray _dst, int r, int s, float m, bool isParallel) const
void edgesNms(cv::InputArray edge_image, cv::InputArray orientation_image, cv::OutputArray _dst, int r, int s, float m, bool isParallel) const CV_OVERRIDE
{
CV_Assert(edge_image.type() == CV_32FC1);
CV_Assert(orientation_image.type() == CV_32FC1);

@ -4,19 +4,19 @@
/*
* The MIT License(MIT)
*
*
* Copyright(c) 2013 Vladislav Vinogradov
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files(the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions :
*
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR
@ -149,12 +149,18 @@ using namespace cv::ximgproc;
void collectGarbage();
CV_IMPL_PROPERTY(double, SigmaS, sigma_s_)
CV_IMPL_PROPERTY(double, SigmaR, sigma_r_)
CV_IMPL_PROPERTY(int, TreeHeight, tree_height_)
CV_IMPL_PROPERTY(int, PCAIterations, num_pca_iterations_)
CV_IMPL_PROPERTY(bool, AdjustOutliers, adjust_outliers_)
CV_IMPL_PROPERTY(bool, UseRNG, useRNG)
inline double getSigmaS() const CV_OVERRIDE { return sigma_s_; }
inline void setSigmaS(double val) CV_OVERRIDE { sigma_s_ = val; }
inline double getSigmaR() const CV_OVERRIDE { return sigma_r_; }
inline void setSigmaR(double val) CV_OVERRIDE { sigma_r_ = val; }
inline int getTreeHeight() const CV_OVERRIDE { return tree_height_; }
inline void setTreeHeight(int val) CV_OVERRIDE { tree_height_ = val; }
inline int getPCAIterations() const CV_OVERRIDE { return num_pca_iterations_; }
inline void setPCAIterations(int val) CV_OVERRIDE { num_pca_iterations_ = val; }
inline bool getAdjustOutliers() const CV_OVERRIDE { return adjust_outliers_; }
inline void setAdjustOutliers(bool val) CV_OVERRIDE { adjust_outliers_ = val; }
inline bool getUseRNG() const CV_OVERRIDE { return useRNG; }
inline void setUseRNG(bool val) CV_OVERRIDE { useRNG = val; }
protected:
bool adjust_outliers_;
@ -930,7 +936,7 @@ using namespace cv::ximgproc;
Ptr<AdaptiveManifoldFilter> createAMFilterRefImpl(double sigma_s, double sigma_r, bool adjust_outliers)
{
Ptr<AdaptiveManifoldFilter> amf(new AdaptiveManifoldFilterRefImpl());
amf->setSigmaS(sigma_s);
amf->setSigmaR(sigma_r);
amf->setAdjustOutliers(adjust_outliers);

Loading…
Cancel
Save