Commit 64d58861 authored by Alexander Alekhin's avatar Alexander Alekhin

ximgproc: apply CV_OVERRIDE/CV_FINAL

parent ec65e5b2
...@@ -2,26 +2,26 @@ ...@@ -2,26 +2,26 @@
* By downloading, copying, installing or using the software you agree to this license. * 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, * If you do not agree to this license, do not download, install,
* copy or use the software. * copy or use the software.
* *
* *
* License Agreement * License Agreement
* For Open Source Computer Vision Library * For Open Source Computer Vision Library
* (3 - clause BSD License) * (3 - clause BSD License)
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met : * are permitted provided that the following conditions are met :
* *
* * Redistributions of source code must retain the above copyright notice, * * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* * Redistributions in binary form must reproduce the above copyright notice, * * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and / or other materials provided with the distribution. * and / or other materials provided with the distribution.
* *
* * Neither the names of the copyright holders nor the names of the contributors * * 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 * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* This software is provided by the copyright holders and contributors "as is" and * 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 * any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed. * warranties of merchantability and fitness for a particular purpose are disclaimed.
...@@ -109,16 +109,22 @@ class AdaptiveManifoldFilterN : public AdaptiveManifoldFilter ...@@ -109,16 +109,22 @@ class AdaptiveManifoldFilterN : public AdaptiveManifoldFilter
public: public:
AdaptiveManifoldFilterN(); 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_) inline double getSigmaS() const CV_OVERRIDE { return sigma_s_; }
CV_IMPL_PROPERTY(double, SigmaR, sigma_r_) inline void setSigmaS(double val) CV_OVERRIDE { sigma_s_ = val; }
CV_IMPL_PROPERTY(int, TreeHeight, tree_height_) inline double getSigmaR() const CV_OVERRIDE { return sigma_r_; }
CV_IMPL_PROPERTY(int, PCAIterations, num_pca_iterations_) inline void setSigmaR(double val) CV_OVERRIDE { sigma_r_ = val; }
CV_IMPL_PROPERTY(bool, AdjustOutliers, adjust_outliers_) inline int getTreeHeight() const CV_OVERRIDE { return tree_height_; }
CV_IMPL_PROPERTY(bool, UseRNG, useRNG) 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: protected:
...@@ -130,7 +136,7 @@ protected: ...@@ -130,7 +136,7 @@ protected:
bool useRNG; bool useRNG;
private: private:
Size srcSize; Size srcSize;
Size smallSize; Size smallSize;
int jointCnNum; int jointCnNum;
...@@ -142,14 +148,14 @@ private: ...@@ -142,14 +148,14 @@ private:
vector<Mat> etaFull; vector<Mat> etaFull;
vector<Mat> sum_w_ki_Psi_blur_; 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 w_k;
Mat Psi_splat_0_small; Mat Psi_splat_0_small;
vector<Mat> Psi_splat_small; vector<Mat> Psi_splat_small;
Mat1f minDistToManifoldSquared; Mat1f minDistToManifoldSquared;
int curTreeHeight; int curTreeHeight;
float sigma_r_over_sqrt_2; float sigma_r_over_sqrt_2;
...@@ -256,8 +262,8 @@ private: /*Parallelization routines*/ ...@@ -256,8 +262,8 @@ private: /*Parallelization routines*/
MapFunc transform; MapFunc transform;
const vector<Mat>& srcv; const vector<Mat>& srcv;
vector<Mat>& dstv; 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++) for (int i = range.start; i < range.end; i++)
(instancePtr->*transform)(srcv[i], dstv[i]); (instancePtr->*transform)(srcv[i], dstv[i]);
...@@ -299,7 +305,7 @@ void AdaptiveManifoldFilterN::initBuffers(InputArray src_, InputArray joint_) ...@@ -299,7 +305,7 @@ void AdaptiveManifoldFilterN::initBuffers(InputArray src_, InputArray joint_)
sum_w_ki_Psi_blur_0_ = Mat::zeros(srcSize, CV_32FC1); sum_w_ki_Psi_blur_0_ = Mat::zeros(srcSize, CV_32FC1);
w_k.create(srcSize, CV_32FC1); w_k.create(srcSize, CV_32FC1);
Psi_splat_0_small.create(smallSize, CV_32FC1); Psi_splat_0_small.create(smallSize, CV_32FC1);
if (adjust_outliers_) if (adjust_outliers_)
minDistToManifoldSquared.create(srcSize); minDistToManifoldSquared.create(srcSize);
} }
...@@ -335,7 +341,7 @@ void AdaptiveManifoldFilterN::initSrcAndJoint(InputArray src_, InputArray joint_ ...@@ -335,7 +341,7 @@ void AdaptiveManifoldFilterN::initSrcAndJoint(InputArray src_, InputArray joint_
else else
{ {
splitChannels(joint_, jointCn); splitChannels(joint_, jointCn);
jointCnNum = (int)jointCn.size(); jointCnNum = (int)jointCn.size();
int jointDepth = jointCn[0].depth(); int jointDepth = jointCn[0].depth();
Size jointSize = jointCn[0].size(); Size jointSize = jointCn[0].size();
...@@ -364,7 +370,7 @@ void AdaptiveManifoldFilterN::filter(InputArray src, OutputArray dst, InputArray ...@@ -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 double seedCoef = jointCn[0].at<float>(srcSize.height/2, srcSize.width/2);
const uint64 baseCoef = numeric_limits<uint64>::max() / 0xFFFF; const uint64 baseCoef = numeric_limits<uint64>::max() / 0xFFFF;
rnd.state = static_cast<int64>(baseCoef*seedCoef); rnd.state = static_cast<int64>(baseCoef*seedCoef);
Mat1b cluster0(srcSize, 0xFF); Mat1b cluster0(srcSize, 0xFF);
vector<Mat> eta0(jointCnNum); vector<Mat> eta0(jointCnNum);
for (int i = 0; i < jointCnNum; i++) for (int i = 0; i < jointCnNum; i++)
...@@ -431,7 +437,7 @@ void AdaptiveManifoldFilterN::buildManifoldsAndPerformFiltering(vector<Mat>& eta ...@@ -431,7 +437,7 @@ void AdaptiveManifoldFilterN::buildManifoldsAndPerformFiltering(vector<Mat>& eta
upsample(eta, etaFull); upsample(eta, etaFull);
compute_w_k(etaFull, w_k, sigma_r_over_sqrt_2, treeLevel); compute_w_k(etaFull, w_k, sigma_r_over_sqrt_2, treeLevel);
} }
//blurring //blurring
Psi_splat_small.resize(srcCnNum); Psi_splat_small.resize(srcCnNum);
for (int si = 0; si < srcCnNum; si++) for (int si = 0; si < srcCnNum; si++)
...@@ -611,13 +617,13 @@ void AdaptiveManifoldFilterN::computeDTHor(vector<Mat>& srcCn, Mat& dst, float s ...@@ -611,13 +617,13 @@ void AdaptiveManifoldFilterN::computeDTHor(vector<Mat>& srcCn, Mat& dst, float s
else else
add_sqr_dif(dstRow, curCnRow, curCnRow + 1, w - 1); add_sqr_dif(dstRow, curCnRow, curCnRow + 1, w - 1);
} }
mad(dstRow, dstRow, sigmaRatioSqr, 1.0f, w - 1); mad(dstRow, dstRow, sigmaRatioSqr, 1.0f, w - 1);
sqrt_(dstRow, dstRow, w - 1); sqrt_(dstRow, dstRow, w - 1);
mul(dstRow, dstRow, lnAlpha, w - 1); mul(dstRow, dstRow, lnAlpha, w - 1);
//Exp_32f(dstRow, dstRow, w - 1); //Exp_32f(dstRow, dstRow, w - 1);
} }
cv::exp(dst, dst); cv::exp(dst, dst);
} }
...@@ -680,7 +686,7 @@ void AdaptiveManifoldFilterN::RFFilterPass(vector<Mat>& joint, vector<Mat>& Psi_ ...@@ -680,7 +686,7 @@ void AdaptiveManifoldFilterN::RFFilterPass(vector<Mat>& joint, vector<Mat>& Psi_
void AdaptiveManifoldFilterN::computeClusters(Mat1b& cluster, Mat1b& cluster_minus, Mat1b& cluster_plus) void AdaptiveManifoldFilterN::computeClusters(Mat1b& cluster, Mat1b& cluster_minus, Mat1b& cluster_plus)
{ {
Mat1f difOreientation; Mat1f difOreientation;
if (jointCnNum > 1) if (jointCnNum > 1)
{ {
...@@ -723,7 +729,7 @@ void AdaptiveManifoldFilterN::computeEta(Mat& teta, Mat1b& cluster, vector<Mat>& ...@@ -723,7 +729,7 @@ void AdaptiveManifoldFilterN::computeEta(Mat& teta, Mat1b& cluster, vector<Mat>&
Mat1f tetaMasked = Mat1f::zeros(srcSize); Mat1f tetaMasked = Mat1f::zeros(srcSize);
teta.copyTo(tetaMasked, cluster); teta.copyTo(tetaMasked, cluster);
float sigma_s = (float)(sigma_s_ / getResizeRatio()); float sigma_s = (float)(sigma_s_ / getResizeRatio());
Mat1f tetaMaskedBlur; Mat1f tetaMaskedBlur;
...@@ -750,7 +756,7 @@ void AdaptiveManifoldFilterN::computeEigenVector(const vector<Mat>& X, const Mat ...@@ -750,7 +756,7 @@ void AdaptiveManifoldFilterN::computeEigenVector(const vector<Mat>& X, const Mat
vecDst.create(1, cnNum); vecDst.create(1, cnNum);
CV_Assert(vecRand.size() == Size(cnNum, 1) && vecDst.size() == Size(cnNum, 1)); CV_Assert(vecRand.size() == Size(cnNum, 1) && vecDst.size() == Size(cnNum, 1));
CV_Assert(mask.rows == height && mask.cols == width); CV_Assert(mask.rows == height && mask.cols == width);
const float *pVecRand = vecRand.ptr<float>(); const float *pVecRand = vecRand.ptr<float>();
Mat1d vecDstd(1, cnNum, 0.0); Mat1d vecDstd(1, cnNum, 0.0);
double *pVecDst = vecDstd.ptr<double>(); double *pVecDst = vecDstd.ptr<double>();
...@@ -763,7 +769,7 @@ void AdaptiveManifoldFilterN::computeEigenVector(const vector<Mat>& X, const Mat ...@@ -763,7 +769,7 @@ void AdaptiveManifoldFilterN::computeEigenVector(const vector<Mat>& X, const Mat
const uchar *maskRow = mask.ptr<uchar>(i); const uchar *maskRow = mask.ptr<uchar>(i);
float *mulRow = Xw.ptr<float>(i); float *mulRow = Xw.ptr<float>(i);
//first multiplication //first multiplication
for (int cn = 0; cn < cnNum; cn++) for (int cn = 0; cn < cnNum; cn++)
{ {
const float *srcRow = X[cn].ptr<float>(i); const float *srcRow = X[cn].ptr<float>(i);
...@@ -793,7 +799,7 @@ void AdaptiveManifoldFilterN::computeEigenVector(const vector<Mat>& X, const Mat ...@@ -793,7 +799,7 @@ void AdaptiveManifoldFilterN::computeEigenVector(const vector<Mat>& X, const Mat
for (int j = 0; j < width; j++) for (int j = 0; j < width; j++)
curCnSum += mulRow[j]*srcRow[j]; curCnSum += mulRow[j]*srcRow[j];
//TODO: parallel reduce //TODO: parallel reduce
pVecDst[cn] += curCnSum; pVecDst[cn] += curCnSum;
} }
} }
...@@ -852,7 +858,7 @@ Ptr<AdaptiveManifoldFilter> AdaptiveManifoldFilter::create() ...@@ -852,7 +858,7 @@ Ptr<AdaptiveManifoldFilter> AdaptiveManifoldFilter::create()
Ptr<AdaptiveManifoldFilter> createAMFilter(double sigma_s, double sigma_r, bool adjust_outliers) Ptr<AdaptiveManifoldFilter> createAMFilter(double sigma_s, double sigma_r, bool adjust_outliers)
{ {
Ptr<AdaptiveManifoldFilter> amf(new AdaptiveManifoldFilterN()); Ptr<AdaptiveManifoldFilter> amf(new AdaptiveManifoldFilterN());
amf->setSigmaS(sigma_s); amf->setSigmaS(sigma_s);
amf->setSigmaR(sigma_r); amf->setSigmaR(sigma_r);
amf->setAdjustOutliers(adjust_outliers); amf->setAdjustOutliers(adjust_outliers);
......
...@@ -92,7 +92,7 @@ public: ...@@ -92,7 +92,7 @@ public:
alpha_ = alpha; alpha_ = alpha;
} }
void operator()(const Range& range) const void operator()(const Range& range) const CV_OVERRIDE
{ {
const int cn = 3; const int cn = 3;
int cols = src->cols; int cols = src->cols;
......
...@@ -162,7 +162,7 @@ public: ...@@ -162,7 +162,7 @@ public:
verbose(false) verbose(false)
{} {}
void Verbose(bool b) { verbose = b; } 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(img.depth()==CV_8UC1 || img.depth()==CV_8SC1 || img.depth()==CV_16SC1 || img.depth()==CV_16UC1);
CV_Assert(dst.depth()==CV_32FC1); CV_Assert(dst.depth()==CV_32FC1);
...@@ -209,7 +209,7 @@ public: ...@@ -209,7 +209,7 @@ public:
verbose(false) verbose(false)
{} {}
void Verbose(bool b) { verbose = b; } 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(img.depth()==CV_32FC1);
CV_Assert(dst.depth()==CV_32FC1); CV_Assert(dst.depth()==CV_32FC1);
...@@ -282,7 +282,7 @@ public: ...@@ -282,7 +282,7 @@ public:
verbose(false) verbose(false)
{} {}
void Verbose(bool b) { verbose = b; } 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(img.depth()==CV_32FC1);
CV_Assert(dst.depth()==CV_32FC1); CV_Assert(dst.depth()==CV_32FC1);
...@@ -357,7 +357,7 @@ public: ...@@ -357,7 +357,7 @@ public:
verbose(false) verbose(false)
{} {}
void Verbose(bool b) { verbose = b; } 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(img.depth()==CV_8UC1 || img.depth()==CV_8SC1 || img.depth()==CV_16SC1 || img.depth()==CV_16UC1);
CV_Assert(dst.depth()==CV_32FC1); CV_Assert(dst.depth()==CV_32FC1);
......
...@@ -76,7 +76,7 @@ protected: ...@@ -76,7 +76,7 @@ protected:
int nstripes, stripe_sz; 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); 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 struct ComputeDepthDisc_ParBody : public ParallelLoopBody
...@@ -86,7 +86,7 @@ protected: ...@@ -86,7 +86,7 @@ protected:
int nstripes, stripe_sz; int nstripes, stripe_sz;
ComputeDepthDisc_ParBody(DisparityWLSFilterImpl& _wls, Mat& _disp, Mat& _disp_squares, Mat& _dst, int _nstripes); 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); typedef void (DisparityWLSFilterImpl::*MatOp)(Mat& src, Mat& dst);
...@@ -99,7 +99,7 @@ protected: ...@@ -99,7 +99,7 @@ protected:
vector<Mat*> dst; vector<Mat*> dst;
ParallelMatOp_ParBody(DisparityWLSFilterImpl& _wls, vector<MatOp> _ops, vector<Mat*>& _src, 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) void boxFilterOp(Mat& src,Mat& dst)
...@@ -121,23 +121,23 @@ protected: ...@@ -121,23 +121,23 @@ protected:
public: public:
static Ptr<DisparityWLSFilterImpl> create(bool _use_confidence, int l_offs, int r_offs, int t_offs, int b_offs, int min_disp); 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); void filter_(InputArray disparity_map_left, InputArray left_view, OutputArray filtered_disparity_map, InputArray disparity_map_right, Rect ROI);
double getLambda() {return lambda;} double getLambda() CV_OVERRIDE { return lambda; }
void setLambda(double _lambda) {lambda = _lambda;} void setLambda(double _lambda) CV_OVERRIDE { lambda = _lambda; }
double getSigmaColor() {return sigma_color;} double getSigmaColor() CV_OVERRIDE { return sigma_color; }
void setSigmaColor(double _sigma_color) {sigma_color = _sigma_color;} void setSigmaColor(double _sigma_color) CV_OVERRIDE { sigma_color = _sigma_color; }
int getLRCthresh() {return LRC_thresh;} int getLRCthresh() CV_OVERRIDE { return LRC_thresh; }
void setLRCthresh(int _LRC_thresh) {LRC_thresh = _LRC_thresh;} void setLRCthresh(int _LRC_thresh) CV_OVERRIDE { LRC_thresh = _LRC_thresh; }
int getDepthDiscontinuityRadius() {return depth_discontinuity_radius;} int getDepthDiscontinuityRadius() CV_OVERRIDE { return depth_discontinuity_radius; }
void setDepthDiscontinuityRadius(int _disc_radius) {depth_discontinuity_radius = _disc_radius;} void setDepthDiscontinuityRadius(int _disc_radius) CV_OVERRIDE { depth_discontinuity_radius = _disc_radius; }
Mat getConfidenceMap() {return confidence_map;} Mat getConfidenceMap() CV_OVERRIDE { return confidence_map; }
Rect getROI() {return valid_disp_ROI;} 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) 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 @@ ...@@ -2,26 +2,26 @@
* By downloading, copying, installing or using the software you agree to this license. * 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, * If you do not agree to this license, do not download, install,
* copy or use the software. * copy or use the software.
* *
* *
* License Agreement * License Agreement
* For Open Source Computer Vision Library * For Open Source Computer Vision Library
* (3 - clause BSD License) * (3 - clause BSD License)
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met : * are permitted provided that the following conditions are met :
* *
* * Redistributions of source code must retain the above copyright notice, * * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* * Redistributions in binary form must reproduce the above copyright notice, * * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and / or other materials provided with the distribution. * and / or other materials provided with the distribution.
* *
* * Neither the names of the copyright holders nor the names of the contributors * * 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 * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* This software is provided by the copyright holders and contributors "as is" and * 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 * any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed. * warranties of merchantability and fitness for a particular purpose are disclaimed.
...@@ -59,7 +59,7 @@ public: /*Non-template methods*/ ...@@ -59,7 +59,7 @@ public: /*Non-template methods*/
static Ptr<DTFilterCPU> createRF(InputArray adistHor, InputArray adistVert, double sigmaSpatial, double sigmaColor, int numIters = 3); 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); void setSingleFilterCall(bool value);
...@@ -141,7 +141,7 @@ protected: /*Wrappers for parallelization*/ ...@@ -141,7 +141,7 @@ protected: /*Wrappers for parallelization*/
float radius; float radius;
FilterNC_horPass(Mat& src_, Mat& idist_, Mat& dst_); 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> template <typename WorkVec>
...@@ -151,7 +151,7 @@ protected: /*Wrappers for parallelization*/ ...@@ -151,7 +151,7 @@ protected: /*Wrappers for parallelization*/
float radius; float radius;
FilterIC_horPass(Mat& src_, Mat& idist_, Mat& dist_, Mat& dst_); 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> template <typename WorkVec>
...@@ -161,7 +161,7 @@ protected: /*Wrappers for parallelization*/ ...@@ -161,7 +161,7 @@ protected: /*Wrappers for parallelization*/
int iteration; int iteration;
FilterRF_horPass(Mat& res_, Mat& alphaD_, 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); } Range getRange() const { return Range(0, res.rows); }
}; };
...@@ -172,7 +172,7 @@ protected: /*Wrappers for parallelization*/ ...@@ -172,7 +172,7 @@ protected: /*Wrappers for parallelization*/
int iteration; int iteration;
FilterRF_vertPass(Mat& res_, Mat& alphaD_, 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 #ifdef CV_GET_NUM_THREAD_WORKS_PROPERLY
Range getRange() const { return Range(0, cv::getNumThreads()); } Range getRange() const { return Range(0, cv::getNumThreads()); }
#else #else
...@@ -187,7 +187,7 @@ protected: /*Wrappers for parallelization*/ ...@@ -187,7 +187,7 @@ protected: /*Wrappers for parallelization*/
Mat &guide, &dst; Mat &guide, &dst;
ComputeIDTHor_ParBody(DTFilterCPU& dtf_, Mat& guide_, Mat& 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); } Range getRange() { return Range(0, guide.rows); }
}; };
...@@ -199,7 +199,7 @@ protected: /*Wrappers for parallelization*/ ...@@ -199,7 +199,7 @@ protected: /*Wrappers for parallelization*/
IDistType maxRadius; IDistType maxRadius;
ComputeDTandIDTHor_ParBody(DTFilterCPU& dtf_, Mat& guide_, Mat& dist_, Mat& idist_); 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); } Range getRange() { return Range(0, guide.rows); }
}; };
...@@ -211,7 +211,7 @@ protected: /*Wrappers for parallelization*/ ...@@ -211,7 +211,7 @@ protected: /*Wrappers for parallelization*/
float lna; float lna;
ComputeA0DTHor_ParBody(DTFilterCPU& dtf_, Mat& guide_); 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); } Range getRange() { return Range(0, guide.rows); }
~ComputeA0DTHor_ParBody(); ~ComputeA0DTHor_ParBody();
}; };
...@@ -224,7 +224,7 @@ protected: /*Wrappers for parallelization*/ ...@@ -224,7 +224,7 @@ protected: /*Wrappers for parallelization*/
float lna; float lna;
ComputeA0DTVert_ParBody(DTFilterCPU& dtf_, Mat& guide_); 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); } Range getRange() const { return Range(0, guide.rows - 1); }
~ComputeA0DTVert_ParBody(); ~ComputeA0DTVert_ParBody();
}; };
...@@ -291,4 +291,4 @@ void domainTransformFilter( const Mat& guide, ...@@ -291,4 +291,4 @@ void domainTransformFilter( const Mat& guide,
#include "dtfilter_cpu.inl.hpp" #include "dtfilter_cpu.inl.hpp"
#endif #endif
\ No newline at end of file
...@@ -2,26 +2,26 @@ ...@@ -2,26 +2,26 @@
* By downloading, copying, installing or using the software you agree to this license. * 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, * If you do not agree to this license, do not download, install,
* copy or use the software. * copy or use the software.
* *
* *
* License Agreement * License Agreement
* For Open Source Computer Vision Library * For Open Source Computer Vision Library
* (3 - clause BSD License) * (3 - clause BSD License)
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met : * are permitted provided that the following conditions are met :
* *
* * Redistributions of source code must retain the above copyright notice, * * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* * Redistributions in binary form must reproduce the above copyright notice, * * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and / or other materials provided with the distribution. * and / or other materials provided with the distribution.
* *
* * Neither the names of the copyright holders nor the names of the contributors * * 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 * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* This software is provided by the copyright holders and contributors "as is" and * 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 * any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed. * 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) ...@@ -137,7 +137,7 @@ void DTFilterCPU::filter_(const Mat& src, Mat& dst, int dDepth)
Mat res; Mat res;
if (dDepth == -1) dDepth = src.depth(); if (dDepth == -1) dDepth = src.depth();
//small optimization to avoid extra copying of data //small optimization to avoid extra copying of data
bool useDstAsRes = (dDepth == traits::Depth<WorkVec>::value && (mode == DTF_NC || mode == DTF_RF)); bool useDstAsRes = (dDepth == traits::Depth<WorkVec>::value && (mode == DTF_NC || mode == DTF_RF));
if (useDstAsRes) if (useDstAsRes)
...@@ -193,7 +193,7 @@ void DTFilterCPU::filter_(const Mat& src, Mat& dst, int dDepth) ...@@ -193,7 +193,7 @@ void DTFilterCPU::filter_(const Mat& src, Mat& dst, int dDepth)
bool useA0DT = (singleFilterCall || iter == 1); bool useA0DT = (singleFilterCall || iter == 1);
Mat& a0dHor = (useA0DT) ? a0distHor : adistHor; Mat& a0dHor = (useA0DT) ? a0distHor : adistHor;
Mat& a0dVert = (useA0DT) ? a0distVert : adistVert; Mat& a0dVert = (useA0DT) ? a0distVert : adistVert;
FilterRF_horPass<WorkVec> horParBody(res, a0dHor, iter); FilterRF_horPass<WorkVec> horParBody(res, a0dHor, iter);
FilterRF_vertPass<WorkVec> vertParBody(res, a0dVert, iter); FilterRF_vertPass<WorkVec> vertParBody(res, a0dVert, iter);
parallel_for_(horParBody.getRange(), horParBody); parallel_for_(horParBody.getRange(), horParBody);
...@@ -261,7 +261,7 @@ void DTFilterCPU::prepareSrcImg_IC(const Mat& src, Mat& dst, Mat& dstT) ...@@ -261,7 +261,7 @@ void DTFilterCPU::prepareSrcImg_IC(const Mat& src, Mat& dst, Mat& dstT)
{ {
line = dstOutT.ptr<WorkVec>(i); line = dstOutT.ptr<WorkVec>(i);
line[0] = topLine[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& ...@@ -514,7 +514,7 @@ void DTFilterCPU::ComputeDTandIDTHor_ParBody<GuideVec>::operator()(const Range&
DistType curDist; DistType curDist;
IDistType curIDist = (IDistType)0; IDistType curIDist = (IDistType)0;
int j; int j;
distLine[-1] = maxRadius; distLine[-1] = maxRadius;
//idistLine[-1] = curIDist - maxRadius; //idistLine[-1] = curIDist - maxRadius;
idistLine[0] = curIDist; idistLine[0] = curIDist;
...@@ -621,4 +621,4 @@ void domainTransformFilter( const Mat& guide, ...@@ -621,4 +621,4 @@ void domainTransformFilter( const Mat& guide,
} }
} }
#endif #endif
\ No newline at end of file
...@@ -79,10 +79,10 @@ public: ...@@ -79,10 +79,10 @@ public:
float gamma, float gamma,
float kappa); 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; } float getAlpha() const CV_OVERRIDE { return _alpha; }
void setAlpha(float value) void setAlpha(float value) CV_OVERRIDE
{ {
_alpha = value; _alpha = value;
_sxStep = sqrt(1 / _alpha); _sxStep = sqrt(1 / _alpha);
...@@ -90,38 +90,38 @@ public: ...@@ -90,38 +90,38 @@ public:
_xyStepRatio = (1 - _alpha) / (1 + _alpha); _xyStepRatio = (1 - _alpha) / (1 + _alpha);
} }
float getBeta() const { return _beta; } float getBeta() const CV_OVERRIDE { return _beta; }
void setBeta(float value) { _beta = value; } void setBeta(float value) CV_OVERRIDE { _beta = value; }
float getEta() const { return _eta; } float getEta() const CV_OVERRIDE { return _eta; }
void setEta(float value) { _eta = value; } void setEta(float value) CV_OVERRIDE { _eta = value; }
float getMinScore() const { return _minScore; } float getMinScore() const CV_OVERRIDE { return _minScore; }
void setMinScore(float value) { _minScore = value; } void setMinScore(float value) CV_OVERRIDE { _minScore = value; }
int getMaxBoxes() const { return _maxBoxes; } int getMaxBoxes() const CV_OVERRIDE { return _maxBoxes; }
void setMaxBoxes(int value) { _maxBoxes = value; } void setMaxBoxes(int value) CV_OVERRIDE { _maxBoxes = value; }
float getEdgeMinMag() const { return _edgeMinMag; } float getEdgeMinMag() const CV_OVERRIDE { return _edgeMinMag; }
void setEdgeMinMag(float value) { _edgeMinMag = value; } void setEdgeMinMag(float value) CV_OVERRIDE { _edgeMinMag = value; }
float getEdgeMergeThr() const { return _edgeMergeThr; } float getEdgeMergeThr() const CV_OVERRIDE { return _edgeMergeThr; }
void setEdgeMergeThr(float value) { _edgeMergeThr = value; } void setEdgeMergeThr(float value) CV_OVERRIDE { _edgeMergeThr = value; }
float getClusterMinMag() const { return _clusterMinMag; } float getClusterMinMag() const CV_OVERRIDE { return _clusterMinMag; }
void setClusterMinMag(float value) { _clusterMinMag = value; } void setClusterMinMag(float value) CV_OVERRIDE { _clusterMinMag = value; }
float getMaxAspectRatio() const { return _maxAspectRatio; } float getMaxAspectRatio() const CV_OVERRIDE { return _maxAspectRatio; }
void setMaxAspectRatio(float value) { _maxAspectRatio = value; } void setMaxAspectRatio(float value) CV_OVERRIDE { _maxAspectRatio = value; }
float getMinBoxArea() const { return _minBoxArea; } float getMinBoxArea() const CV_OVERRIDE { return _minBoxArea; }
void setMinBoxArea(float value) { _minBoxArea = value; } void setMinBoxArea(float value) CV_OVERRIDE { _minBoxArea = value; }
float getGamma() const { return _gamma; } float getGamma() const CV_OVERRIDE { return _gamma; }
void setGamma(float value) { _gamma = value; } void setGamma(float value) CV_OVERRIDE { _gamma = value; }
float getKappa() const { return _kappa; } float getKappa() const CV_OVERRIDE { return _kappa; }
void setKappa(float value) void setKappa(float value) CV_OVERRIDE
{ {
_kappa = value; _kappa = value;
_scaleNorm.resize(10000); _scaleNorm.resize(10000);
......
...@@ -49,7 +49,7 @@ class FastLineDetectorImpl : public FastLineDetector ...@@ -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. * 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. * 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. * Draw lines on the given canvas.
...@@ -59,7 +59,7 @@ class FastLineDetectorImpl : public FastLineDetector ...@@ -59,7 +59,7 @@ class FastLineDetectorImpl : public FastLineDetector
* @param lines The lines that need to be drawn * @param lines The lines that need to be drawn
* @param draw_arrow If true, arrow heads will 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: private:
int imagewidth, imageheight, threshold_length; int imagewidth, imageheight, threshold_length;
......
...@@ -62,7 +62,7 @@ class FastGlobalSmootherFilterImpl : public FastGlobalSmootherFilter ...@@ -62,7 +62,7 @@ class FastGlobalSmootherFilterImpl : public FastGlobalSmootherFilter
{ {
public: public:
static Ptr<FastGlobalSmootherFilterImpl> create(InputArray guide, double lambda, double sigma_color, int num_iter,double lambda_attenuation); 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: protected:
int w,h; int w,h;
...@@ -85,7 +85,7 @@ protected: ...@@ -85,7 +85,7 @@ protected:
int h; int h;
HorizontalPass_ParBody(FastGlobalSmootherFilterImpl &_fgs, Mat& _cur, int _nstripes, 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_4row_block(Mat* cur,int i);
inline void process_row(Mat* cur,int i); inline void process_row(Mat* cur,int i);
...@@ -98,7 +98,7 @@ protected: ...@@ -98,7 +98,7 @@ protected:
int w; int w;
VerticalPass_ParBody(FastGlobalSmootherFilterImpl &_fgs, Mat& _cur, int _nstripes, 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> template<get_weight_op get_weight, const int num_ch>
...@@ -110,7 +110,7 @@ protected: ...@@ -110,7 +110,7 @@ protected:
int h; int h;
ComputeHorizontalWeights_ParBody(FastGlobalSmootherFilterImpl &_fgs, Mat& _guide, int _nstripes, 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> template<get_weight_op get_weight, const int num_ch>
...@@ -122,7 +122,7 @@ protected: ...@@ -122,7 +122,7 @@ protected:
int w; int w;
ComputeVerticalWeights_ParBody(FastGlobalSmootherFilterImpl &_fgs, Mat& _guide, int _nstripes, 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 struct ComputeLUT_ParBody : public ParallelLoopBody
...@@ -133,7 +133,7 @@ protected: ...@@ -133,7 +133,7 @@ protected:
int sz; int sz;
ComputeLUT_ParBody(FastGlobalSmootherFilterImpl &_fgs, WorkType* _LUT, int _nstripes, 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 { ...@@ -106,28 +106,28 @@ namespace cv {
name_ = "GraphSegmentation"; 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 void setSigma(double sigma_) CV_OVERRIDE { if (sigma_ <= 0) { sigma_ = 0.001; } sigma = sigma_; }
virtual double getSigma() { return sigma; } virtual double getSigma() CV_OVERRIDE { return sigma; }
virtual void setK(float k_) { k = k_; } virtual void setK(float k_) CV_OVERRIDE { k = k_; }
virtual float getK() { return k; } virtual float getK() CV_OVERRIDE { return k; }
virtual void setMinSize(int min_size_) { min_size = min_size_; } virtual void setMinSize(int min_size_) CV_OVERRIDE { min_size = min_size_; }
virtual int getMinSize() { return 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_ fs << "name" << name_
<< "sigma" << sigma << "sigma" << sigma
<< "k" << k << "k" << k
<< "min_size" << (int)min_size; << "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_ ); CV_Assert( (String)fn["name"] == name_ );
sigma = (double)fn["sigma"]; sigma = (double)fn["sigma"];
......
...@@ -130,7 +130,7 @@ public: ...@@ -130,7 +130,7 @@ public:
static Ptr<GuidedFilterImpl> create(InputArray guide, int radius, double eps); 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: protected:
...@@ -181,7 +181,7 @@ private: /*Routines to parallelize boxFilter and convertTo*/ ...@@ -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<Mat>& srcv, vector<Mat>& dstv, TransformFunc func_);
GFTransform_ParBody(GuidedFilterImpl& gf_, vector<vector<Mat> >& srcvv, vector<vector<Mat> >& dstvv, 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 Range getRange() const
{ {
...@@ -218,7 +218,7 @@ private: /*Parallel body classes*/ ...@@ -218,7 +218,7 @@ private: /*Parallel body classes*/
MulChannelsGuide_ParBody(GuidedFilterImpl& gf_, SymArray2D<Mat>& covars_) MulChannelsGuide_ParBody(GuidedFilterImpl& gf_, SymArray2D<Mat>& covars_)
: gf(gf_), covars(covars_) {} : gf(gf_), covars(covars_) {}
void operator () (const Range& range) const; void operator () (const Range& range) const CV_OVERRIDE;
}; };
struct ComputeCovGuideFromChannelsMul_ParBody : public ParallelLoopBody struct ComputeCovGuideFromChannelsMul_ParBody : public ParallelLoopBody
...@@ -229,7 +229,7 @@ private: /*Parallel body classes*/ ...@@ -229,7 +229,7 @@ private: /*Parallel body classes*/
ComputeCovGuideFromChannelsMul_ParBody(GuidedFilterImpl& gf_, SymArray2D<Mat>& covars_) ComputeCovGuideFromChannelsMul_ParBody(GuidedFilterImpl& gf_, SymArray2D<Mat>& covars_)
: gf(gf_), covars(covars_) {} : gf(gf_), covars(covars_) {}
void operator () (const Range& range) const; void operator () (const Range& range) const CV_OVERRIDE;
}; };
struct ComputeCovGuideInv_ParBody : public ParallelLoopBody struct ComputeCovGuideInv_ParBody : public ParallelLoopBody
...@@ -239,7 +239,7 @@ private: /*Parallel body classes*/ ...@@ -239,7 +239,7 @@ private: /*Parallel body classes*/
ComputeCovGuideInv_ParBody(GuidedFilterImpl& gf_, SymArray2D<Mat>& covars_); 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*/ ...@@ -252,7 +252,7 @@ private: /*Parallel body classes*/
MulChannelsGuideAndSrc_ParBody(GuidedFilterImpl& gf_, vector<Mat>& srcCn_, vector<vector<Mat> >& cov_) MulChannelsGuideAndSrc_ParBody(GuidedFilterImpl& gf_, vector<Mat>& srcCn_, vector<vector<Mat> >& cov_)
: gf(gf_), cov(cov_), srcCn(srcCn_) {} : 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 struct ComputeCovFromSrcChannelsMul_ParBody : public ParallelLoopBody
...@@ -264,7 +264,7 @@ private: /*Parallel body classes*/ ...@@ -264,7 +264,7 @@ private: /*Parallel body classes*/
ComputeCovFromSrcChannelsMul_ParBody(GuidedFilterImpl& gf_, vector<Mat>& srcCnMean_, vector<vector<Mat> >& cov_) ComputeCovFromSrcChannelsMul_ParBody(GuidedFilterImpl& gf_, vector<Mat>& srcCnMean_, vector<vector<Mat> >& cov_)
: gf(gf_), cov(cov_), srcCnMean(srcCnMean_) {} : 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 struct ComputeAlpha_ParBody : public ParallelLoopBody
...@@ -276,7 +276,7 @@ private: /*Parallel body classes*/ ...@@ -276,7 +276,7 @@ private: /*Parallel body classes*/
ComputeAlpha_ParBody(GuidedFilterImpl& gf_, vector<vector<Mat> >& alpha_, vector<vector<Mat> >& covSrc_) ComputeAlpha_ParBody(GuidedFilterImpl& gf_, vector<vector<Mat> >& alpha_, vector<vector<Mat> >& covSrc_)
: gf(gf_), alpha(alpha_), covSrc(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 struct ComputeBeta_ParBody : public ParallelLoopBody
...@@ -289,7 +289,7 @@ private: /*Parallel body classes*/ ...@@ -289,7 +289,7 @@ private: /*Parallel body classes*/
ComputeBeta_ParBody(GuidedFilterImpl& gf_, vector<vector<Mat> >& alpha_, vector<Mat>& srcCnMean_, vector<Mat>& beta_) ComputeBeta_ParBody(GuidedFilterImpl& gf_, vector<vector<Mat> >& alpha_, vector<Mat>& srcCnMean_, vector<Mat>& beta_)
: gf(gf_), alpha(alpha_), srcCnMean(srcCnMean_), beta(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 struct ApplyTransform_ParBody : public ParallelLoopBody
...@@ -301,7 +301,7 @@ private: /*Parallel body classes*/ ...@@ -301,7 +301,7 @@ private: /*Parallel body classes*/
ApplyTransform_ParBody(GuidedFilterImpl& gf_, vector<vector<Mat> >& alpha_, vector<Mat>& beta_) ApplyTransform_ParBody(GuidedFilterImpl& gf_, vector<vector<Mat> >& alpha_, vector<Mat>& beta_)
: gf(gf_), alpha(alpha_), beta(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 @@ ...@@ -2,26 +2,26 @@
* By downloading, copying, installing or using the software you agree to this license. * 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, * If you do not agree to this license, do not download, install,
* copy or use the software. * copy or use the software.
* *
* *
* License Agreement * License Agreement
* For Open Source Computer Vision Library * For Open Source Computer Vision Library
* (3 - clause BSD License) * (3 - clause BSD License)
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met : * are permitted provided that the following conditions are met :
* *
* * Redistributions of source code must retain the above copyright notice, * * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* * Redistributions in binary form must reproduce the above copyright notice, * * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and / or other materials provided with the distribution. * and / or other materials provided with the distribution.
* *
* * Neither the names of the copyright holders nor the names of the contributors * * 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 * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* This software is provided by the copyright holders and contributors "as is" and * 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 * any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed. * warranties of merchantability and fitness for a particular purpose are disclaimed.
...@@ -74,7 +74,7 @@ public: ...@@ -74,7 +74,7 @@ public:
JointBilateralFilter_32f(Mat& joint_, Mat& src_, Mat& dst_, int radius_, JointBilateralFilter_32f(Mat& joint_, Mat& src_, Mat& dst_, int radius_,
int maxk_, float scaleIndex_, int *spaceOfs_, float *spaceWeights_, float *expLUT_) 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_) 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); CV_DbgAssert(joint.type() == traits::Type<JointVec>::value && src.type() == dst.type() && src.type() == traits::Type<SrcVec>::value);
...@@ -82,7 +82,7 @@ public: ...@@ -82,7 +82,7 @@ public:
CV_DbgAssert(joint.cols == src.cols && src.cols == dst.cols + 2*radius); 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++) for (int i = radius + range.start; i < radius + range.end; i++)
{ {
...@@ -122,7 +122,7 @@ public: ...@@ -122,7 +122,7 @@ public:
void jointBilateralFilter_32f(Mat& joint, Mat& src, Mat& dst, int radius, double sigmaColor, double sigmaSpace, int borderType) 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); CV_DbgAssert(joint.depth() == CV_32F && src.depth() == CV_32F);
int d = 2*radius + 1; int d = 2*radius + 1;
int jCn = joint.channels(); int jCn = joint.channels();
const int kExpNumBinsPerChannel = 1 << 12; const int kExpNumBinsPerChannel = 1 << 12;
...@@ -228,7 +228,7 @@ public: ...@@ -228,7 +228,7 @@ public:
CV_DbgAssert(joint.cols == src.cols && src.cols == dst.cols + 2 * radius); 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<int, JointVec::channels> JointVeci;
typedef Vec<float, SrcVec::channels> SrcVecf; typedef Vec<float, SrcVec::channels> SrcVecf;
...@@ -250,7 +250,7 @@ public: ...@@ -250,7 +250,7 @@ public:
int alpha = 0; int alpha = 0;
for (int cn = 0; cn < JointVec::channels; cn++) for (int cn = 0; cn < JointVec::channels; cn++)
alpha += std::abs(jointPix0[cn] - (int)jointPix[cn]); alpha += std::abs(jointPix0[cn] - (int)jointPix[cn]);
float weight = spaceWeights[k] * expLUT[alpha]; float weight = spaceWeights[k] * expLUT[alpha];
uchar *srcPix = reinterpret_cast<uchar*>(srcCenterPixPtr + spaceOfs[k]); uchar *srcPix = reinterpret_cast<uchar*>(srcCenterPixPtr + spaceOfs[k]);
...@@ -399,4 +399,4 @@ void jointBilateralFilter(InputArray joint_, InputArray src_, OutputArray dst_, ...@@ -399,4 +399,4 @@ void jointBilateralFilter(InputArray joint_, InputArray src_, OutputArray dst_,
} }
} }
} }
\ No newline at end of file
...@@ -54,7 +54,7 @@ namespace ...@@ -54,7 +54,7 @@ namespace
{ {
src_ = s; 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++) for (int i = range.start; i != range.end; i++)
{ {
...@@ -72,7 +72,7 @@ namespace ...@@ -72,7 +72,7 @@ namespace
{ {
src_ = s; 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++) for (int i = range.start; i != range.end; i++)
{ {
...@@ -95,7 +95,7 @@ namespace ...@@ -95,7 +95,7 @@ namespace
denom_ = denom; denom_ = denom;
dst_ = dst; 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++) for (int i = range.start; i != range.end; i++)
{ {
......
...@@ -59,22 +59,22 @@ public: ...@@ -59,22 +59,22 @@ public:
SuperpixelLSCImpl( InputArray image, int region_size, float ratio ); SuperpixelLSCImpl( InputArray image, int region_size, float ratio );
virtual ~SuperpixelLSCImpl(); virtual ~SuperpixelLSCImpl() CV_OVERRIDE;
// perform amount of iteration // perform amount of iteration
virtual void iterate( int num_iterations = 10 ); virtual void iterate( int num_iterations = 10 ) CV_OVERRIDE;
// get amount of superpixels // get amount of superpixels
virtual int getNumberOfSuperpixels() const; virtual int getNumberOfSuperpixels() const CV_OVERRIDE;
// get image with labels // 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 // 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 // enforce connectivity over labels
virtual void enforceLabelConnectivity( int min_element_size ); virtual void enforceLabelConnectivity( int min_element_size ) CV_OVERRIDE;
protected: protected:
...@@ -1075,7 +1075,7 @@ struct FeatureSpaceWeights : ParallelLoopBody ...@@ -1075,7 +1075,7 @@ struct FeatureSpaceWeights : ParallelLoopBody
sigmaC1 = _sigmaC1; sigmaC2 = _sigmaC2; 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++ ) for( int x = range.start; x < range.end; x++ )
{ {
...@@ -1222,7 +1222,7 @@ struct FeatureSpaceCenters : ParallelLoopBody ...@@ -1222,7 +1222,7 @@ struct FeatureSpaceCenters : ParallelLoopBody
centerC1 = _centerC1; centerC2 = _centerC2; 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++ ) for( int i = range.start; i < range.end; i++ )
{ {
...@@ -1364,7 +1364,7 @@ struct FeatureSpaceKmeans : ParallelLoopBody ...@@ -1364,7 +1364,7 @@ struct FeatureSpaceKmeans : ParallelLoopBody
centerC1 = _centerC1; centerC2 = _centerC2; 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++ ) for( int i = range.start; i < range.end; i++ )
{ {
...@@ -1693,7 +1693,7 @@ struct FeatureNormals : ParallelLoopBody ...@@ -1693,7 +1693,7 @@ struct FeatureNormals : ParallelLoopBody
centerC1 = _centerC1; centerC2 = _centerC2; 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++ ) for( int i = range.start; i < range.end; i++ )
{ {
......
...@@ -145,7 +145,7 @@ public: ...@@ -145,7 +145,7 @@ public:
verbose(false) verbose(false)
{} {}
void Verbose(bool b){verbose=b;} 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(img.depth()==CV_8UC1 || img.depth()==CV_16SC1 || img.depth()==CV_16UC1);
CV_Assert(dst.depth()==CV_32FC1); CV_Assert(dst.depth()==CV_32FC1);
...@@ -193,7 +193,7 @@ public: ...@@ -193,7 +193,7 @@ public:
verbose(false) verbose(false)
{} {}
void Verbose(bool b){verbose=b;} 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(img.depth()==CV_32FC1);
if (verbose) if (verbose)
...@@ -263,7 +263,7 @@ public: ...@@ -263,7 +263,7 @@ public:
verbose(false) verbose(false)
{} {}
void Verbose(bool b){verbose=b;} 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(img.depth()==CV_32FC1);
if (verbose) if (verbose)
...@@ -333,7 +333,7 @@ public: ...@@ -333,7 +333,7 @@ public:
verbose(false) verbose(false)
{} {}
void Verbose(bool b){verbose=b;} void Verbose(bool b){verbose=b;}
virtual void operator()(const Range& range) const virtual void operator()(const Range& range) const CV_OVERRIDE
{ {
if (verbose) if (verbose)
std::cout << getThreadNum()<<"# :Start from row " << range.start << " to " << range.end-1<<" ("<<range.end-range.start<<" loops)" << std::endl; std::cout << getThreadNum()<<"# :Start from row " << range.start << " to " << range.end-1<<" ("<<range.end-range.start<<" loops)" << std::endl;
......
...@@ -28,7 +28,7 @@ public: ...@@ -28,7 +28,7 @@ public:
_borderType = borderType; _borderType = borderType;
_out_dtype = out_dtype; _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) void RidgeDetectionFilterImpl::getRidgeFilteredImage(InputArray _img, OutputArray out)
......
...@@ -79,13 +79,13 @@ public: ...@@ -79,13 +79,13 @@ public:
virtual ~SuperpixelSEEDSImpl(); 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 getLabels(OutputArray labels_out) CV_OVERRIDE;
virtual void getLabelContourMask(OutputArray image, bool thick_line = false); virtual void getLabelContourMask(OutputArray image, bool thick_line = false) CV_OVERRIDE;
private: private:
/* initialization */ /* initialization */
......
...@@ -113,16 +113,16 @@ namespace cv { ...@@ -113,16 +113,16 @@ namespace cv {
* Stragegy / Color * Stragegy / Color
***************************************/ ***************************************/
class SelectiveSearchSegmentationStrategyColorImpl : public SelectiveSearchSegmentationStrategyColor { class SelectiveSearchSegmentationStrategyColorImpl CV_FINAL : public SelectiveSearchSegmentationStrategyColor {
public: public:
SelectiveSearchSegmentationStrategyColorImpl() { SelectiveSearchSegmentationStrategyColorImpl() {
name_ = "SelectiveSearchSegmentationStrategyColor"; name_ = "SelectiveSearchSegmentationStrategyColor";
last_image_id = -1; last_image_id = -1;
} }
virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1); virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1) CV_OVERRIDE;
virtual float get(int r1, int r2); virtual float get(int r1, int r2) CV_OVERRIDE;
virtual void merge(int r1, int r2); virtual void merge(int r1, int r2) CV_OVERRIDE;
private: private:
String name_; String name_;
...@@ -242,19 +242,19 @@ namespace cv { ...@@ -242,19 +242,19 @@ namespace cv {
* Stragegy / Multiple * Stragegy / Multiple
***************************************/ ***************************************/
class SelectiveSearchSegmentationStrategyMultipleImpl : public SelectiveSearchSegmentationStrategyMultiple { class SelectiveSearchSegmentationStrategyMultipleImpl CV_FINAL : public SelectiveSearchSegmentationStrategyMultiple {
public: public:
SelectiveSearchSegmentationStrategyMultipleImpl() { SelectiveSearchSegmentationStrategyMultipleImpl() {
name_ = "SelectiveSearchSegmentationStrategyMultiple"; name_ = "SelectiveSearchSegmentationStrategyMultiple";
weights_total = 0; weights_total = 0;
} }
virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1); virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1) CV_OVERRIDE;
virtual float get(int r1, int r2); virtual float get(int r1, int r2) CV_OVERRIDE;
virtual void merge(int r1, int r2); virtual void merge(int r1, int r2) CV_OVERRIDE;
virtual void addStrategy(Ptr<SelectiveSearchSegmentationStrategy> g, float weight); virtual void addStrategy(Ptr<SelectiveSearchSegmentationStrategy> g, float weight) CV_OVERRIDE;
virtual void clearStrategies(); virtual void clearStrategies() CV_OVERRIDE;
private: private:
String name_; String name_;
...@@ -346,15 +346,15 @@ namespace cv { ...@@ -346,15 +346,15 @@ namespace cv {
* Stragegy / Size * Stragegy / Size
***************************************/ ***************************************/
class SelectiveSearchSegmentationStrategySizeImpl : public SelectiveSearchSegmentationStrategySize { class SelectiveSearchSegmentationStrategySizeImpl CV_FINAL : public SelectiveSearchSegmentationStrategySize {
public: public:
SelectiveSearchSegmentationStrategySizeImpl() { SelectiveSearchSegmentationStrategySizeImpl() {
name_ = "SelectiveSearchSegmentationStrategySize"; name_ = "SelectiveSearchSegmentationStrategySize";
} }
virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1); virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1) CV_OVERRIDE;
virtual float get(int r1, int r2); virtual float get(int r1, int r2) CV_OVERRIDE;
virtual void merge(int r1, int r2); virtual void merge(int r1, int r2) CV_OVERRIDE;
private: private:
String name_; String name_;
...@@ -393,15 +393,15 @@ namespace cv { ...@@ -393,15 +393,15 @@ namespace cv {
* Stragegy / Fill * Stragegy / Fill
***************************************/ ***************************************/
class SelectiveSearchSegmentationStrategyFillImpl : public SelectiveSearchSegmentationStrategyFill { class SelectiveSearchSegmentationStrategyFillImpl CV_FINAL : public SelectiveSearchSegmentationStrategyFill {
public: public:
SelectiveSearchSegmentationStrategyFillImpl() { SelectiveSearchSegmentationStrategyFillImpl() {
name_ = "SelectiveSearchSegmentationStrategyFill"; name_ = "SelectiveSearchSegmentationStrategyFill";
} }
virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1); virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1) CV_OVERRIDE;
virtual float get(int r1, int r2); virtual float get(int r1, int r2) CV_OVERRIDE;
virtual void merge(int r1, int r2); virtual void merge(int r1, int r2) CV_OVERRIDE;
private: private:
String name_; String name_;
...@@ -471,16 +471,16 @@ namespace cv { ...@@ -471,16 +471,16 @@ namespace cv {
* Stragegy / Texture * Stragegy / Texture
***************************************/ ***************************************/
class SelectiveSearchSegmentationStrategyTextureImpl : public SelectiveSearchSegmentationStrategyTexture { class SelectiveSearchSegmentationStrategyTextureImpl CV_FINAL : public SelectiveSearchSegmentationStrategyTexture {
public: public:
SelectiveSearchSegmentationStrategyTextureImpl() { SelectiveSearchSegmentationStrategyTextureImpl() {
name_ = "SelectiveSearchSegmentationStrategyTexture"; name_ = "SelectiveSearchSegmentationStrategyTexture";
last_image_id = -1; last_image_id = -1;
} }
virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1); virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1) CV_OVERRIDE;
virtual float get(int r1, int r2); virtual float get(int r1, int r2) CV_OVERRIDE;
virtual void merge(int r1, int r2); virtual void merge(int r1, int r2) CV_OVERRIDE;
private: private:
String name_; String name_;
...@@ -678,39 +678,39 @@ namespace cv { ...@@ -678,39 +678,39 @@ namespace cv {
// Core // Core
class SelectiveSearchSegmentationImpl : public SelectiveSearchSegmentation { class SelectiveSearchSegmentationImpl CV_FINAL : public SelectiveSearchSegmentation {
public: public:
SelectiveSearchSegmentationImpl() { SelectiveSearchSegmentationImpl() {
name_ = "SelectiveSearchSegmentation"; name_ = "SelectiveSearchSegmentation";
} }
~SelectiveSearchSegmentationImpl() { ~SelectiveSearchSegmentationImpl() CV_OVERRIDE {
}; };
virtual void write(FileStorage& fs) const { virtual void write(FileStorage& fs) const CV_OVERRIDE {
fs << "name" << name_; fs << "name" << name_;
} }
virtual void read(const FileNode& fn) { virtual void read(const FileNode& fn) CV_OVERRIDE {
CV_Assert( (String)fn["name"] == name_); 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 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); 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); virtual void switchToSelectiveSearchQuality(int base_k = 150, int inc_k = 150, float sigma = 0.8) CV_OVERRIDE;
virtual void addImage(InputArray img); virtual void addImage(InputArray img) CV_OVERRIDE;
virtual void clearImages(); virtual void clearImages() CV_OVERRIDE;
virtual void addGraphSegmentation(Ptr<GraphSegmentation> g); virtual void addGraphSegmentation(Ptr<GraphSegmentation> g) CV_OVERRIDE;
virtual void clearGraphSegmentations(); virtual void clearGraphSegmentations() CV_OVERRIDE;
virtual void addStrategy(Ptr<SelectiveSearchSegmentationStrategy> s); virtual void addStrategy(Ptr<SelectiveSearchSegmentationStrategy> s) CV_OVERRIDE;
virtual void clearStrategies(); virtual void clearStrategies() CV_OVERRIDE;
virtual void process(std::vector<Rect>& rects); virtual void process(std::vector<Rect>& rects) CV_OVERRIDE;
private: private:
......
...@@ -72,22 +72,22 @@ public: ...@@ -72,22 +72,22 @@ public:
SuperpixelSLICImpl( InputArray image, int algorithm, int region_size, float ruler ); SuperpixelSLICImpl( InputArray image, int algorithm, int region_size, float ruler );
virtual ~SuperpixelSLICImpl(); virtual ~SuperpixelSLICImpl() CV_OVERRIDE;
// perform amount of iteration // perform amount of iteration
virtual void iterate( int num_iterations = 10 ); virtual void iterate( int num_iterations = 10 ) CV_OVERRIDE;
// get amount of superpixels // get amount of superpixels
virtual int getNumberOfSuperpixels() const; virtual int getNumberOfSuperpixels() const CV_OVERRIDE;
// get image with labels // 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 // 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 // enforce connectivity over labels
virtual void enforceLabelConnectivity( int min_element_size = 25 ); virtual void enforceLabelConnectivity( int min_element_size = 25 ) CV_OVERRIDE;
protected: protected:
...@@ -840,7 +840,7 @@ struct SeedNormInvoker : ParallelLoopBody ...@@ -840,7 +840,7 @@ struct SeedNormInvoker : ParallelLoopBody
clustersize = _clustersize; 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) for (int k = range.start; k < range.end; ++k)
{ {
...@@ -1009,7 +1009,7 @@ struct SLICOGrowInvoker : ParallelLoopBody ...@@ -1009,7 +1009,7 @@ struct SLICOGrowInvoker : ParallelLoopBody
nr_channels = _nr_channels; 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 cols = klabels->cols;
int rows = klabels->rows; int rows = klabels->rows;
...@@ -1221,7 +1221,7 @@ struct SLICGrowInvoker : ParallelLoopBody ...@@ -1221,7 +1221,7 @@ struct SLICGrowInvoker : ParallelLoopBody
nr_channels = _nr_channels; 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) for (int y = range.start; y < range.end; ++y)
{ {
......
...@@ -69,11 +69,11 @@ struct node ...@@ -69,11 +69,11 @@ struct node
node(short l,float d): dist(d), label(l) {} node(short l,float d): dist(d), label(l) {}
}; };
class EdgeAwareInterpolatorImpl : public EdgeAwareInterpolator class EdgeAwareInterpolatorImpl CV_FINAL : public EdgeAwareInterpolator
{ {
public: public:
static Ptr<EdgeAwareInterpolatorImpl> create(); 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: protected:
int w,h; int w,h;
...@@ -115,7 +115,7 @@ protected: ...@@ -115,7 +115,7 @@ protected:
int stripe_sz; int stripe_sz;
GetKNNMatches_ParBody(EdgeAwareInterpolatorImpl& _inst, int _num_stripes); 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 struct RansacInterpolation_ParBody : public ParallelLoopBody
...@@ -130,22 +130,22 @@ protected: ...@@ -130,22 +130,22 @@ protected:
int inc; int inc;
RansacInterpolation_ParBody(EdgeAwareInterpolatorImpl& _inst, Mat* _transforms, float* _weighted_inlier_nums, float* _eps, SparseMatch* _matches, int _num_stripes, 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: public:
void setK(int _k) {k=_k;} void setK(int _k) CV_OVERRIDE {k=_k;}
int getK() {return k;} int getK() CV_OVERRIDE {return k;}
void setSigma(float _sigma) {sigma=_sigma;} void setSigma(float _sigma) CV_OVERRIDE {sigma=_sigma;}
float getSigma() {return sigma;} float getSigma() CV_OVERRIDE {return sigma;}
void setLambda(float _lambda) {lambda=_lambda;} void setLambda(float _lambda) CV_OVERRIDE {lambda=_lambda;}
float getLambda() {return lambda;} float getLambda() CV_OVERRIDE {return lambda;}
void setUsePostProcessing(bool _use_post_proc) {use_post_proc=_use_post_proc;} void setUsePostProcessing(bool _use_post_proc) CV_OVERRIDE {use_post_proc=_use_post_proc;}
bool getUsePostProcessing() {return use_post_proc;} bool getUsePostProcessing() CV_OVERRIDE {return use_post_proc;}
void setFGSLambda(float _lambda) {fgs_lambda=_lambda;} void setFGSLambda(float _lambda) CV_OVERRIDE {fgs_lambda=_lambda;}
float getFGSLambda() {return fgs_lambda;} float getFGSLambda() CV_OVERRIDE {return fgs_lambda;}
void setFGSSigma(float _sigma) {fgs_sigma = _sigma;} void setFGSSigma(float _sigma) CV_OVERRIDE {fgs_sigma = _sigma;}
float getFGSSigma() {return fgs_sigma;} float getFGSSigma() CV_OVERRIDE {return fgs_sigma;}
}; };
void EdgeAwareInterpolatorImpl::init() void EdgeAwareInterpolatorImpl::init()
......
...@@ -281,7 +281,7 @@ public: ...@@ -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++) for (int x = range.start; x < range.end; x++)
{ {
...@@ -359,7 +359,7 @@ public: ...@@ -359,7 +359,7 @@ public:
* \param gradNum : __rf.options.numberOfGradientOrientations * \param gradNum : __rf.options.numberOfGradientOrientations
*/ */
virtual void getFeatures(const Mat &src, Mat &features, const int gnrmRad, const int gsmthRad, 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); cv::Mat luvImg = rgb2luv(src);
...@@ -524,7 +524,7 @@ public: ...@@ -524,7 +524,7 @@ public:
* \param _dst : destination image (grayscale, float, in [0;1]) * \param _dst : destination image (grayscale, float, in [0;1])
* where edges are drawn * 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 ); CV_Assert( _src.type() == CV_32FC3 );
...@@ -556,7 +556,7 @@ public: ...@@ -556,7 +556,7 @@ public:
* \param dst : orientation image. * \param dst : orientation image.
* \param r : filter radius. * \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 ); CV_Assert( _src.type() == CV_32FC1 );
...@@ -596,7 +596,7 @@ public: ...@@ -596,7 +596,7 @@ public:
* \param m : multiplier for conservative suppression. * \param m : multiplier for conservative suppression.
* \param isParallel: enables/disables parallel computing. * \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(edge_image.type() == CV_32FC1);
CV_Assert(orientation_image.type() == CV_32FC1); CV_Assert(orientation_image.type() == CV_32FC1);
......
...@@ -4,19 +4,19 @@ ...@@ -4,19 +4,19 @@
/* /*
* The MIT License(MIT) * The MIT License(MIT)
* *
* Copyright(c) 2013 Vladislav Vinogradov * Copyright(c) 2013 Vladislav Vinogradov
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files(the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of * 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, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions : * subject to the following conditions :
* *
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR
...@@ -149,12 +149,18 @@ using namespace cv::ximgproc; ...@@ -149,12 +149,18 @@ using namespace cv::ximgproc;
void collectGarbage(); void collectGarbage();
CV_IMPL_PROPERTY(double, SigmaS, sigma_s_) inline double getSigmaS() const CV_OVERRIDE { return sigma_s_; }
CV_IMPL_PROPERTY(double, SigmaR, sigma_r_) inline void setSigmaS(double val) CV_OVERRIDE { sigma_s_ = val; }
CV_IMPL_PROPERTY(int, TreeHeight, tree_height_) inline double getSigmaR() const CV_OVERRIDE { return sigma_r_; }
CV_IMPL_PROPERTY(int, PCAIterations, num_pca_iterations_) inline void setSigmaR(double val) CV_OVERRIDE { sigma_r_ = val; }
CV_IMPL_PROPERTY(bool, AdjustOutliers, adjust_outliers_) inline int getTreeHeight() const CV_OVERRIDE { return tree_height_; }
CV_IMPL_PROPERTY(bool, UseRNG, useRNG) 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: protected:
bool adjust_outliers_; bool adjust_outliers_;
...@@ -930,7 +936,7 @@ using namespace cv::ximgproc; ...@@ -930,7 +936,7 @@ using namespace cv::ximgproc;
Ptr<AdaptiveManifoldFilter> createAMFilterRefImpl(double sigma_s, double sigma_r, bool adjust_outliers) Ptr<AdaptiveManifoldFilter> createAMFilterRefImpl(double sigma_s, double sigma_r, bool adjust_outliers)
{ {
Ptr<AdaptiveManifoldFilter> amf(new AdaptiveManifoldFilterRefImpl()); Ptr<AdaptiveManifoldFilter> amf(new AdaptiveManifoldFilterRefImpl());
amf->setSigmaS(sigma_s); amf->setSigmaS(sigma_s);
amf->setSigmaR(sigma_r); amf->setSigmaR(sigma_r);
amf->setAdjustOutliers(adjust_outliers); amf->setAdjustOutliers(adjust_outliers);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment