Merged the trunk r8408:8457 (inclusive)

This commit is contained in:
Andrey Kamaev
2012-05-30 08:47:34 +00:00
parent 7b5a45eac4
commit 949c4edf41
42 changed files with 828 additions and 266 deletions

View File

@@ -2357,7 +2357,7 @@ Algorithm::get
--------------
Returns the algorithm parameter
.. ocv:function:: template<typename _Tp> typename ParamType<_Tp>::member_type get(const string& name) const
.. ocv:function:: template<typename _Tp> typename ParamType<_Tp>::member_type Algorithm::get(const string& name) const
:param name: The parameter name.
@@ -2378,13 +2378,13 @@ Algorithm::set
--------------
Sets the algorithm parameter
.. ocv:function:: void set(const string& name, int value)
.. ocv:function:: void set(const string& name, double value)
.. ocv:function:: void set(const string& name, bool value)
.. ocv:function:: void set(const string& name, const string& value)
.. ocv:function:: void set(const string& name, const Mat& value)
.. ocv:function:: void set(const string& name, const vector<Mat>& value)
.. ocv:function:: void set(const string& name, const Ptr<Algorithm>& value)
.. ocv:function:: void Algorithm::set(const string& name, int value)
.. ocv:function:: void Algorithm::set(const string& name, double value)
.. ocv:function:: void Algorithm::set(const string& name, bool value)
.. ocv:function:: void Algorithm::set(const string& name, const string& value)
.. ocv:function:: void Algorithm::set(const string& name, const Mat& value)
.. ocv:function:: void Algorithm::set(const string& name, const vector<Mat>& value)
.. ocv:function:: void Algorithm::set(const string& name, const Ptr<Algorithm>& value)
:param name: The parameter name.
:param value: The parameter value.
@@ -2396,7 +2396,7 @@ Algorithm::write
----------------
Stores algorithm parameters in a file storage
.. ocv:function:: void write(FileStorage& fs) const
.. ocv:function:: void Algorithm::write(FileStorage& fs) const
:param fs: File storage.
@@ -2413,7 +2413,7 @@ Algorithm::read
---------------
Reads algorithm parameters from a file storage
.. ocv:function:: void read(const FileNode& fn)
.. ocv:function:: void Algorithm::read(const FileNode& fn)
:param fn: File node of the file storage.
@@ -2423,29 +2423,24 @@ Algorithm::getList
------------------
Returns the list of registered algorithms
.. ocv:function:: void read(vector<string>& algorithms)
.. ocv:function:: void Algorithm::getList(vector<string>& algorithms)
:param algorithms: The output vector of algorithm names.
This static method returns the list of registered algorithms in alphabetical order.
This static method returns the list of registered algorithms in alphabetical order. Here is how to use it ::
Algorithm::getList
------------------
Returns the list of registered algorithms
.. ocv:function:: void read(vector<string>& algorithms)
:param algorithms: The output vector of algorithm names.
This static method returns the list of registered algorithms in alphabetical order.
vector<string> algorithms;
Algorithm::getList(algorithms);
cout << "Algorithms: " << algorithms.size() << endl;
for (size_t i=0; i < algorithms.size(); i++)
cout << algorithms[i] << endl;
Algorithm::create
-----------------
Creates algorithm instance by name
.. ocv:function:: template<typename _Tp> Ptr<_Tp> create(const string& name)
.. ocv:function:: template<typename _Tp> Ptr<_Tp> Algorithm::create(const string& name)
:param name: The algorithm name, one of the names returned by ``Algorithm::getList()``.

View File

@@ -1434,7 +1434,7 @@ Finds the inverse or pseudo-inverse of a matrix.
The function ``invert`` inverts the matrix ``src`` and stores the result in ``dst`` .
When the matrix ``src`` is singular or non-square, the function computes the pseudo-inverse matrix (the ``dst`` matrix) so that ``norm(src*dst - I)`` is minimal, where I is an identity matrix.
In case of the ``DECOMP_LU`` method, the function returns the ``src`` determinant ( ``src`` must be square). If it is 0, the matrix is not inverted and ``dst`` is filled with zeros.
In case of the ``DECOMP_LU`` method, the function returns non-zero value if the inverse has been successfully computed and 0 if ``src`` is singular.
In case of the ``DECOMP_SVD`` method, the function returns the inverse condition number of ``src`` (the ratio of the smallest singular value to the largest singular value) and 0 if ``src`` is singular. The SVD method calculates a pseudo-inverse matrix if ``src`` is singular.

View File

@@ -947,6 +947,9 @@ double cv::invert( InputArray _src, OutputArray _dst, int method )
bool result = false;
Mat src = _src.getMat();
int type = src.type();
CV_Assert(type == CV_32F || type == CV_64F);
size_t esz = CV_ELEM_SIZE(type);
int m = src.rows, n = src.cols;
@@ -969,7 +972,7 @@ double cv::invert( InputArray _src, OutputArray _dst, int method )
((double*)w.data)[n-1]/((double*)w.data)[0] : 0);
}
CV_Assert( m == n && (type == CV_32F || type == CV_64F));
CV_Assert( m == n );
if( method == DECOMP_EIG )
{