Move cv::TermCriteria out of core.hpp

pull/747/head
Andrey Kamaev 12 years ago
parent fbd435898b
commit 135c0b6cb5
  1. 31
      modules/core/include/opencv2/core.hpp
  2. 8
      modules/core/include/opencv2/core/operations.hpp
  3. 38
      modules/core/include/opencv2/core/types.hpp
  4. 7
      modules/core/include/opencv2/core/types_c.h

@ -896,34 +896,6 @@ private:
int mti; int mti;
}; };
/*!
Termination criteria in iterative algorithms
*/
class CV_EXPORTS TermCriteria
{
public:
enum
{
COUNT=1, //!< the maximum number of iterations or elements to compute
MAX_ITER=COUNT, //!< ditto
EPS=2 //!< the desired accuracy or change in parameters at which the iterative algorithm stops
};
//! default constructor
TermCriteria();
//! full constructor
TermCriteria(int type, int maxCount, double epsilon);
//! conversion from CvTermCriteria
TermCriteria(const CvTermCriteria& criteria);
//! conversion to CvTermCriteria
operator CvTermCriteria() const;
int type; //!< the type of termination criteria: COUNT, EPS or COUNT + EPS
int maxCount; // the maximum number of iterations/elements
double epsilon; // the desired accuracy
};
typedef void (*BinaryFunc)(const uchar* src1, size_t step1, typedef void (*BinaryFunc)(const uchar* src1, size_t step1,
const uchar* src2, size_t step2, const uchar* src2, size_t step2,
uchar* dst, size_t step, Size sz, uchar* dst, size_t step, Size sz,
@ -3262,9 +3234,10 @@ template<> struct ParamType<uchar>
} //namespace cv } //namespace cv
#include "opencv2/core/operations.hpp" #include "opencv2/core/operations.hpp"
#include "opencv2/core/mat.hpp" #include "opencv2/core/mat.inl.hpp"
#include "opencv2/core/cvstd.inl.hpp" #include "opencv2/core/cvstd.inl.hpp"
#endif // __cplusplus #endif // __cplusplus

@ -476,14 +476,6 @@ inline int RNG::uniform(int a, int b) { return a == b ? a : (int)(next()%(b - a)
inline float RNG::uniform(float a, float b) { return ((float)*this)*(b - a) + a; } inline float RNG::uniform(float a, float b) { return ((float)*this)*(b - a) + a; }
inline double RNG::uniform(double a, double b) { return ((double)*this)*(b - a) + a; } inline double RNG::uniform(double a, double b) { return ((double)*this)*(b - a) + a; }
inline TermCriteria::TermCriteria() : type(0), maxCount(0), epsilon(0) {}
inline TermCriteria::TermCriteria(int _type, int _maxCount, double _epsilon)
: type(_type), maxCount(_maxCount), epsilon(_epsilon) {}
inline TermCriteria::TermCriteria(const CvTermCriteria& criteria)
: type(criteria.type), maxCount(criteria.max_iter), epsilon(criteria.epsilon) {}
inline TermCriteria::operator CvTermCriteria() const
{ return cvTermCriteria(type, maxCount, epsilon); }
inline uchar* LineIterator::operator *() { return ptr; } inline uchar* LineIterator::operator *() { return ptr; }
inline LineIterator& LineIterator::operator ++() inline LineIterator& LineIterator::operator ++()
{ {

@ -640,6 +640,32 @@ public:
///////////////////////////// TermCriteria //////////////////////////////
/*!
Termination criteria in iterative algorithms
*/
class CV_EXPORTS TermCriteria
{
public:
enum
{
COUNT=1, //!< the maximum number of iterations or elements to compute
MAX_ITER=COUNT, //!< ditto
EPS=2 //!< the desired accuracy or change in parameters at which the iterative algorithm stops
};
//! default constructor
TermCriteria();
//! full constructor
TermCriteria(int type, int maxCount, double epsilon);
int type; //!< the type of termination criteria: COUNT, EPS or COUNT + EPS
int maxCount; // the maximum number of iterations/elements
double epsilon; // the desired accuracy
};
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
///////////////////////////// Implementation //////////////////////////// ///////////////////////////// Implementation ////////////////////////////
@ -1837,6 +1863,18 @@ bool DMatch::operator < (const DMatch &m) const
return distance < m.distance; return distance < m.distance;
} }
////////////////////////////// TermCriteria /////////////////////////////
inline
TermCriteria::TermCriteria()
: type(0), maxCount(0), epsilon(0) {}
inline
TermCriteria::TermCriteria(int _type, int _maxCount, double _epsilon)
: type(_type), maxCount(_maxCount), epsilon(_epsilon) {}
} // cv } // cv
#endif //__OPENCV_CORE_TYPES_HPP__ #endif //__OPENCV_CORE_TYPES_HPP__

@ -740,6 +740,13 @@ typedef struct CvTermCriteria
CV_TERMCRIT_EPS */ CV_TERMCRIT_EPS */
int max_iter; int max_iter;
double epsilon; double epsilon;
#ifdef __cplusplus
CvTermCriteria(int _type = 0, int _iter = 0, double _eps = 0) : type(_type), max_iter(_iter), epsilon(_eps) {}
CvTermCriteria(const cv::TermCriteria& t) : type(t.type), max_iter(t.maxCount), epsilon(t.epsilon) {}
operator cv::TermCriteria() const { return cv::TermCriteria(type, max_iter, epsilon); }
#endif
} }
CvTermCriteria; CvTermCriteria;

Loading…
Cancel
Save