Commit 0aaaba08 authored by Alexander Alekhin's avatar Alexander Alekhin

optflow: apply CV_OVERRIDE/CV_FINAL

parent 4352e1ea
......@@ -117,8 +117,8 @@ public:
float _sparseRate = 0.024, float _retainedCornersFraction = 0.2,
float _occlusionsThreshold = 0.0003, float _dampingFactor = 0.00002, float _claheClip = 14 );
void calc( InputArray I0, InputArray I1, InputOutputArray flow );
void collectGarbage();
void calc( InputArray I0, InputArray I1, InputOutputArray flow ) CV_OVERRIDE;
void collectGarbage() CV_OVERRIDE;
private:
void findSparseFeatures( UMat &from, UMat &to, std::vector<Point2f> &features,
......
......@@ -182,9 +182,9 @@ private:
public:
void train( GPCTrainingSamples &samples, const GPCTrainingParams params = GPCTrainingParams() );
void write( FileStorage &fs ) const;
void write( FileStorage &fs ) const CV_OVERRIDE;
void read( const FileNode &fn );
void read( const FileNode &fn ) CV_OVERRIDE;
unsigned findLeafForPatch( const GPCPatchDescriptor &descr ) const;
......
......@@ -52,8 +52,8 @@ class OpticalFlowDeepFlow: public DenseOpticalFlow
public:
OpticalFlowDeepFlow();
void calc( InputArray I0, InputArray I1, InputOutputArray flow );
void collectGarbage();
void calc( InputArray I0, InputArray I1, InputOutputArray flow ) CV_OVERRIDE;
void collectGarbage() CV_OVERRIDE;
protected:
float sigma; // Gaussian smoothing parameter
......
......@@ -52,13 +52,13 @@ namespace cv
namespace optflow
{
class DISOpticalFlowImpl : public DISOpticalFlow
class DISOpticalFlowImpl CV_FINAL : public DISOpticalFlow
{
public:
DISOpticalFlowImpl();
void calc(InputArray I0, InputArray I1, InputOutputArray flow);
void collectGarbage();
void calc(InputArray I0, InputArray I1, InputOutputArray flow) CV_OVERRIDE;
void collectGarbage() CV_OVERRIDE;
protected: //!< algorithm parameters
int finest_scale, coarsest_scale;
......@@ -78,27 +78,27 @@ class DISOpticalFlowImpl : public DISOpticalFlow
int ws, hs; //!< sparse flow buffer width and height on the current scale
public:
int getFinestScale() const { return finest_scale; }
void setFinestScale(int val) { finest_scale = val; }
int getPatchSize() const { return patch_size; }
void setPatchSize(int val) { patch_size = val; }
int getPatchStride() const { return patch_stride; }
void setPatchStride(int val) { patch_stride = val; }
int getGradientDescentIterations() const { return grad_descent_iter; }
void setGradientDescentIterations(int val) { grad_descent_iter = val; }
int getVariationalRefinementIterations() const { return variational_refinement_iter; }
void setVariationalRefinementIterations(int val) { variational_refinement_iter = val; }
float getVariationalRefinementAlpha() const { return variational_refinement_alpha; }
void setVariationalRefinementAlpha(float val) { variational_refinement_alpha = val; }
float getVariationalRefinementDelta() const { return variational_refinement_delta; }
void setVariationalRefinementDelta(float val) { variational_refinement_delta = val; }
float getVariationalRefinementGamma() const { return variational_refinement_gamma; }
void setVariationalRefinementGamma(float val) { variational_refinement_gamma = val; }
bool getUseMeanNormalization() const { return use_mean_normalization; }
void setUseMeanNormalization(bool val) { use_mean_normalization = val; }
bool getUseSpatialPropagation() const { return use_spatial_propagation; }
void setUseSpatialPropagation(bool val) { use_spatial_propagation = val; }
int getFinestScale() const CV_OVERRIDE { return finest_scale; }
void setFinestScale(int val) CV_OVERRIDE { finest_scale = val; }
int getPatchSize() const CV_OVERRIDE { return patch_size; }
void setPatchSize(int val) CV_OVERRIDE { patch_size = val; }
int getPatchStride() const CV_OVERRIDE { return patch_stride; }
void setPatchStride(int val) CV_OVERRIDE { patch_stride = val; }
int getGradientDescentIterations() const CV_OVERRIDE { return grad_descent_iter; }
void setGradientDescentIterations(int val) CV_OVERRIDE { grad_descent_iter = val; }
int getVariationalRefinementIterations() const CV_OVERRIDE { return variational_refinement_iter; }
void setVariationalRefinementIterations(int val) CV_OVERRIDE { variational_refinement_iter = val; }
float getVariationalRefinementAlpha() const CV_OVERRIDE { return variational_refinement_alpha; }
void setVariationalRefinementAlpha(float val) CV_OVERRIDE { variational_refinement_alpha = val; }
float getVariationalRefinementDelta() const CV_OVERRIDE { return variational_refinement_delta; }
void setVariationalRefinementDelta(float val) CV_OVERRIDE { variational_refinement_delta = val; }
float getVariationalRefinementGamma() const CV_OVERRIDE { return variational_refinement_gamma; }
void setVariationalRefinementGamma(float val) CV_OVERRIDE { variational_refinement_gamma = val; }
bool getUseMeanNormalization() const CV_OVERRIDE { return use_mean_normalization; }
void setUseMeanNormalization(bool val) CV_OVERRIDE { use_mean_normalization = val; }
bool getUseSpatialPropagation() const CV_OVERRIDE { return use_spatial_propagation; }
void setUseSpatialPropagation(bool val) CV_OVERRIDE { use_spatial_propagation = val; }
protected: //!< internal buffers
vector<Mat_<uchar> > I0s; //!< Gaussian pyramid for the current frame
......@@ -153,7 +153,7 @@ class DISOpticalFlowImpl : public DISOpticalFlow
PatchInverseSearch_ParBody(DISOpticalFlowImpl &_dis, int _nstripes, int _hs, Mat &dst_Sx, Mat &dst_Sy,
Mat &src_Ux, Mat &src_Uy, Mat &_I0, Mat &_I1, Mat &_I0x, Mat &_I0y, int _num_iter,
int _pyr_level);
void operator()(const Range &range) const;
void operator()(const Range &range) const CV_OVERRIDE;
};
struct Densification_ParBody : public ParallelLoopBody
......@@ -165,7 +165,7 @@ class DISOpticalFlowImpl : public DISOpticalFlow
Densification_ParBody(DISOpticalFlowImpl &_dis, int _nstripes, int _h, Mat &dst_Ux, Mat &dst_Uy, Mat &src_Sx,
Mat &src_Sy, Mat &_I0, Mat &_I1);
void operator()(const Range &range) const;
void operator()(const Range &range) const CV_OVERRIDE;
};
#ifdef HAVE_OPENCL
......
......@@ -53,8 +53,8 @@ class OpticalFlowSimpleFlow : public DenseOpticalFlow
{
public:
OpticalFlowSimpleFlow();
void calc(InputArray I0, InputArray I1, InputOutputArray flow);
void collectGarbage();
void calc(InputArray I0, InputArray I1, InputOutputArray flow) CV_OVERRIDE;
void collectGarbage() CV_OVERRIDE;
protected:
int layers;
......@@ -125,8 +125,8 @@ class OpticalFlowFarneback : public DenseOpticalFlow
{
public:
OpticalFlowFarneback();
void calc(InputArray I0, InputArray I1, InputOutputArray flow);
void collectGarbage();
void calc(InputArray I0, InputArray I1, InputOutputArray flow) CV_OVERRIDE;
void collectGarbage() CV_OVERRIDE;
protected:
int numLevels;
double pyrScale;
......@@ -181,8 +181,8 @@ class OpticalFlowSparseToDense : public DenseOpticalFlow
{
public:
OpticalFlowSparseToDense(int _grid_step, int _k, float _sigma, bool _use_post_proc, float _fgs_lambda, float _fgs_sigma);
void calc(InputArray I0, InputArray I1, InputOutputArray flow);
void collectGarbage();
void calc(InputArray I0, InputArray I1, InputOutputArray flow) CV_OVERRIDE;
void collectGarbage() CV_OVERRIDE;
protected:
int grid_step;
int k;
......
......@@ -136,7 +136,7 @@ public:
CV_DbgAssert(joint.cols == src.cols && confidence.cols == src.cols && src.cols == dst.cols + 2 * radius);
}
void operator()(const Range &range) const {
void operator()(const Range &range) const CV_OVERRIDE {
const int d = 2*radius +1;
for (int i = range.start; i < range.end; i++) {
SrcVec* dstRow = dst.ptr<SrcVec>(i);
......@@ -296,7 +296,7 @@ public:
CV_DbgAssert(prev.cols == next.cols && next.cols == dst.cols + 2 * radius);
}
void operator()(const Range &range) const {
void operator()(const Range &range) const CV_OVERRIDE {
int d = 2 * radius + 1;
Mat weights(d, d, CV_32F);
for (int i = range.start; i < range.end; i++) {
......
......@@ -249,7 +249,7 @@ public:
ParallelDCTFiller( const Size &_sz, const Mat *_imgCh, std::vector< GPCPatchDescriptor > *_descr )
: sz( _sz ), imgCh( _imgCh ), descr( _descr ){};
void operator()( const Range &range ) const
void operator()( const Range &range ) const CV_OVERRIDE
{
for ( int i = range.start; i < range.end; ++i )
{
......@@ -312,7 +312,7 @@ public:
ParallelWHTFiller( const Size &_sz, const Mat *_imgChInt, std::vector< GPCPatchDescriptor > *_descr )
: sz( _sz ), imgChInt( _imgChInt ), descr( _descr ){};
void operator()( const Range &range ) const
void operator()( const Range &range ) const CV_OVERRIDE
{
for ( int i = range.start; i < range.end; ++i )
{
......
......@@ -49,14 +49,14 @@ namespace cv
namespace optflow
{
class VariationalRefinementImpl : public VariationalRefinement
class VariationalRefinementImpl CV_FINAL : public VariationalRefinement
{
public:
VariationalRefinementImpl();
void calc(InputArray I0, InputArray I1, InputOutputArray flow);
void calcUV(InputArray I0, InputArray I1, InputOutputArray flow_u, InputOutputArray flow_v);
void collectGarbage();
void calc(InputArray I0, InputArray I1, InputOutputArray flow) CV_OVERRIDE;
void calcUV(InputArray I0, InputArray I1, InputOutputArray flow_u, InputOutputArray flow_v) CV_OVERRIDE;
void collectGarbage() CV_OVERRIDE;
protected: //!< algorithm parameters
int fixedPointIterations, sorIterations;
......@@ -65,18 +65,18 @@ class VariationalRefinementImpl : public VariationalRefinement
float zeta, epsilon;
public:
int getFixedPointIterations() const { return fixedPointIterations; }
void setFixedPointIterations(int val) { fixedPointIterations = val; }
int getSorIterations() const { return sorIterations; }
void setSorIterations(int val) { sorIterations = val; }
float getOmega() const { return omega; }
void setOmega(float val) { omega = val; }
float getAlpha() const { return alpha; }
void setAlpha(float val) { alpha = val; }
float getDelta() const { return delta; }
void setDelta(float val) { delta = val; }
float getGamma() const { return gamma; }
void setGamma(float val) { gamma = val; }
int getFixedPointIterations() const CV_OVERRIDE { return fixedPointIterations; }
void setFixedPointIterations(int val) CV_OVERRIDE { fixedPointIterations = val; }
int getSorIterations() const CV_OVERRIDE { return sorIterations; }
void setSorIterations(int val) CV_OVERRIDE { sorIterations = val; }
float getOmega() const CV_OVERRIDE { return omega; }
void setOmega(float val) CV_OVERRIDE { omega = val; }
float getAlpha() const CV_OVERRIDE { return alpha; }
void setAlpha(float val) CV_OVERRIDE { alpha = val; }
float getDelta() const CV_OVERRIDE { return delta; }
void setDelta(float val) CV_OVERRIDE { delta = val; }
float getGamma() const CV_OVERRIDE { return gamma; }
void setGamma(float val) CV_OVERRIDE { gamma = val; }
protected: //!< internal buffers
/* This struct defines a special data layout for Mat_<float>. Original buffer is split into two: one for "red"
......@@ -129,7 +129,7 @@ class VariationalRefinementImpl : public VariationalRefinement
ParallelOp_ParBody(VariationalRefinementImpl &_var, vector<Op> _ops, vector<void *> &_op1s,
vector<void *> &_op2s, vector<void *> &_op3s);
void operator()(const Range &range) const;
void operator()(const Range &range) const CV_OVERRIDE;
};
void gradHorizAndSplitOp(void *src, void *dst, void *dst_split)
{
......@@ -160,7 +160,7 @@ class VariationalRefinementImpl : public VariationalRefinement
ComputeDataTerm_ParBody(VariationalRefinementImpl &_var, int _nstripes, int _h, RedBlackBuffer &_dW_u,
RedBlackBuffer &_dW_v, bool _red_pass);
void operator()(const Range &range) const;
void operator()(const Range &range) const CV_OVERRIDE;
};
struct ComputeSmoothnessTermHorPass_ParBody : public ParallelLoopBody
......@@ -174,7 +174,7 @@ class VariationalRefinementImpl : public VariationalRefinement
ComputeSmoothnessTermHorPass_ParBody(VariationalRefinementImpl &_var, int _nstripes, int _h,
RedBlackBuffer &_W_u, RedBlackBuffer &_W_v, RedBlackBuffer &_tempW_u,
RedBlackBuffer &_tempW_v, bool _red_pass);
void operator()(const Range &range) const;
void operator()(const Range &range) const CV_OVERRIDE;
};
struct ComputeSmoothnessTermVertPass_ParBody : public ParallelLoopBody
......@@ -187,7 +187,7 @@ class VariationalRefinementImpl : public VariationalRefinement
ComputeSmoothnessTermVertPass_ParBody(VariationalRefinementImpl &_var, int _nstripes, int _h,
RedBlackBuffer &W_u, RedBlackBuffer &_W_v, bool _red_pass);
void operator()(const Range &range) const;
void operator()(const Range &range) const CV_OVERRIDE;
};
struct RedBlackSOR_ParBody : public ParallelLoopBody
......@@ -200,7 +200,7 @@ class VariationalRefinementImpl : public VariationalRefinement
RedBlackSOR_ParBody(VariationalRefinementImpl &_var, int _nstripes, int _h, RedBlackBuffer &_dW_u,
RedBlackBuffer &_dW_v, bool _red_pass);
void operator()(const Range &range) const;
void operator()(const Range &range) const CV_OVERRIDE;
};
};
......
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