namespace cv
{
-class EMEstimatorCallback : public PointSetRegistrator::Callback
+class EMEstimatorCallback CV_FINAL : public PointSetRegistrator::Callback
{
public:
- int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const
+ int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const CV_OVERRIDE
{
Mat q1 = _m1.getMat(), q2 = _m2.getMat();
Mat Q1 = q1.reshape(1, (int)q1.total());
}
- void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const
+ void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const CV_OVERRIDE
{
Mat X1 = _m1.getMat(), X2 = _m2.getMat(), model = _model.getMat();
const Point2d* x1ptr = X1.ptr<Point2d>();
* where \f$\lambda \in \mathbb{R} \f$.
*
*/
-class HomographyEstimatorCallback : public PointSetRegistrator::Callback
+class HomographyEstimatorCallback CV_FINAL : public PointSetRegistrator::Callback
{
public:
- bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const
+ bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const CV_OVERRIDE
{
Mat ms1 = _ms1.getMat(), ms2 = _ms2.getMat();
if( haveCollinearPoints(ms1, count) || haveCollinearPoints(ms2, count) )
* 2 columns 1 channel
* @param _model, CV_64FC1, 3x3, normalized, i.e., the last element is 1
*/
- int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const
+ int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const CV_OVERRIDE
{
Mat m1 = _m1.getMat(), m2 = _m2.getMat();
int i, count = m1.checkVector(2);
* @param _model CV_64FC1, 3x3
* @param _err, output, CV_32FC1, square of the L2 norm
*/
- void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const
+ void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const CV_OVERRIDE
{
Mat m1 = _m1.getMat(), m2 = _m2.getMat(), model = _model.getMat();
int i, count = m1.checkVector(2);
};
-class HomographyRefineCallback : public LMSolver::Callback
+class HomographyRefineCallback CV_FINAL : public LMSolver::Callback
{
public:
HomographyRefineCallback(InputArray _src, InputArray _dst)
dst = _dst.getMat();
}
- bool compute(InputArray _param, OutputArray _err, OutputArray _Jac) const
+ bool compute(InputArray _param, OutputArray _err, OutputArray _Jac) const CV_OVERRIDE
{
int i, count = src.checkVector(2);
Mat param = _param.getMat();
}
-class FMEstimatorCallback : public PointSetRegistrator::Callback
+class FMEstimatorCallback CV_FINAL : public PointSetRegistrator::Callback
{
public:
- bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const
+ bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const CV_OVERRIDE
{
Mat ms1 = _ms1.getMat(), ms2 = _ms2.getMat();
return !haveCollinearPoints(ms1, count) && !haveCollinearPoints(ms2, count);
}
- int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const
+ int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const CV_OVERRIDE
{
double f[9*3];
Mat m1 = _m1.getMat(), m2 = _m2.getMat();
return n;
}
- void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const
+ void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const CV_OVERRIDE
{
Mat __m1 = _m1.getMat(), __m2 = _m2.getMat(), __model = _model.getMat();
int i, count = __m1.checkVector(2);
cv::Matx33d _Hnorm;
};
-class HomographyDecompZhang : public HomographyDecomp {
+class HomographyDecompZhang CV_FINAL : public HomographyDecomp {
public:
HomographyDecompZhang():HomographyDecomp() {}
virtual ~HomographyDecompZhang() {}
private:
- virtual void decompose(std::vector<CameraMotion>& camMotions);
+ virtual void decompose(std::vector<CameraMotion>& camMotions) CV_OVERRIDE;
bool findMotionFrom_tstar_n(const cv::Vec3d& tstar, const cv::Vec3d& n, CameraMotion& motion);
};
-class HomographyDecompInria : public HomographyDecomp {
+class HomographyDecompInria CV_FINAL : public HomographyDecomp {
public:
HomographyDecompInria():HomographyDecomp() {}
virtual ~HomographyDecompInria() {}
private:
- virtual void decompose(std::vector<CameraMotion>& camMotions);
+ virtual void decompose(std::vector<CameraMotion>& camMotions) CV_OVERRIDE;
double oppositeOfMinor(const cv::Matx33d& M, const int row, const int col);
void findRmatFrom_tstar_n(const cv::Vec3d& tstar, const cv::Vec3d& n, const double v, cv::Matx33d& R);
};
namespace cv
{
-class LMSolverImpl : public LMSolver
+class LMSolverImpl CV_FINAL : public LMSolver
{
public:
LMSolverImpl() : maxIters(100) { init(); }
printInterval = 0;
}
- int run(InputOutputArray _param0) const
+ int run(InputOutputArray _param0) const CV_OVERRIDE
{
Mat param0 = _param0.getMat(), x, xd, r, rd, J, A, Ap, v, temp_d, d;
int ptype = param0.type();
return iter;
}
- void setCallback(const Ptr<LMSolver::Callback>& _cb) { cb = _cb; }
+ void setCallback(const Ptr<LMSolver::Callback>& _cb) CV_OVERRIDE { cb = _cb; }
Ptr<LMSolver::Callback> cb;
return i == modelPoints && iters < maxAttempts;
}
- bool run(InputArray _m1, InputArray _m2, OutputArray _model, OutputArray _mask) const
+ bool run(InputArray _m1, InputArray _m2, OutputArray _model, OutputArray _mask) const CV_OVERRIDE
{
bool result = false;
Mat m1 = _m1.getMat(), m2 = _m2.getMat();
return result;
}
- void setCallback(const Ptr<PointSetRegistrator::Callback>& _cb) { cb = _cb; }
+ void setCallback(const Ptr<PointSetRegistrator::Callback>& _cb) CV_OVERRIDE { cb = _cb; }
Ptr<PointSetRegistrator::Callback> cb;
int modelPoints;
int _modelPoints=0, double _confidence=0.99, int _maxIters=1000)
: RANSACPointSetRegistrator(_cb, _modelPoints, 0, _confidence, _maxIters) {}
- bool run(InputArray _m1, InputArray _m2, OutputArray _model, OutputArray _mask) const
+ bool run(InputArray _m1, InputArray _m2, OutputArray _model, OutputArray _mask) const CV_OVERRIDE
{
const double outlierRatio = 0.45;
bool result = false;
class Affine3DEstimatorCallback : public PointSetRegistrator::Callback
{
public:
- int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const
+ int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const CV_OVERRIDE
{
Mat m1 = _m1.getMat(), m2 = _m2.getMat();
const Point3f* from = m1.ptr<Point3f>();
return 1;
}
- void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const
+ void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const CV_OVERRIDE
{
Mat m1 = _m1.getMat(), m2 = _m2.getMat(), model = _model.getMat();
const Point3f* from = m1.ptr<Point3f>();
}
}
- bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const
+ bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const CV_OVERRIDE
{
const float threshold = 0.996f;
Mat ms1 = _ms1.getMat(), ms2 = _ms2.getMat();
class Affine2DEstimatorCallback : public PointSetRegistrator::Callback
{
public:
- int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const
+ int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const CV_OVERRIDE
{
Mat m1 = _m1.getMat(), m2 = _m2.getMat();
const Point2f* from = m1.ptr<Point2f>();
return 1;
}
- void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const
+ void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const CV_OVERRIDE
{
Mat m1 = _m1.getMat(), m2 = _m2.getMat(), model = _model.getMat();
const Point2f* from = m1.ptr<Point2f>();
}
}
- bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const
+ bool checkSubset( InputArray _ms1, InputArray _ms2, int count ) const CV_OVERRIDE
{
Mat ms1 = _ms1.getMat();
Mat ms2 = _ms2.getMat();
class AffinePartial2DEstimatorCallback : public Affine2DEstimatorCallback
{
public:
- int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const
+ int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const CV_OVERRIDE
{
Mat m1 = _m1.getMat(), m2 = _m2.getMat();
const Point2f* from = m1.ptr<Point2f>();
dst = _dst.getMat();
}
- bool compute(InputArray _param, OutputArray _err, OutputArray _Jac) const
+ bool compute(InputArray _param, OutputArray _err, OutputArray _Jac) const CV_OVERRIDE
{
int i, count = src.checkVector(2);
Mat param = _param.getMat();
dst = _dst.getMat();
}
- bool compute(InputArray _param, OutputArray _err, OutputArray _Jac) const
+ bool compute(InputArray _param, OutputArray _err, OutputArray _Jac) const CV_OVERRIDE
{
int i, count = src.checkVector(2);
Mat param = _param.getMat();
~RHO_HEST_REFC();
/* Methods to implement external interface */
- inline int initialize(void);
- inline void finalize(void);
- inline int ensureCapacity(unsigned N, double beta);
+ inline int initialize(void) CV_OVERRIDE;
+ inline void finalize(void) CV_OVERRIDE;
+ inline int ensureCapacity(unsigned N, double beta) CV_OVERRIDE;
unsigned rhoHest(const float* src, /* Source points */
const float* dst, /* Destination points */
char* inl, /* Inlier mask */
double beta, /* Works: 0.35 */
unsigned flags, /* Works: 0 */
const float* guessH, /* Extrinsic guess, NULL if none provided */
- float* finalH); /* Final result. */
+ float* finalH /* Final result. */
+ ) CV_OVERRIDE;
return result;
}
-class PnPRansacCallback : public PointSetRegistrator::Callback
+class PnPRansacCallback CV_FINAL : public PointSetRegistrator::Callback
{
public:
/* Pre: True */
/* Post: compute _model with given points and return number of found models */
- int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const
+ int runKernel( InputArray _m1, InputArray _m2, OutputArray _model ) const CV_OVERRIDE
{
Mat opoints = _m1.getMat(), ipoints = _m2.getMat();
/* Pre: True */
/* Post: fill _err with projection errors */
- void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const
+ void computeError( InputArray _m1, InputArray _m2, InputArray _model, OutputArray _err ) const CV_OVERRIDE
{
Mat opoints = _m1.getMat(), ipoints = _m2.getMat(), model = _model.getMat();
state = _state;
}
- void operator()( const Range& range ) const
+ void operator()(const Range& range) const CV_OVERRIDE
{
for( int i = range.start; i < range.end; i++ )
{
#endif
}
- void operator()( const Range& range ) const
+ void operator()(const Range& range) const CV_OVERRIDE
{
int cols = left->cols, rows = left->rows;
int _row0 = std::min(cvRound(range.start * rows / nstripes), rows);
bool useSIMD;
};
-class StereoBMImpl : public StereoBM
+class StereoBMImpl CV_FINAL : public StereoBM
{
public:
StereoBMImpl()
params = StereoBMParams(_numDisparities, _SADWindowSize);
}
- void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr )
+ void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr ) CV_OVERRIDE
{
CV_INSTRUMENT_REGION()
disp.convertTo(disp0, disp0.type(), 1./(1 << disp_shift), 0);
}
- int getMinDisparity() const { return params.minDisparity; }
- void setMinDisparity(int minDisparity) { params.minDisparity = minDisparity; }
+ int getMinDisparity() const CV_OVERRIDE { return params.minDisparity; }
+ void setMinDisparity(int minDisparity) CV_OVERRIDE { params.minDisparity = minDisparity; }
- int getNumDisparities() const { return params.numDisparities; }
- void setNumDisparities(int numDisparities) { params.numDisparities = numDisparities; }
+ int getNumDisparities() const CV_OVERRIDE { return params.numDisparities; }
+ void setNumDisparities(int numDisparities) CV_OVERRIDE { params.numDisparities = numDisparities; }
- int getBlockSize() const { return params.SADWindowSize; }
- void setBlockSize(int blockSize) { params.SADWindowSize = blockSize; }
+ int getBlockSize() const CV_OVERRIDE { return params.SADWindowSize; }
+ void setBlockSize(int blockSize) CV_OVERRIDE { params.SADWindowSize = blockSize; }
- int getSpeckleWindowSize() const { return params.speckleWindowSize; }
- void setSpeckleWindowSize(int speckleWindowSize) { params.speckleWindowSize = speckleWindowSize; }
+ int getSpeckleWindowSize() const CV_OVERRIDE { return params.speckleWindowSize; }
+ void setSpeckleWindowSize(int speckleWindowSize) CV_OVERRIDE { params.speckleWindowSize = speckleWindowSize; }
- int getSpeckleRange() const { return params.speckleRange; }
- void setSpeckleRange(int speckleRange) { params.speckleRange = speckleRange; }
+ int getSpeckleRange() const CV_OVERRIDE { return params.speckleRange; }
+ void setSpeckleRange(int speckleRange) CV_OVERRIDE { params.speckleRange = speckleRange; }
- int getDisp12MaxDiff() const { return params.disp12MaxDiff; }
- void setDisp12MaxDiff(int disp12MaxDiff) { params.disp12MaxDiff = disp12MaxDiff; }
+ int getDisp12MaxDiff() const CV_OVERRIDE { return params.disp12MaxDiff; }
+ void setDisp12MaxDiff(int disp12MaxDiff) CV_OVERRIDE { params.disp12MaxDiff = disp12MaxDiff; }
- int getPreFilterType() const { return params.preFilterType; }
- void setPreFilterType(int preFilterType) { params.preFilterType = preFilterType; }
+ int getPreFilterType() const CV_OVERRIDE { return params.preFilterType; }
+ void setPreFilterType(int preFilterType) CV_OVERRIDE { params.preFilterType = preFilterType; }
- int getPreFilterSize() const { return params.preFilterSize; }
- void setPreFilterSize(int preFilterSize) { params.preFilterSize = preFilterSize; }
+ int getPreFilterSize() const CV_OVERRIDE { return params.preFilterSize; }
+ void setPreFilterSize(int preFilterSize) CV_OVERRIDE { params.preFilterSize = preFilterSize; }
- int getPreFilterCap() const { return params.preFilterCap; }
- void setPreFilterCap(int preFilterCap) { params.preFilterCap = preFilterCap; }
+ int getPreFilterCap() const CV_OVERRIDE { return params.preFilterCap; }
+ void setPreFilterCap(int preFilterCap) CV_OVERRIDE { params.preFilterCap = preFilterCap; }
- int getTextureThreshold() const { return params.textureThreshold; }
- void setTextureThreshold(int textureThreshold) { params.textureThreshold = textureThreshold; }
+ int getTextureThreshold() const CV_OVERRIDE { return params.textureThreshold; }
+ void setTextureThreshold(int textureThreshold) CV_OVERRIDE { params.textureThreshold = textureThreshold; }
- int getUniquenessRatio() const { return params.uniquenessRatio; }
- void setUniquenessRatio(int uniquenessRatio) { params.uniquenessRatio = uniquenessRatio; }
+ int getUniquenessRatio() const CV_OVERRIDE { return params.uniquenessRatio; }
+ void setUniquenessRatio(int uniquenessRatio) CV_OVERRIDE { params.uniquenessRatio = uniquenessRatio; }
- int getSmallerBlockSize() const { return 0; }
- void setSmallerBlockSize(int) {}
+ int getSmallerBlockSize() const CV_OVERRIDE { return 0; }
+ void setSmallerBlockSize(int) CV_OVERRIDE {}
- Rect getROI1() const { return params.roi1; }
- void setROI1(Rect roi1) { params.roi1 = roi1; }
+ Rect getROI1() const CV_OVERRIDE { return params.roi1; }
+ void setROI1(Rect roi1) CV_OVERRIDE { params.roi1 = roi1; }
- Rect getROI2() const { return params.roi2; }
- void setROI2(Rect roi2) { params.roi2 = roi2; }
+ Rect getROI2() const CV_OVERRIDE { return params.roi2; }
+ void setROI2(Rect roi2) CV_OVERRIDE { params.roi2 = roi2; }
- void write(FileStorage& fs) const
+ void write(FileStorage& fs) const CV_OVERRIDE
{
writeFormat(fs);
fs << "name" << name_
<< "uniquenessRatio" << params.uniquenessRatio;
}
- void read(const FileNode& fn)
+ void read(const FileNode& fn) CV_OVERRIDE
{
FileNode n = fn["name"];
CV_Assert( n.isString() && String(n) == name_ );
useSIMD = hasSIMD128();
}
- void operator()( const Range& range ) const
+ void operator()(const Range& range) const CV_OVERRIDE
{
static const CostType MAX_COST = SHRT_MAX;
static const int ALIGN = 16;
useSIMD = hasSIMD128();
}
- void operator()( const Range& range ) const
+ void operator()(const Range& range) const CV_OVERRIDE
{
int y1 = range.start, y2 = range.end;
size_t auxBufsSize = LrSize * sizeof(CostType) + width*(sizeof(CostType) + sizeof(DispType)) + 32;
SGBM3WayMainLoop(Mat *_buffers, const Mat& _img1, const Mat& _img2, Mat* _dst_disp, const StereoSGBMParams& params, PixType* _clipTab, int _nstripes, int _stripe_overlap);
void getRawMatchingCost(CostType* C, CostType* hsumBuf, CostType* pixDiff, PixType* tmpBuf, int y, int src_start_idx) const;
- void operator () (const Range& range) const;
+ void operator () (const Range& range) const CV_OVERRIDE;
};
SGBM3WayMainLoop::SGBM3WayMainLoop(Mat *_buffers, const Mat& _img1, const Mat& _img2, Mat* _dst_disp, const StereoSGBMParams& params, PixType* _clipTab, int _nstripes, int _stripe_overlap):
delete[] dst_disp;
}
-class StereoSGBMImpl : public StereoSGBM
+class StereoSGBMImpl CV_FINAL : public StereoSGBM
{
public:
StereoSGBMImpl()
_mode );
}
- void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr )
+ void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr ) CV_OVERRIDE
{
CV_INSTRUMENT_REGION()
StereoMatcher::DISP_SCALE*params.speckleRange, buffer);
}
- int getMinDisparity() const { return params.minDisparity; }
- void setMinDisparity(int minDisparity) { params.minDisparity = minDisparity; }
+ int getMinDisparity() const CV_OVERRIDE { return params.minDisparity; }
+ void setMinDisparity(int minDisparity) CV_OVERRIDE { params.minDisparity = minDisparity; }
- int getNumDisparities() const { return params.numDisparities; }
- void setNumDisparities(int numDisparities) { params.numDisparities = numDisparities; }
+ int getNumDisparities() const CV_OVERRIDE { return params.numDisparities; }
+ void setNumDisparities(int numDisparities) CV_OVERRIDE { params.numDisparities = numDisparities; }
- int getBlockSize() const { return params.SADWindowSize; }
- void setBlockSize(int blockSize) { params.SADWindowSize = blockSize; }
+ int getBlockSize() const CV_OVERRIDE { return params.SADWindowSize; }
+ void setBlockSize(int blockSize) CV_OVERRIDE { params.SADWindowSize = blockSize; }
- int getSpeckleWindowSize() const { return params.speckleWindowSize; }
- void setSpeckleWindowSize(int speckleWindowSize) { params.speckleWindowSize = speckleWindowSize; }
+ int getSpeckleWindowSize() const CV_OVERRIDE { return params.speckleWindowSize; }
+ void setSpeckleWindowSize(int speckleWindowSize) CV_OVERRIDE { params.speckleWindowSize = speckleWindowSize; }
- int getSpeckleRange() const { return params.speckleRange; }
- void setSpeckleRange(int speckleRange) { params.speckleRange = speckleRange; }
+ int getSpeckleRange() const CV_OVERRIDE { return params.speckleRange; }
+ void setSpeckleRange(int speckleRange) CV_OVERRIDE { params.speckleRange = speckleRange; }
- int getDisp12MaxDiff() const { return params.disp12MaxDiff; }
- void setDisp12MaxDiff(int disp12MaxDiff) { params.disp12MaxDiff = disp12MaxDiff; }
+ int getDisp12MaxDiff() const CV_OVERRIDE { return params.disp12MaxDiff; }
+ void setDisp12MaxDiff(int disp12MaxDiff) CV_OVERRIDE { params.disp12MaxDiff = disp12MaxDiff; }
- int getPreFilterCap() const { return params.preFilterCap; }
- void setPreFilterCap(int preFilterCap) { params.preFilterCap = preFilterCap; }
+ int getPreFilterCap() const CV_OVERRIDE { return params.preFilterCap; }
+ void setPreFilterCap(int preFilterCap) CV_OVERRIDE { params.preFilterCap = preFilterCap; }
- int getUniquenessRatio() const { return params.uniquenessRatio; }
- void setUniquenessRatio(int uniquenessRatio) { params.uniquenessRatio = uniquenessRatio; }
+ int getUniquenessRatio() const CV_OVERRIDE { return params.uniquenessRatio; }
+ void setUniquenessRatio(int uniquenessRatio) CV_OVERRIDE { params.uniquenessRatio = uniquenessRatio; }
- int getP1() const { return params.P1; }
- void setP1(int P1) { params.P1 = P1; }
+ int getP1() const CV_OVERRIDE { return params.P1; }
+ void setP1(int P1) CV_OVERRIDE { params.P1 = P1; }
- int getP2() const { return params.P2; }
- void setP2(int P2) { params.P2 = P2; }
+ int getP2() const CV_OVERRIDE { return params.P2; }
+ void setP2(int P2) CV_OVERRIDE { params.P2 = P2; }
- int getMode() const { return params.mode; }
- void setMode(int mode) { params.mode = mode; }
+ int getMode() const CV_OVERRIDE { return params.mode; }
+ void setMode(int mode) CV_OVERRIDE { params.mode = mode; }
- void write(FileStorage& fs) const
+ void write(FileStorage& fs) const CV_OVERRIDE
{
writeFormat(fs);
fs << "name" << name_
<< "mode" << params.mode;
}
- void read(const FileNode& fn)
+ void read(const FileNode& fn) CV_OVERRIDE
{
FileNode n = fn["name"];
CV_Assert( n.isString() && String(n) == name_ );