Commit ee7c0853 authored by Alexander Alekhin's avatar Alexander Alekhin

stereo: apply CV_OVERRIDE/CV_FINAL

parent 62b4709b
......@@ -215,7 +215,7 @@ namespace cv
kernel_ = kernel;
n2_stop = k2Stop;
}
void operator()(const cv::Range &r) const {
void operator()(const cv::Range &r) const CV_OVERRIDE {
for (int i = r.start; i <= r.end ; i++)
{
int rWidth = i * stride_;
......@@ -256,7 +256,7 @@ namespace cv
public:
MeanKernelIntegralImage(const cv::Mat &image, int window,float scale, int *cost):
img((int *)image.data),windowSize(window) ,width(image.cols) ,scalling(scale) , c(cost){};
void operator()(const cv::Range &r) const{
void operator()(const cv::Range &r) const CV_OVERRIDE {
for (int i = r.start; i <= r.end; i++)
{
int iw = i * width;
......@@ -290,7 +290,7 @@ namespace cv
im_num = num_images;
stride_ = (int)img[0].step;
}
void operator()(const cv::Range &r) const {
void operator()(const cv::Range &r) const CV_OVERRIDE {
for (int i = r.start; i <= r.end ; i++)
{
int rWidth = i * stride_;
......@@ -382,7 +382,7 @@ namespace cv
im_num = num_images;
stride_ = (int)img[0].step;
}
void operator()(const cv::Range &r) const {
void operator()(const cv::Range &r) const CV_OVERRIDE {
for (int i = r.start; i <= r.end ; i++)
{
int distV = i*stride_;
......
......@@ -156,7 +156,7 @@ namespace cv
public :
hammingDistance(const Mat &leftImage, const Mat &rightImage, short *cost, int maxDisp, int kerSize, int *hammingLUT):
left((int *)leftImage.data), right((int *)rightImage.data), c(cost), v(maxDisp),kernelSize(kerSize),width(leftImage.cols), MASK(65535), hammLut(hammingLUT){}
void operator()(const cv::Range &r) const {
void operator()(const cv::Range &r) const CV_OVERRIDE {
for (int i = r.start; i <= r.end ; i++)
{
int iw = i * width;
......@@ -202,7 +202,7 @@ namespace cv
height = cost.rows - 1;
parSum = (short *)partialSums.data;
}
void operator()(const cv::Range &r) const {
void operator()(const cv::Range &r) const CV_OVERRIDE {
for (int i = r.start; i <= r.end; i++)
{
int iwi = (i - 1) * width;
......@@ -243,7 +243,7 @@ namespace cv
scallingFact = scale;
confCheck = confidence;
}
void operator()(const cv::Range &r) const {
void operator()(const cv::Range &r) const CV_OVERRIDE {
for (int i = r.start; i <= r.end ; i++)
{
int lr;
......@@ -300,7 +300,7 @@ namespace cv
height = originalImage.rows;
width = originalImage.cols;
}
void operator()(const cv::Range &r) const{
void operator()(const cv::Range &r) const CV_OVERRIDE {
for (int m = r.start; m <= r.end; m++)
{
for (int n = 4; n < width - 4; ++n)
......@@ -340,7 +340,7 @@ namespace cv
height = originalImage.rows;
width = originalImage.cols;
}
void operator()(const Range &r) const{
void operator()(const Range &r) const CV_OVERRIDE {
for (int n = r.start; n <= r.end; ++n)
{
for (int m = 4; m < height - 4; ++m)
......
......@@ -247,7 +247,7 @@ namespace cv
state = _state;
}
void operator()(const Range& range) const
void operator()(const Range& range) const CV_OVERRIDE
{
for (int i = range.start; i < range.end; i++)
{
......@@ -264,7 +264,7 @@ namespace cv
StereoBinaryBMParams* state;
};
class StereoBinaryBMImpl : public StereoBinaryBM, public Matching
class StereoBinaryBMImpl CV_FINAL : public StereoBinaryBM, public Matching
{
public:
StereoBinaryBMImpl(): Matching(64)
......@@ -277,7 +277,7 @@ namespace cv
params = StereoBinaryBMParams(_numDisparities, _kernelSize);
}
void compute(InputArray leftarr, InputArray rightarr, OutputArray disparr)
void compute(InputArray leftarr, InputArray rightarr, OutputArray disparr) CV_OVERRIDE
{
int dtype = disparr.fixedType() ? disparr.type() : params.dispType;
Size leftsize = leftarr.size();
......@@ -415,58 +415,58 @@ namespace cv
filterSpeckles(disp0, FILTERED, params.speckleWindowSize, params.speckleRange, slidingSumBuf);
}
}
int getAgregationWindowSize() const { return params.agregationWindowSize;}
void setAgregationWindowSize(int value = 9) { CV_Assert(value % 2 != 0); params.agregationWindowSize = value;}
int getAgregationWindowSize() const CV_OVERRIDE { return params.agregationWindowSize;}
void setAgregationWindowSize(int value = 9) CV_OVERRIDE { CV_Assert(value % 2 != 0); params.agregationWindowSize = value;}
int getBinaryKernelType() const { return params.kernelType;}
void setBinaryKernelType(int value = CV_MODIFIED_CENSUS_TRANSFORM) { CV_Assert(value < 7); params.kernelType = value; }
int getBinaryKernelType() const CV_OVERRIDE { return params.kernelType;}
void setBinaryKernelType(int value = CV_MODIFIED_CENSUS_TRANSFORM) CV_OVERRIDE { CV_Assert(value < 7); params.kernelType = value; }
int getSpekleRemovalTechnique() const { return params.regionRemoval;}
void setSpekleRemovalTechnique(int factor = CV_SPECKLE_REMOVAL_AVG_ALGORITHM) {CV_Assert(factor < 2); params.regionRemoval = factor; }
int getSpekleRemovalTechnique() const CV_OVERRIDE { return params.regionRemoval;}
void setSpekleRemovalTechnique(int factor = CV_SPECKLE_REMOVAL_AVG_ALGORITHM) CV_OVERRIDE { CV_Assert(factor < 2); params.regionRemoval = factor; }
bool getUsePrefilter() const { return params.usePrefilter;}
void setUsePrefilter(bool value = false) { params.usePrefilter = value;}
bool getUsePrefilter() const CV_OVERRIDE { return params.usePrefilter;}
void setUsePrefilter(bool value = false) CV_OVERRIDE { params.usePrefilter = value;}
int getScalleFactor() const { return params.scalling;}
void setScalleFactor(int factor = 4) {CV_Assert(factor > 0); params.scalling = factor; setScallingFactor(factor);}
int getScalleFactor() const CV_OVERRIDE { return params.scalling;}
void setScalleFactor(int factor = 4) CV_OVERRIDE { CV_Assert(factor > 0); params.scalling = factor; setScallingFactor(factor); }
int getMinDisparity() const { return params.minDisparity; }
void setMinDisparity(int minDisparity) {CV_Assert(minDisparity >= 0); params.minDisparity = minDisparity; }
int getMinDisparity() const CV_OVERRIDE { return params.minDisparity; }
void setMinDisparity(int minDisparity) CV_OVERRIDE { CV_Assert(minDisparity >= 0); params.minDisparity = minDisparity; }
int getNumDisparities() const { return params.numDisparities; }
void setNumDisparities(int numDisparities) {CV_Assert(numDisparities > 0); params.numDisparities = numDisparities; }
int getNumDisparities() const CV_OVERRIDE { return params.numDisparities; }
void setNumDisparities(int numDisparities) CV_OVERRIDE { CV_Assert(numDisparities > 0); params.numDisparities = numDisparities; }
int getBlockSize() const { return params.kernelSize; }
void setBlockSize(int blockSize) {CV_Assert(blockSize % 2 != 0); params.kernelSize = blockSize; }
int getBlockSize() const CV_OVERRIDE { return params.kernelSize; }
void setBlockSize(int blockSize) CV_OVERRIDE { CV_Assert(blockSize % 2 != 0); params.kernelSize = blockSize; }
int getSpeckleWindowSize() const { return params.speckleWindowSize; }
void setSpeckleWindowSize(int speckleWindowSize) {CV_Assert(speckleWindowSize >= 0); params.speckleWindowSize = speckleWindowSize; }
int getSpeckleWindowSize() const CV_OVERRIDE { return params.speckleWindowSize; }
void setSpeckleWindowSize(int speckleWindowSize) CV_OVERRIDE { CV_Assert(speckleWindowSize >= 0); params.speckleWindowSize = speckleWindowSize; }
int getSpeckleRange() const { return params.speckleRange; }
void setSpeckleRange(int speckleRange) {CV_Assert(speckleRange >= 0); params.speckleRange = speckleRange; }
int getSpeckleRange() const CV_OVERRIDE { return params.speckleRange; }
void setSpeckleRange(int speckleRange) CV_OVERRIDE { CV_Assert(speckleRange >= 0); params.speckleRange = speckleRange; }
int getDisp12MaxDiff() const { return params.disp12MaxDiff; }
void setDisp12MaxDiff(int disp12MaxDiff) {CV_Assert(disp12MaxDiff >= 0); params.disp12MaxDiff = disp12MaxDiff; }
int getDisp12MaxDiff() const CV_OVERRIDE { return params.disp12MaxDiff; }
void setDisp12MaxDiff(int disp12MaxDiff) CV_OVERRIDE { CV_Assert(disp12MaxDiff >= 0); params.disp12MaxDiff = disp12MaxDiff; }
int getPreFilterType() const { return params.preFilterType; }
void setPreFilterType(int preFilterType) { CV_Assert(preFilterType >= 0); params.preFilterType = preFilterType; }
int getPreFilterType() const CV_OVERRIDE { return params.preFilterType; }
void setPreFilterType(int preFilterType) CV_OVERRIDE { CV_Assert(preFilterType >= 0); params.preFilterType = preFilterType; }
int getPreFilterSize() const { return params.preFilterSize; }
void setPreFilterSize(int preFilterSize) { CV_Assert(preFilterSize >= 0); params.preFilterSize = preFilterSize; }
int getPreFilterSize() const CV_OVERRIDE { return params.preFilterSize; }
void setPreFilterSize(int preFilterSize) CV_OVERRIDE { CV_Assert(preFilterSize >= 0); params.preFilterSize = preFilterSize; }
int getPreFilterCap() const { return params.preFilterCap; }
void setPreFilterCap(int preFilterCap) {CV_Assert(preFilterCap >= 0); params.preFilterCap = preFilterCap; }
int getPreFilterCap() const CV_OVERRIDE { return params.preFilterCap; }
void setPreFilterCap(int preFilterCap) CV_OVERRIDE { CV_Assert(preFilterCap >= 0); params.preFilterCap = preFilterCap; }
int getTextureThreshold() const { return params.textureThreshold; }
void setTextureThreshold(int textureThreshold) {CV_Assert(textureThreshold >= 0); params.textureThreshold = textureThreshold; }
int getTextureThreshold() const CV_OVERRIDE { return params.textureThreshold; }
void setTextureThreshold(int textureThreshold) CV_OVERRIDE { CV_Assert(textureThreshold >= 0); params.textureThreshold = textureThreshold; }
int getUniquenessRatio() const { return params.uniquenessRatio; }
void setUniquenessRatio(int uniquenessRatio) {CV_Assert(uniquenessRatio >= 0); params.uniquenessRatio = uniquenessRatio; }
int getUniquenessRatio() const CV_OVERRIDE { return params.uniquenessRatio; }
void setUniquenessRatio(int uniquenessRatio) CV_OVERRIDE { CV_Assert(uniquenessRatio >= 0); params.uniquenessRatio = uniquenessRatio; }
int getSmallerBlockSize() const { return 0; }
void setSmallerBlockSize(int) {}
int getSmallerBlockSize() const CV_OVERRIDE { return 0; }
void setSmallerBlockSize(int) CV_OVERRIDE {}
void write(FileStorage& fs) const
void write(FileStorage& fs) const CV_OVERRIDE
{
fs << "name" << name_
<< "minDisparity" << params.minDisparity
......@@ -482,7 +482,7 @@ namespace cv
<< "uniquenessRatio" << params.uniquenessRatio;
}
void read(const FileNode& fn)
void read(const FileNode& fn) CV_OVERRIDE
{
FileNode n = fn["name"];
CV_Assert(n.isString() && String(n) == name_);
......
......@@ -618,7 +618,7 @@ namespace cv
}
}
}
class StereoBinarySGBMImpl : public StereoBinarySGBM, public Matching
class StereoBinarySGBMImpl CV_FINAL : public StereoBinarySGBM, public Matching
{
public:
StereoBinarySGBMImpl():Matching()
......@@ -635,7 +635,7 @@ namespace cv
_uniquenessRatio, _speckleWindowSize, _speckleRange,
_mode );
}
void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr )
void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr ) CV_OVERRIDE
{
Mat left = leftarr.getMat(), right = rightarr.getMat();
CV_Assert( left.size() == right.size() && left.type() == right.type() &&
......@@ -717,49 +717,49 @@ namespace cv
StereoMatcher::DISP_SCALE * params.speckleRange, buffer);
}
}
int getSubPixelInterpolationMethod() const { return params.subpixelInterpolationMethod;}
void setSubPixelInterpolationMethod(int value = CV_QUADRATIC_INTERPOLATION) { CV_Assert(value < 2); params.subpixelInterpolationMethod = value;}
int getSubPixelInterpolationMethod() const CV_OVERRIDE { return params.subpixelInterpolationMethod;}
void setSubPixelInterpolationMethod(int value = CV_QUADRATIC_INTERPOLATION) CV_OVERRIDE { CV_Assert(value < 2); params.subpixelInterpolationMethod = value;}
int getBinaryKernelType() const { return params.kernelType;}
void setBinaryKernelType(int value = CV_MODIFIED_CENSUS_TRANSFORM) { CV_Assert(value < 7); params.kernelType = value; }
int getBinaryKernelType() const CV_OVERRIDE { return params.kernelType;}
void setBinaryKernelType(int value = CV_MODIFIED_CENSUS_TRANSFORM) CV_OVERRIDE { CV_Assert(value < 7); params.kernelType = value; }
int getSpekleRemovalTechnique() const { return params.regionRemoval;}
void setSpekleRemovalTechnique(int factor = CV_SPECKLE_REMOVAL_AVG_ALGORITHM) { CV_Assert(factor < 2); params.regionRemoval = factor; }
int getSpekleRemovalTechnique() const CV_OVERRIDE { return params.regionRemoval;}
void setSpekleRemovalTechnique(int factor = CV_SPECKLE_REMOVAL_AVG_ALGORITHM) CV_OVERRIDE { CV_Assert(factor < 2); params.regionRemoval = factor; }
int getMinDisparity() const { return params.minDisparity; }
void setMinDisparity(int minDisparity) {CV_Assert(minDisparity >= 0); params.minDisparity = minDisparity; }
int getMinDisparity() const CV_OVERRIDE { return params.minDisparity; }
void setMinDisparity(int minDisparity) CV_OVERRIDE {CV_Assert(minDisparity >= 0); params.minDisparity = minDisparity; }
int getNumDisparities() const { return params.numDisparities; }
void setNumDisparities(int numDisparities) { CV_Assert(numDisparities > 0); params.numDisparities = numDisparities; }
int getNumDisparities() const CV_OVERRIDE { return params.numDisparities; }
void setNumDisparities(int numDisparities) CV_OVERRIDE { CV_Assert(numDisparities > 0); params.numDisparities = numDisparities; }
int getBlockSize() const { return params.kernelSize; }
void setBlockSize(int blockSize) {CV_Assert(blockSize % 2 != 0); params.kernelSize = blockSize; }
int getBlockSize() const CV_OVERRIDE { return params.kernelSize; }
void setBlockSize(int blockSize) CV_OVERRIDE {CV_Assert(blockSize % 2 != 0); params.kernelSize = blockSize; }
int getSpeckleWindowSize() const { return params.speckleWindowSize; }
void setSpeckleWindowSize(int speckleWindowSize) {CV_Assert(speckleWindowSize >= 0); params.speckleWindowSize = speckleWindowSize; }
int getSpeckleWindowSize() const CV_OVERRIDE { return params.speckleWindowSize; }
void setSpeckleWindowSize(int speckleWindowSize) CV_OVERRIDE {CV_Assert(speckleWindowSize >= 0); params.speckleWindowSize = speckleWindowSize; }
int getSpeckleRange() const { return params.speckleRange; }
void setSpeckleRange(int speckleRange) { CV_Assert(speckleRange >= 0); params.speckleRange = speckleRange; }
int getSpeckleRange() const CV_OVERRIDE { return params.speckleRange; }
void setSpeckleRange(int speckleRange) CV_OVERRIDE { CV_Assert(speckleRange >= 0); params.speckleRange = speckleRange; }
int getDisp12MaxDiff() const { return params.disp12MaxDiff; }
void setDisp12MaxDiff(int disp12MaxDiff) {CV_Assert(disp12MaxDiff > 0); params.disp12MaxDiff = disp12MaxDiff; }
int getDisp12MaxDiff() const CV_OVERRIDE { return params.disp12MaxDiff; }
void setDisp12MaxDiff(int disp12MaxDiff) CV_OVERRIDE {CV_Assert(disp12MaxDiff > 0); params.disp12MaxDiff = disp12MaxDiff; }
int getPreFilterCap() const { return params.preFilterCap; }
void setPreFilterCap(int preFilterCap) { CV_Assert(preFilterCap > 0); params.preFilterCap = preFilterCap; }
int getPreFilterCap() const CV_OVERRIDE { return params.preFilterCap; }
void setPreFilterCap(int preFilterCap) CV_OVERRIDE { CV_Assert(preFilterCap > 0); params.preFilterCap = preFilterCap; }
int getUniquenessRatio() const { return params.uniquenessRatio; }
void setUniquenessRatio(int uniquenessRatio) { CV_Assert(uniquenessRatio >= 0); params.uniquenessRatio = uniquenessRatio; }
int getUniquenessRatio() const CV_OVERRIDE { return params.uniquenessRatio; }
void setUniquenessRatio(int uniquenessRatio) CV_OVERRIDE { CV_Assert(uniquenessRatio >= 0); params.uniquenessRatio = uniquenessRatio; }
int getP1() const { return params.P1; }
void setP1(int P1) { CV_Assert(P1 > 0); params.P1 = P1; }
int getP1() const CV_OVERRIDE { return params.P1; }
void setP1(int P1) CV_OVERRIDE { CV_Assert(P1 > 0); params.P1 = P1; }
int getP2() const { return params.P2; }
void setP2(int P2) {CV_Assert(P2 > 0); CV_Assert(P2 >= 2 * params.P1); params.P2 = P2; }
int getP2() const CV_OVERRIDE { return params.P2; }
void setP2(int P2) CV_OVERRIDE {CV_Assert(P2 > 0); CV_Assert(P2 >= 2 * params.P1); params.P2 = P2; }
int getMode() const { return params.mode; }
void setMode(int mode) { params.mode = mode; }
int getMode() const CV_OVERRIDE { return params.mode; }
void setMode(int mode) CV_OVERRIDE { params.mode = mode; }
void write(FileStorage& fs) const
void write(FileStorage& fs) const CV_OVERRIDE
{
fs << "name" << name_
<< "minDisparity" << params.minDisparity
......@@ -775,7 +775,7 @@ namespace cv
<< "mode" << params.mode;
}
void read(const FileNode& fn)
void read(const FileNode& fn) CV_OVERRIDE
{
FileNode n = fn["name"];
CV_Assert( n.isString() && String(n) == name_ );
......
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