Commit 7335a40a authored by Maksim Shabunin's avatar Maksim Shabunin

Replaced CV_PURE_PROPERTY macros with corresponding code

parent e12a04ac
...@@ -243,11 +243,7 @@ PREDEFINED = __cplusplus=1 \ ...@@ -243,11 +243,7 @@ PREDEFINED = __cplusplus=1 \
CV_NORETURN= \ CV_NORETURN= \
CV_DEFAULT(x)=" = x" \ CV_DEFAULT(x)=" = x" \
CV_NEON=1 \ CV_NEON=1 \
FLANN_DEPRECATED= \ FLANN_DEPRECATED=
"CV_PURE_PROPERTY(type, name)= /** \@see set##name */ virtual type get##name() const = 0; /** \@copybrief get##name \@see get##name */ virtual void set##name(type val) = 0;" \
"CV_IMPL_PROPERTY(type, name, x)= /** \@see set##name */ virtual type get##name() const = 0; /** \@copybrief get##name \@see get##name */ virtual void set##name(type val) = 0;" \
"CV_IMPL_PROPERTY_S(type, name, x)= /** \@see set##name */ virtual type get##name() const = 0; /** \@copybrief get##name \@see get##name */ virtual void set##name(const type & val);" \
"CV_IMPL_PROPERTY_RO(type, name, x)= virtual type get##name() const;"
EXPAND_AS_DEFINED = EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES SKIP_FUNCTION_MACROS = YES
TAGFILES = TAGFILES =
......
...@@ -2821,19 +2821,6 @@ public: ...@@ -2821,19 +2821,6 @@ public:
virtual void read(const FileNode& fn) { (void)fn; } virtual void read(const FileNode& fn) { (void)fn; }
}; };
// define properties
#define CV_PURE_PROPERTY(type, name) \
CV_WRAP virtual type get##name() const = 0; \
CV_WRAP virtual void set##name(type val) = 0;
#define CV_PURE_PROPERTY_S(type, name) \
CV_WRAP virtual type get##name() const = 0; \
CV_WRAP virtual void set##name(const type & val) = 0;
#define CV_PURE_PROPERTY_RO(type, name) \
CV_WRAP virtual type get##name() const = 0;
// basic property implementation // basic property implementation
#define CV_IMPL_PROPERTY_RO(type, name, member) \ #define CV_IMPL_PROPERTY_RO(type, name, member) \
......
This diff is collapsed.
...@@ -105,34 +105,64 @@ namespace cv ...@@ -105,34 +105,64 @@ namespace cv
virtual void collectGarbage(); virtual void collectGarbage();
//! @brief Scale factor //! @brief Scale factor
CV_PURE_PROPERTY(int, Scale) /** @see setScale */
virtual int getScale() const = 0;
/** @copybrief getScale @see getScale */
virtual void setScale(int val) = 0;
//! @brief Iterations count //! @brief Iterations count
CV_PURE_PROPERTY(int, Iterations) /** @see setIterations */
virtual int getIterations() const = 0;
/** @copybrief getIterations @see getIterations */
virtual void setIterations(int val) = 0;
//! @brief Asymptotic value of steepest descent method //! @brief Asymptotic value of steepest descent method
CV_PURE_PROPERTY(double, Tau) /** @see setTau */
virtual double getTau() const = 0;
/** @copybrief getTau @see getTau */
virtual void setTau(double val) = 0;
//! @brief Weight parameter to balance data term and smoothness term //! @brief Weight parameter to balance data term and smoothness term
CV_PURE_PROPERTY(double, Labmda) /** @see setLabmda */
virtual double getLabmda() const = 0;
/** @copybrief getLabmda @see getLabmda */
virtual void setLabmda(double val) = 0;
//! @brief Parameter of spacial distribution in Bilateral-TV //! @brief Parameter of spacial distribution in Bilateral-TV
CV_PURE_PROPERTY(double, Alpha) /** @see setAlpha */
virtual double getAlpha() const = 0;
/** @copybrief getAlpha @see getAlpha */
virtual void setAlpha(double val) = 0;
//! @brief Kernel size of Bilateral-TV filter //! @brief Kernel size of Bilateral-TV filter
CV_PURE_PROPERTY(int, KernelSize) /** @see setKernelSize */
virtual int getKernelSize() const = 0;
/** @copybrief getKernelSize @see getKernelSize */
virtual void setKernelSize(int val) = 0;
//! @brief Gaussian blur kernel size //! @brief Gaussian blur kernel size
CV_PURE_PROPERTY(int, BlurKernelSize) /** @see setBlurKernelSize */
virtual int getBlurKernelSize() const = 0;
/** @copybrief getBlurKernelSize @see getBlurKernelSize */
virtual void setBlurKernelSize(int val) = 0;
//! @brief Gaussian blur sigma //! @brief Gaussian blur sigma
CV_PURE_PROPERTY(double, BlurSigma) /** @see setBlurSigma */
virtual double getBlurSigma() const = 0;
/** @copybrief getBlurSigma @see getBlurSigma */
virtual void setBlurSigma(double val) = 0;
//! @brief Radius of the temporal search area //! @brief Radius of the temporal search area
CV_PURE_PROPERTY(int, TemporalAreaRadius) /** @see setTemporalAreaRadius */
virtual int getTemporalAreaRadius() const = 0;
/** @copybrief getTemporalAreaRadius @see getTemporalAreaRadius */
virtual void setTemporalAreaRadius(int val) = 0;
//! @brief Dense optical flow algorithm //! @brief Dense optical flow algorithm
CV_PURE_PROPERTY_S(Ptr<cv::superres::DenseOpticalFlowExt>, OpticalFlow) /** @see setOpticalFlow */
virtual Ptr<cv::superres::DenseOpticalFlowExt> getOpticalFlow() const = 0;
/** @copybrief getOpticalFlow @see getOpticalFlow */
virtual void setOpticalFlow(const Ptr<cv::superres::DenseOpticalFlowExt> &val) = 0;
protected: protected:
SuperResolution(); SuperResolution();
......
...@@ -64,13 +64,34 @@ namespace cv ...@@ -64,13 +64,34 @@ namespace cv
class CV_EXPORTS FarnebackOpticalFlow : public virtual DenseOpticalFlowExt class CV_EXPORTS FarnebackOpticalFlow : public virtual DenseOpticalFlowExt
{ {
public: public:
CV_PURE_PROPERTY(double, PyrScale) /** @see setPyrScale */
CV_PURE_PROPERTY(int, LevelsNumber) virtual double getPyrScale() const = 0;
CV_PURE_PROPERTY(int, WindowSize) /** @copybrief getPyrScale @see getPyrScale */
CV_PURE_PROPERTY(int, Iterations) virtual void setPyrScale(double val) = 0;
CV_PURE_PROPERTY(int, PolyN) /** @see setLevelsNumber */
CV_PURE_PROPERTY(double, PolySigma) virtual int getLevelsNumber() const = 0;
CV_PURE_PROPERTY(int, Flags) /** @copybrief getLevelsNumber @see getLevelsNumber */
virtual void setLevelsNumber(int val) = 0;
/** @see setWindowSize */
virtual int getWindowSize() const = 0;
/** @copybrief getWindowSize @see getWindowSize */
virtual void setWindowSize(int val) = 0;
/** @see setIterations */
virtual int getIterations() const = 0;
/** @copybrief getIterations @see getIterations */
virtual void setIterations(int val) = 0;
/** @see setPolyN */
virtual int getPolyN() const = 0;
/** @copybrief getPolyN @see getPolyN */
virtual void setPolyN(int val) = 0;
/** @see setPolySigma */
virtual double getPolySigma() const = 0;
/** @copybrief getPolySigma @see getPolySigma */
virtual void setPolySigma(double val) = 0;
/** @see setFlags */
virtual int getFlags() const = 0;
/** @copybrief getFlags @see getFlags */
virtual void setFlags(int val) = 0;
}; };
CV_EXPORTS Ptr<FarnebackOpticalFlow> createOptFlow_Farneback(); CV_EXPORTS Ptr<FarnebackOpticalFlow> createOptFlow_Farneback();
CV_EXPORTS Ptr<FarnebackOpticalFlow> createOptFlow_Farneback_CUDA(); CV_EXPORTS Ptr<FarnebackOpticalFlow> createOptFlow_Farneback_CUDA();
...@@ -82,14 +103,38 @@ namespace cv ...@@ -82,14 +103,38 @@ namespace cv
class CV_EXPORTS DualTVL1OpticalFlow : public virtual DenseOpticalFlowExt class CV_EXPORTS DualTVL1OpticalFlow : public virtual DenseOpticalFlowExt
{ {
public: public:
CV_PURE_PROPERTY(double, Tau) /** @see setTau */
CV_PURE_PROPERTY(double, Lambda) virtual double getTau() const = 0;
CV_PURE_PROPERTY(double, Theta) /** @copybrief getTau @see getTau */
CV_PURE_PROPERTY(int, ScalesNumber) virtual void setTau(double val) = 0;
CV_PURE_PROPERTY(int, WarpingsNumber) /** @see setLambda */
CV_PURE_PROPERTY(double, Epsilon) virtual double getLambda() const = 0;
CV_PURE_PROPERTY(int, Iterations) /** @copybrief getLambda @see getLambda */
CV_PURE_PROPERTY(bool, UseInitialFlow) virtual void setLambda(double val) = 0;
/** @see setTheta */
virtual double getTheta() const = 0;
/** @copybrief getTheta @see getTheta */
virtual void setTheta(double val) = 0;
/** @see setScalesNumber */
virtual int getScalesNumber() const = 0;
/** @copybrief getScalesNumber @see getScalesNumber */
virtual void setScalesNumber(int val) = 0;
/** @see setWarpingsNumber */
virtual int getWarpingsNumber() const = 0;
/** @copybrief getWarpingsNumber @see getWarpingsNumber */
virtual void setWarpingsNumber(int val) = 0;
/** @see setEpsilon */
virtual double getEpsilon() const = 0;
/** @copybrief getEpsilon @see getEpsilon */
virtual void setEpsilon(double val) = 0;
/** @see setIterations */
virtual int getIterations() const = 0;
/** @copybrief getIterations @see getIterations */
virtual void setIterations(int val) = 0;
/** @see setUseInitialFlow */
virtual bool getUseInitialFlow() const = 0;
/** @copybrief getUseInitialFlow @see getUseInitialFlow */
virtual void setUseInitialFlow(bool val) = 0;
}; };
CV_EXPORTS Ptr<DualTVL1OpticalFlow> createOptFlow_DualTVL1(); CV_EXPORTS Ptr<DualTVL1OpticalFlow> createOptFlow_DualTVL1();
CV_EXPORTS Ptr<DualTVL1OpticalFlow> createOptFlow_DualTVL1_CUDA(); CV_EXPORTS Ptr<DualTVL1OpticalFlow> createOptFlow_DualTVL1_CUDA();
...@@ -99,17 +144,35 @@ namespace cv ...@@ -99,17 +144,35 @@ namespace cv
{ {
public: public:
//! @brief Flow smoothness //! @brief Flow smoothness
CV_PURE_PROPERTY(double, Alpha) /** @see setAlpha */
virtual double getAlpha() const = 0;
/** @copybrief getAlpha @see getAlpha */
virtual void setAlpha(double val) = 0;
//! @brief Gradient constancy importance //! @brief Gradient constancy importance
CV_PURE_PROPERTY(double, Gamma) /** @see setGamma */
virtual double getGamma() const = 0;
/** @copybrief getGamma @see getGamma */
virtual void setGamma(double val) = 0;
//! @brief Pyramid scale factor //! @brief Pyramid scale factor
CV_PURE_PROPERTY(double, ScaleFactor) /** @see setScaleFactor */
virtual double getScaleFactor() const = 0;
/** @copybrief getScaleFactor @see getScaleFactor */
virtual void setScaleFactor(double val) = 0;
//! @brief Number of lagged non-linearity iterations (inner loop) //! @brief Number of lagged non-linearity iterations (inner loop)
CV_PURE_PROPERTY(int, InnerIterations) /** @see setInnerIterations */
virtual int getInnerIterations() const = 0;
/** @copybrief getInnerIterations @see getInnerIterations */
virtual void setInnerIterations(int val) = 0;
//! @brief Number of warping iterations (number of pyramid levels) //! @brief Number of warping iterations (number of pyramid levels)
CV_PURE_PROPERTY(int, OuterIterations) /** @see setOuterIterations */
virtual int getOuterIterations() const = 0;
/** @copybrief getOuterIterations @see getOuterIterations */
virtual void setOuterIterations(int val) = 0;
//! @brief Number of linear system solver iterations //! @brief Number of linear system solver iterations
CV_PURE_PROPERTY(int, SolverIterations) /** @see setSolverIterations */
virtual int getSolverIterations() const = 0;
/** @copybrief getSolverIterations @see getSolverIterations */
virtual void setSolverIterations(int val) = 0;
}; };
CV_EXPORTS Ptr<BroxOpticalFlow> createOptFlow_Brox_CUDA(); CV_EXPORTS Ptr<BroxOpticalFlow> createOptFlow_Brox_CUDA();
...@@ -117,9 +180,18 @@ namespace cv ...@@ -117,9 +180,18 @@ namespace cv
class PyrLKOpticalFlow : public virtual DenseOpticalFlowExt class PyrLKOpticalFlow : public virtual DenseOpticalFlowExt
{ {
public: public:
CV_PURE_PROPERTY(int, WindowSize) /** @see setWindowSize */
CV_PURE_PROPERTY(int, MaxLevel) virtual int getWindowSize() const = 0;
CV_PURE_PROPERTY(int, Iterations) /** @copybrief getWindowSize @see getWindowSize */
virtual void setWindowSize(int val) = 0;
/** @see setMaxLevel */
virtual int getMaxLevel() const = 0;
/** @copybrief getMaxLevel @see getMaxLevel */
virtual void setMaxLevel(int val) = 0;
/** @see setIterations */
virtual int getIterations() const = 0;
/** @copybrief getIterations @see getIterations */
virtual void setIterations(int val) = 0;
}; };
CV_EXPORTS Ptr<PyrLKOpticalFlow> createOptFlow_PyrLK_CUDA(); CV_EXPORTS Ptr<PyrLKOpticalFlow> createOptFlow_PyrLK_CUDA();
......
...@@ -441,29 +441,65 @@ class CV_EXPORTS_W DualTVL1OpticalFlow : public DenseOpticalFlow ...@@ -441,29 +441,65 @@ class CV_EXPORTS_W DualTVL1OpticalFlow : public DenseOpticalFlow
{ {
public: public:
//! @brief Time step of the numerical scheme //! @brief Time step of the numerical scheme
CV_PURE_PROPERTY(double, Tau) /** @see setTau */
virtual double getTau() const = 0;
/** @copybrief getTau @see getTau */
virtual void setTau(double val) = 0;
//! @brief Weight parameter for the data term, attachment parameter //! @brief Weight parameter for the data term, attachment parameter
CV_PURE_PROPERTY(double, Lambda) /** @see setLambda */
virtual double getLambda() const = 0;
/** @copybrief getLambda @see getLambda */
virtual void setLambda(double val) = 0;
//! @brief Weight parameter for (u - v)^2, tightness parameter //! @brief Weight parameter for (u - v)^2, tightness parameter
CV_PURE_PROPERTY(double, Theta) /** @see setTheta */
virtual double getTheta() const = 0;
/** @copybrief getTheta @see getTheta */
virtual void setTheta(double val) = 0;
//! @brief coefficient for additional illumination variation term //! @brief coefficient for additional illumination variation term
CV_PURE_PROPERTY(double, Gamma) /** @see setGamma */
virtual double getGamma() const = 0;
/** @copybrief getGamma @see getGamma */
virtual void setGamma(double val) = 0;
//! @brief Number of scales used to create the pyramid of images //! @brief Number of scales used to create the pyramid of images
CV_PURE_PROPERTY(int, ScalesNumber) /** @see setScalesNumber */
virtual int getScalesNumber() const = 0;
/** @copybrief getScalesNumber @see getScalesNumber */
virtual void setScalesNumber(int val) = 0;
//! @brief Number of warpings per scale //! @brief Number of warpings per scale
CV_PURE_PROPERTY(int, WarpingsNumber) /** @see setWarpingsNumber */
virtual int getWarpingsNumber() const = 0;
/** @copybrief getWarpingsNumber @see getWarpingsNumber */
virtual void setWarpingsNumber(int val) = 0;
//! @brief Stopping criterion threshold used in the numerical scheme, which is a trade-off between precision and running time //! @brief Stopping criterion threshold used in the numerical scheme, which is a trade-off between precision and running time
CV_PURE_PROPERTY(double, Epsilon) /** @see setEpsilon */
virtual double getEpsilon() const = 0;
/** @copybrief getEpsilon @see getEpsilon */
virtual void setEpsilon(double val) = 0;
//! @brief Inner iterations (between outlier filtering) used in the numerical scheme //! @brief Inner iterations (between outlier filtering) used in the numerical scheme
CV_PURE_PROPERTY(int, InnerIterations) /** @see setInnerIterations */
virtual int getInnerIterations() const = 0;
/** @copybrief getInnerIterations @see getInnerIterations */
virtual void setInnerIterations(int val) = 0;
//! @brief Outer iterations (number of inner loops) used in the numerical scheme //! @brief Outer iterations (number of inner loops) used in the numerical scheme
CV_PURE_PROPERTY(int, OuterIterations) /** @see setOuterIterations */
virtual int getOuterIterations() const = 0;
/** @copybrief getOuterIterations @see getOuterIterations */
virtual void setOuterIterations(int val) = 0;
//! @brief Use initial flow //! @brief Use initial flow
CV_PURE_PROPERTY(bool, UseInitialFlow) /** @see setUseInitialFlow */
virtual bool getUseInitialFlow() const = 0;
/** @copybrief getUseInitialFlow @see getUseInitialFlow */
virtual void setUseInitialFlow(bool val) = 0;
//! @brief Step between scales (<1) //! @brief Step between scales (<1)
CV_PURE_PROPERTY(double, ScaleStep) /** @see setScaleStep */
virtual double getScaleStep() const = 0;
/** @copybrief getScaleStep @see getScaleStep */
virtual void setScaleStep(double val) = 0;
//! @brief Median filter kernel size (1 = no filter) (3 or 5) //! @brief Median filter kernel size (1 = no filter) (3 or 5)
CV_PURE_PROPERTY(int, MedianFiltering) /** @see setMedianFiltering */
virtual int getMedianFiltering() const = 0;
/** @copybrief getMedianFiltering @see getMedianFiltering */
virtual void setMedianFiltering(int val) = 0;
}; };
/** @brief Creates instance of cv::DenseOpticalFlow /** @brief Creates instance of cv::DenseOpticalFlow
......
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