Commit a8eb3e1b authored by Alexander Alekhin's avatar Alexander Alekhin

superres: apply CV_OVERRIDE/CV_FINAL

parent 4a0fa576
...@@ -97,8 +97,8 @@ namespace cv ...@@ -97,8 +97,8 @@ namespace cv
@param frame Output result @param frame Output result
*/ */
void nextFrame(OutputArray frame); void nextFrame(OutputArray frame) CV_OVERRIDE;
void reset(); void reset() CV_OVERRIDE;
/** @brief Clear all inner buffers. /** @brief Clear all inner buffers.
*/ */
......
...@@ -363,7 +363,7 @@ namespace ...@@ -363,7 +363,7 @@ namespace
template <typename T> template <typename T>
struct BtvRegularizationBody : ParallelLoopBody struct BtvRegularizationBody : ParallelLoopBody
{ {
void operator ()(const Range& range) const; void operator ()(const Range& range) const CV_OVERRIDE;
Mat src; Mat src;
mutable Mat dst; mutable Mat dst;
...@@ -470,18 +470,28 @@ namespace ...@@ -470,18 +470,28 @@ namespace
void process(InputArrayOfArrays src, OutputArray dst, InputArrayOfArrays forwardMotions, void process(InputArrayOfArrays src, OutputArray dst, InputArrayOfArrays forwardMotions,
InputArrayOfArrays backwardMotions, int baseIdx); InputArrayOfArrays backwardMotions, int baseIdx);
void collectGarbage(); void collectGarbage() CV_OVERRIDE;
CV_IMPL_PROPERTY(int, Scale, scale_) inline int getScale() const CV_OVERRIDE { return scale_; }
CV_IMPL_PROPERTY(int, Iterations, iterations_) inline void setScale(int val) CV_OVERRIDE { scale_ = val; }
CV_IMPL_PROPERTY(double, Tau, tau_) inline int getIterations() const CV_OVERRIDE { return iterations_; }
CV_IMPL_PROPERTY(double, Labmda, lambda_) inline void setIterations(int val) CV_OVERRIDE { iterations_ = val; }
CV_IMPL_PROPERTY(double, Alpha, alpha_) inline double getTau() const CV_OVERRIDE { return tau_; }
CV_IMPL_PROPERTY(int, KernelSize, btvKernelSize_) inline void setTau(double val) CV_OVERRIDE { tau_ = val; }
CV_IMPL_PROPERTY(int, BlurKernelSize, blurKernelSize_) inline double getLabmda() const CV_OVERRIDE { return lambda_; }
CV_IMPL_PROPERTY(double, BlurSigma, blurSigma_) inline void setLabmda(double val) CV_OVERRIDE { lambda_ = val; }
CV_IMPL_PROPERTY(int, TemporalAreaRadius, temporalAreaRadius_) inline double getAlpha() const CV_OVERRIDE { return alpha_; }
CV_IMPL_PROPERTY_S(Ptr<cv::superres::DenseOpticalFlowExt>, OpticalFlow, opticalFlow_) inline void setAlpha(double val) CV_OVERRIDE { alpha_ = val; }
inline int getKernelSize() const CV_OVERRIDE { return btvKernelSize_; }
inline void setKernelSize(int val) CV_OVERRIDE { btvKernelSize_ = val; }
inline int getBlurKernelSize() const CV_OVERRIDE { return blurKernelSize_; }
inline void setBlurKernelSize(int val) CV_OVERRIDE { blurKernelSize_ = val; }
inline double getBlurSigma() const CV_OVERRIDE { return blurSigma_; }
inline void setBlurSigma(double val) CV_OVERRIDE { blurSigma_ = val; }
inline int getTemporalAreaRadius() const CV_OVERRIDE { return temporalAreaRadius_; }
inline void setTemporalAreaRadius(int val) CV_OVERRIDE { temporalAreaRadius_ = val; }
inline Ptr<cv::superres::DenseOpticalFlowExt> getOpticalFlow() const CV_OVERRIDE { return opticalFlow_; }
inline void setOpticalFlow(const Ptr<cv::superres::DenseOpticalFlowExt>& val) CV_OVERRIDE { opticalFlow_ = val; }
protected: protected:
int scale_; int scale_;
...@@ -798,18 +808,18 @@ namespace ...@@ -798,18 +808,18 @@ namespace
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
class BTVL1 : public BTVL1_Base class BTVL1 CV_FINAL : public BTVL1_Base
{ {
public: public:
BTVL1(); BTVL1();
void collectGarbage(); void collectGarbage() CV_OVERRIDE;
protected: protected:
void initImpl(Ptr<FrameSource>& frameSource); void initImpl(Ptr<FrameSource>& frameSource) CV_OVERRIDE;
bool ocl_initImpl(Ptr<FrameSource>& frameSource); bool ocl_initImpl(Ptr<FrameSource>& frameSource);
void processImpl(Ptr<FrameSource>& frameSource, OutputArray output); void processImpl(Ptr<FrameSource>& frameSource, OutputArray output) CV_OVERRIDE;
bool ocl_processImpl(Ptr<FrameSource>& frameSource, OutputArray output); bool ocl_processImpl(Ptr<FrameSource>& frameSource, OutputArray output);
private: private:
......
...@@ -218,16 +218,26 @@ namespace ...@@ -218,16 +218,26 @@ namespace
void collectGarbage(); void collectGarbage();
CV_IMPL_PROPERTY(int, Scale, scale_) inline int getScale() const CV_OVERRIDE { return scale_; }
CV_IMPL_PROPERTY(int, Iterations, iterations_) inline void setScale(int val) CV_OVERRIDE { scale_ = val; }
CV_IMPL_PROPERTY(double, Tau, tau_) inline int getIterations() const CV_OVERRIDE { return iterations_; }
CV_IMPL_PROPERTY(double, Labmda, lambda_) inline void setIterations(int val) CV_OVERRIDE { iterations_ = val; }
CV_IMPL_PROPERTY(double, Alpha, alpha_) inline double getTau() const CV_OVERRIDE { return tau_; }
CV_IMPL_PROPERTY(int, KernelSize, btvKernelSize_) inline void setTau(double val) CV_OVERRIDE { tau_ = val; }
CV_IMPL_PROPERTY(int, BlurKernelSize, blurKernelSize_) inline double getLabmda() const CV_OVERRIDE { return lambda_; }
CV_IMPL_PROPERTY(double, BlurSigma, blurSigma_) inline void setLabmda(double val) CV_OVERRIDE { lambda_ = val; }
CV_IMPL_PROPERTY(int, TemporalAreaRadius, temporalAreaRadius_) inline double getAlpha() const CV_OVERRIDE { return alpha_; }
CV_IMPL_PROPERTY_S(Ptr<cv::superres::DenseOpticalFlowExt>, OpticalFlow, opticalFlow_) inline void setAlpha(double val) CV_OVERRIDE { alpha_ = val; }
inline int getKernelSize() const CV_OVERRIDE { return btvKernelSize_; }
inline void setKernelSize(int val) CV_OVERRIDE { btvKernelSize_ = val; }
inline int getBlurKernelSize() const CV_OVERRIDE { return blurKernelSize_; }
inline void setBlurKernelSize(int val) CV_OVERRIDE { blurKernelSize_ = val; }
inline double getBlurSigma() const CV_OVERRIDE { return blurSigma_; }
inline void setBlurSigma(double val) CV_OVERRIDE { blurSigma_ = val; }
inline int getTemporalAreaRadius() const CV_OVERRIDE { return temporalAreaRadius_; }
inline void setTemporalAreaRadius(int val) CV_OVERRIDE { temporalAreaRadius_ = val; }
inline Ptr<cv::superres::DenseOpticalFlowExt> getOpticalFlow() const CV_OVERRIDE { return opticalFlow_; }
inline void setOpticalFlow(const Ptr<cv::superres::DenseOpticalFlowExt>& val) CV_OVERRIDE { opticalFlow_ = val; }
protected: protected:
int scale_; int scale_;
......
...@@ -58,8 +58,8 @@ namespace ...@@ -58,8 +58,8 @@ namespace
class EmptyFrameSource : public FrameSource class EmptyFrameSource : public FrameSource
{ {
public: public:
void nextFrame(OutputArray frame); void nextFrame(OutputArray frame) CV_OVERRIDE;
void reset(); void reset() CV_OVERRIDE;
}; };
void EmptyFrameSource::nextFrame(OutputArray frame) void EmptyFrameSource::nextFrame(OutputArray frame)
...@@ -103,7 +103,7 @@ namespace ...@@ -103,7 +103,7 @@ namespace
class CaptureFrameSource : public FrameSource class CaptureFrameSource : public FrameSource
{ {
public: public:
void nextFrame(OutputArray frame); void nextFrame(OutputArray frame) CV_OVERRIDE;
protected: protected:
VideoCapture vc_; VideoCapture vc_;
...@@ -135,7 +135,7 @@ namespace ...@@ -135,7 +135,7 @@ namespace
public: public:
VideoFrameSource(const String& fileName); VideoFrameSource(const String& fileName);
void reset(); void reset() CV_OVERRIDE;
private: private:
String fileName_; String fileName_;
...@@ -158,7 +158,7 @@ namespace ...@@ -158,7 +158,7 @@ namespace
public: public:
CameraFrameSource(int deviceId); CameraFrameSource(int deviceId);
void reset(); void reset() CV_OVERRIDE;
private: private:
int deviceId_; int deviceId_;
......
...@@ -58,8 +58,8 @@ namespace ...@@ -58,8 +58,8 @@ namespace
public: public:
explicit CpuOpticalFlow(int work_type); explicit CpuOpticalFlow(int work_type);
void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2); void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2) CV_OVERRIDE;
void collectGarbage(); void collectGarbage() CV_OVERRIDE;
protected: protected:
virtual void impl(InputArray input0, InputArray input1, OutputArray dst) = 0; virtual void impl(InputArray input0, InputArray input1, OutputArray dst) = 0;
...@@ -179,23 +179,30 @@ namespace ...@@ -179,23 +179,30 @@ namespace
namespace namespace
{ {
class Farneback : public CpuOpticalFlow, public cv::superres::FarnebackOpticalFlow class Farneback CV_FINAL : public CpuOpticalFlow, public cv::superres::FarnebackOpticalFlow
{ {
public: public:
Farneback(); Farneback();
void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2); void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2) CV_OVERRIDE;
void collectGarbage(); void collectGarbage() CV_OVERRIDE;
CV_IMPL_PROPERTY(double, PyrScale, pyrScale_) inline double getPyrScale() const CV_OVERRIDE { return pyrScale_; }
CV_IMPL_PROPERTY(int, LevelsNumber, numLevels_) inline void setPyrScale(double val) CV_OVERRIDE { pyrScale_ = val; }
CV_IMPL_PROPERTY(int, WindowSize, winSize_) inline int getLevelsNumber() const CV_OVERRIDE { return numLevels_; }
CV_IMPL_PROPERTY(int, Iterations, numIters_) inline void setLevelsNumber(int val) CV_OVERRIDE { numLevels_ = val; }
CV_IMPL_PROPERTY(int, PolyN, polyN_) inline int getWindowSize() const CV_OVERRIDE { return winSize_; }
CV_IMPL_PROPERTY(double, PolySigma, polySigma_) inline void setWindowSize(int val) CV_OVERRIDE { winSize_ = val; }
CV_IMPL_PROPERTY(int, Flags, flags_) inline int getIterations() const CV_OVERRIDE { return numIters_; }
inline void setIterations(int val) CV_OVERRIDE { numIters_ = val; }
inline int getPolyN() const CV_OVERRIDE { return polyN_; }
inline void setPolyN(int val) CV_OVERRIDE { polyN_ = val; }
inline double getPolySigma() const CV_OVERRIDE { return polySigma_; }
inline void setPolySigma(double val) CV_OVERRIDE { polySigma_ = val; }
inline int getFlags() const CV_OVERRIDE { return flags_; }
inline void setFlags(int val) CV_OVERRIDE { flags_ = val; }
protected: protected:
void impl(InputArray input0, InputArray input1, OutputArray dst); void impl(InputArray input0, InputArray input1, OutputArray dst) CV_OVERRIDE;
private: private:
double pyrScale_; double pyrScale_;
...@@ -336,24 +343,32 @@ Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_Simple() ...@@ -336,24 +343,32 @@ Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_Simple()
namespace namespace
{ {
class DualTVL1 : public CpuOpticalFlow, public virtual cv::superres::DualTVL1OpticalFlow class DualTVL1 CV_FINAL : public CpuOpticalFlow, public virtual cv::superres::DualTVL1OpticalFlow
{ {
public: public:
DualTVL1(); DualTVL1();
void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2); void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2) CV_OVERRIDE;
void collectGarbage(); void collectGarbage() CV_OVERRIDE;
CV_WRAP_SAME_PROPERTY(double, Tau, (*alg_)) inline double getTau() const CV_OVERRIDE { return (*alg_).getTau(); }
CV_WRAP_SAME_PROPERTY(double, Lambda, (*alg_)) inline void setTau(double val) CV_OVERRIDE { (*alg_).setTau(val); }
CV_WRAP_SAME_PROPERTY(double, Theta, (*alg_)) inline double getLambda() const CV_OVERRIDE { return (*alg_).getLambda(); }
CV_WRAP_SAME_PROPERTY(int, ScalesNumber, (*alg_)) inline void setLambda(double val) CV_OVERRIDE { (*alg_).setLambda(val); }
CV_WRAP_SAME_PROPERTY(int, WarpingsNumber, (*alg_)) inline double getTheta() const CV_OVERRIDE { return (*alg_).getTheta(); }
CV_WRAP_SAME_PROPERTY(double, Epsilon, (*alg_)) inline void setTheta(double val) CV_OVERRIDE { (*alg_).setTheta(val); }
CV_WRAP_PROPERTY(int, Iterations, OuterIterations, (*alg_)) inline int getScalesNumber() const CV_OVERRIDE { return (*alg_).getScalesNumber(); }
CV_WRAP_SAME_PROPERTY(bool, UseInitialFlow, (*alg_)) inline void setScalesNumber(int val) CV_OVERRIDE { (*alg_).setScalesNumber(val); }
inline int getWarpingsNumber() const CV_OVERRIDE { return (*alg_).getWarpingsNumber(); }
inline void setWarpingsNumber(int val) CV_OVERRIDE { (*alg_).setWarpingsNumber(val); }
inline double getEpsilon() const CV_OVERRIDE { return (*alg_).getEpsilon(); }
inline void setEpsilon(double val) CV_OVERRIDE { (*alg_).setEpsilon(val); }
inline int getIterations() const CV_OVERRIDE { return (*alg_).getOuterIterations(); }
inline void setIterations(int val) CV_OVERRIDE { (*alg_).setOuterIterations(val); }
inline bool getUseInitialFlow() const CV_OVERRIDE { return (*alg_).getUseInitialFlow(); }
inline void setUseInitialFlow(bool val) CV_OVERRIDE { (*alg_).setUseInitialFlow(val); }
protected: protected:
void impl(InputArray input0, InputArray input1, OutputArray dst); void impl(InputArray input0, InputArray input1, OutputArray dst) CV_OVERRIDE;
private: private:
Ptr<cv::DualTVL1OpticalFlow> alg_; Ptr<cv::DualTVL1OpticalFlow> alg_;
...@@ -498,12 +513,18 @@ namespace ...@@ -498,12 +513,18 @@ namespace
void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2); void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2);
void collectGarbage(); void collectGarbage();
CV_IMPL_PROPERTY(double, Alpha, alpha_) inline double getAlpha() const CV_OVERRIDE { return alpha_; }
CV_IMPL_PROPERTY(double, Gamma, gamma_) inline void setAlpha(double val) CV_OVERRIDE { alpha_ = val; }
CV_IMPL_PROPERTY(double, ScaleFactor, scaleFactor_) inline double getGamma() const CV_OVERRIDE { return gamma_; }
CV_IMPL_PROPERTY(int, InnerIterations, innerIterations_) inline void setGamma(double val) CV_OVERRIDE { gamma_ = val; }
CV_IMPL_PROPERTY(int, OuterIterations, outerIterations_) inline double getScaleFactor() const CV_OVERRIDE { return scaleFactor_; }
CV_IMPL_PROPERTY(int, SolverIterations, solverIterations_) inline void setScaleFactor(double val) CV_OVERRIDE { scaleFactor_ = val; }
inline int getInnerIterations() const CV_OVERRIDE { return innerIterations_; }
inline void setInnerIterations(int val) CV_OVERRIDE { innerIterations_ = val; }
inline int getOuterIterations() const CV_OVERRIDE { return outerIterations_; }
inline void setOuterIterations(int val) CV_OVERRIDE { outerIterations_ = val; }
inline int getSolverIterations() const CV_OVERRIDE { return solverIterations_; }
inline void setSolverIterations(int val) CV_OVERRIDE { solverIterations_ = val; }
protected: protected:
void impl(const GpuMat& input0, const GpuMat& input1, GpuMat& dst1, GpuMat& dst2); void impl(const GpuMat& input0, const GpuMat& input1, GpuMat& dst1, GpuMat& dst2);
...@@ -579,9 +600,12 @@ namespace ...@@ -579,9 +600,12 @@ namespace
void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2); void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2);
void collectGarbage(); void collectGarbage();
CV_IMPL_PROPERTY(int, WindowSize, winSize_) inline int getWindowSize() const CV_OVERRIDE { return winSize_; }
CV_IMPL_PROPERTY(int, MaxLevel, maxLevel_) inline void setWindowSize(int val) CV_OVERRIDE { winSize_ = val; }
CV_IMPL_PROPERTY(int, Iterations, iterations_) inline int getMaxLevel() const CV_OVERRIDE { return maxLevel_; }
inline void setMaxLevel(int val) CV_OVERRIDE { maxLevel_ = val; }
inline int getIterations() const CV_OVERRIDE { return iterations_; }
inline void setIterations(int val) CV_OVERRIDE { iterations_ = val; }
protected: protected:
void impl(const GpuMat& input0, const GpuMat& input1, GpuMat& dst1, GpuMat& dst2); void impl(const GpuMat& input0, const GpuMat& input1, GpuMat& dst1, GpuMat& dst2);
...@@ -648,13 +672,20 @@ namespace ...@@ -648,13 +672,20 @@ namespace
void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2); void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2);
void collectGarbage(); void collectGarbage();
CV_IMPL_PROPERTY(double, PyrScale, pyrScale_) inline double getPyrScale() const CV_OVERRIDE { return pyrScale_; }
CV_IMPL_PROPERTY(int, LevelsNumber, numLevels_) inline void setPyrScale(double val) CV_OVERRIDE { pyrScale_ = val; }
CV_IMPL_PROPERTY(int, WindowSize, winSize_) inline int getLevelsNumber() const CV_OVERRIDE { return numLevels_; }
CV_IMPL_PROPERTY(int, Iterations, numIters_) inline void setLevelsNumber(int val) CV_OVERRIDE { numLevels_ = val; }
CV_IMPL_PROPERTY(int, PolyN, polyN_) inline int getWindowSize() const CV_OVERRIDE { return winSize_; }
CV_IMPL_PROPERTY(double, PolySigma, polySigma_) inline void setWindowSize(int val) CV_OVERRIDE { winSize_ = val; }
CV_IMPL_PROPERTY(int, Flags, flags_) inline int getIterations() const CV_OVERRIDE { return numIters_; }
inline void setIterations(int val) CV_OVERRIDE { numIters_ = val; }
inline int getPolyN() const CV_OVERRIDE { return polyN_; }
inline void setPolyN(int val) CV_OVERRIDE { polyN_ = val; }
inline double getPolySigma() const CV_OVERRIDE { return polySigma_; }
inline void setPolySigma(double val) CV_OVERRIDE { polySigma_ = val; }
inline int getFlags() const CV_OVERRIDE { return flags_; }
inline void setFlags(int val) CV_OVERRIDE { flags_ = val; }
protected: protected:
void impl(const GpuMat& input0, const GpuMat& input1, GpuMat& dst1, GpuMat& dst2); void impl(const GpuMat& input0, const GpuMat& input1, GpuMat& dst1, GpuMat& dst2);
...@@ -733,14 +764,22 @@ namespace ...@@ -733,14 +764,22 @@ namespace
void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2); void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2);
void collectGarbage(); void collectGarbage();
CV_IMPL_PROPERTY(double, Tau, tau_) inline double getTau() const CV_OVERRIDE { return tau_; }
CV_IMPL_PROPERTY(double, Lambda, lambda_) inline void setTau(double val) CV_OVERRIDE { tau_ = val; }
CV_IMPL_PROPERTY(double, Theta, theta_) inline double getLambda() const CV_OVERRIDE { return lambda_; }
CV_IMPL_PROPERTY(int, ScalesNumber, nscales_) inline void setLambda(double val) CV_OVERRIDE { lambda_ = val; }
CV_IMPL_PROPERTY(int, WarpingsNumber, warps_) inline double getTheta() const CV_OVERRIDE { return theta_; }
CV_IMPL_PROPERTY(double, Epsilon, epsilon_) inline void setTheta(double val) CV_OVERRIDE { theta_ = val; }
CV_IMPL_PROPERTY(int, Iterations, iterations_) inline int getScalesNumber() const CV_OVERRIDE { return nscales_; }
CV_IMPL_PROPERTY(bool, UseInitialFlow, useInitialFlow_) inline void setScalesNumber(int val) CV_OVERRIDE { nscales_ = val; }
inline int getWarpingsNumber() const CV_OVERRIDE { return warps_; }
inline void setWarpingsNumber(int val) CV_OVERRIDE { warps_ = val; }
inline double getEpsilon() const CV_OVERRIDE { return epsilon_; }
inline void setEpsilon(double val) CV_OVERRIDE { epsilon_ = val; }
inline int getIterations() const CV_OVERRIDE { return iterations_; }
inline void setIterations(int val) CV_OVERRIDE { iterations_ = val; }
inline bool getUseInitialFlow() const CV_OVERRIDE { return useInitialFlow_; }
inline void setUseInitialFlow(bool val) CV_OVERRIDE { useInitialFlow_ = val; }
protected: protected:
void impl(const GpuMat& input0, const GpuMat& input1, GpuMat& dst1, GpuMat& dst2); void impl(const GpuMat& input0, const GpuMat& input1, GpuMat& dst1, GpuMat& dst2);
......
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