C++: bool solve(InputArray src1, InputArray src2, OutputArray dst, int flags=DECOMP_LU)
Parameters:
- src1 – input matrix on the left-hand side of the system.
- src2 – input matrix on the right-hand side of the system.
- dst – output solution.
solution (matrix inversion) method.
- flags –
- DECOMP_LU Gaussian elimination with optimal pivot element chosen.
- DECOMP_CHOLESKY Cholesky 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 matrixsrc1 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 are solved instead of the original system .
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 ):
In my case, I have equation min|| P*b - (Xnew - Xm) || to solve. P is mxp eigenvector, Xnew is the target shape, Xm is the mean shape in trained model, b is the shape parameter vector we want to get. m is number of attributes (number of point * 3), p is the number of reduced eigenvalue.
Reference: http://docs.opencv.org/modules/core/doc/operations_on_arrays.html#solve
No comments:
Post a Comment