1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

* refactored the remaining old-style functions in 3d and calib modules to use the new C++ API.

* extended C++ version of Levenberg-Marquardt (LM) solver to accommodate all features of the C counterpart.
* removed C version of LM solver
* made a few other little changes to make the code compile and run smoothly
This commit is contained in:
Vadim Pisarevsky
2021-06-07 20:55:25 +08:00
parent c105402dfc
commit eff6d32337
20 changed files with 1583 additions and 3608 deletions
@@ -370,6 +370,7 @@ public:
void release() const;
void clear() const;
void setTo(const _InputArray& value, const _InputArray & mask = _InputArray()) const;
void setZero() const;
void assign(const UMat& u) const;
void assign(const Mat& m) const;
@@ -1259,6 +1260,10 @@ public:
*/
Mat& setTo(InputArray value, InputArray mask=noArray());
/** @brief Sets all the array elements to 0.
*/
Mat& setZero();
/** @brief Changes the shape and/or the number of channels of a 2D matrix without copying the data.
The method makes a new matrix header for \*this elements. The new matrix may have a different size
+6 -2
View File
@@ -58,6 +58,8 @@
namespace cv
{
class CV_EXPORTS _OutputArray;
//! @addtogroup core_basic
//! @{
@@ -215,6 +217,10 @@ public:
template<int l> Matx(const Matx<_Tp, m, l>& a, const Matx<_Tp, l, n>& b, Matx_MatMulOp);
Matx(const Matx<_Tp, n, m>& a, Matx_TOp);
//! copy & convert
void copyTo(const _OutputArray& dst) const;
void convertTo(const _OutputArray& dst, int type, double scale=1., double shift=0.) const;
_Tp val[m*n]; //< matrix elements
};
@@ -970,8 +976,6 @@ Matx<_Tp, m, n> MatxCommaInitializer<_Tp, m, n>::operator *() const
return *dst;
}
/////////////////////////////////// Vec Implementation ///////////////////////////////////
template<typename _Tp, int cn> inline
@@ -247,7 +247,17 @@ Matx<_Tp, n, l> Matx<_Tp, m, n>::solve(const Matx<_Tp, m, l>& rhs, int method) c
return ok ? x : Matx<_Tp, n, l>::zeros();
}
template<typename _Tp, int m, int n> inline
void Matx<_Tp, m, n>::copyTo(OutputArray dst) const
{
Mat(*this, false).copyTo(dst);
}
template<typename _Tp, int m, int n> inline
void Matx<_Tp, m, n>::convertTo(OutputArray dst, int type, double scale, double shift) const
{
Mat(*this, false).convertTo(dst, type, scale, shift);
}
////////////////////////// Augmenting algebraic & logical operations //////////////////////////
@@ -870,6 +870,7 @@ public:
@param epsilon The desired accuracy or change in parameters at which the iterative algorithm stops.
*/
TermCriteria(int type, int maxCount, double epsilon);
TermCriteria(int maxCount, double epsilon);
inline bool isValid() const
{
@@ -2469,6 +2470,26 @@ inline
TermCriteria::TermCriteria(int _type, int _maxCount, double _epsilon)
: type(_type), maxCount(_maxCount), epsilon(_epsilon) {}
inline TermCriteria::TermCriteria(int _maxCount, double _epsilon)
{
type = 0;
if (_maxCount > 0)
{
maxCount = _maxCount;
type = COUNT;
}
else
maxCount = INT_MAX-1;
if (_epsilon > 0)
{
epsilon = _epsilon;
type |= EPS;
}
else
epsilon = DBL_EPSILON;
}
//! @endcond
} // cv