OpenCV的中求解线性问题或者最小二乘问题的方法cv::solve

# cv::solve-------------------------原文

Solves one or more linear systems or least-squares problems.

 
  

bool solve(const Mat & src1, const Mat & src2, Mat & dst, int flags = DECOMP_LU);

src1 - The input matrix on the left-hand side of the system
src2 - The input matrix on the right-hand side of the system
dst - The output solution
flags - The solution (matrix inversion) method

DECOMP_LU - Gaussian elimination with optimal pivot element chosen
DECOMP_CHOLESKY - Cholesky LLT factorization; the matrix src1 must be symmetrical and positively defined
DECOMP_EIG - Eigenvalue decomposition; the matrix src1 must be symmetrical
DECOMP_SVD - Singular value decomposition (SVD) method; the system can be over-defined and/or the matrix src1 can be singular
DECOMP_QR - QR factorization; the system can be over-defined and/or the matrix src1 can be singular
DECOMP_NORMAL - While all the previous flags are mutually exclusive, this flag can be used together with any of the previous. It means that the normal equations src1T · src1 · dst = src1Tsrc2 are solved instead of the original system src1 · dst = src2

The function solve solves a linear system or least-squares problem (the latter is possible with SVD or QR methods, or by specifying the flag DECOMP_NORMAL):

dst = argminX || src1 · X - src2 ||

If DECOMP_LU or DECOMP_CHOLESKY method is used, the function returns 1 if src1 (or src1Tsrc1) is non-singular and 0 otherwise; in the latter case dst is not valid. Other methods find some pseudo-solution in the case of singular left-hand side part.Note that if you want to find unity-norm solution of an under-defined singular system src1 · dst = 0, the function solve will not do the work. Use cv::SVD::solveZ instead.

See also: cv::invert, cv::SVD, cv::eigen

DECOMP_LU(LU分解)

http://blog.csdn.net/myhaspl/article/details/49450743


DECOMP_CHOLESKYCHOLESKY分解)


http://blog.csdn.net/acdreamers/article/details/44656847

DECOMP_EIG(EIG分解)



DECOMP_SVD(SVD分解)

http://www.cnblogs.com/LeftNotEasy/archive/2011/01/19/svd-and-applications.html

DECOMP_QR(QR分解)

http://blog.sina.com.cn/s/blog_3f41287a0101ke2s.html




你可能感兴趣的:(OpenCV的中求解线性问题或者最小二乘问题的方法cv::solve)