Can you explain to me how many and what methods are there in opencv c++ to solve systems of linear equations? if there are already existing tool or function already written, I can list the most efficient? My system has to solve an equation concerning the processing of digital images
Asked
Active
Viewed 1.2k times
1 Answers
11
if you have a system A*x = B
your solution is x=A^(-1)*B
.
OpenCV allows you to use three different invert()
method parameter choices:
Gaussian elimination with the optimal pivot element chosen.
singular value decomposition (SVD) method.
Cholesky decomposition; the matrix must be symmetrical and positive-definite.
more information here: http://docs.opencv.org/modules/core/doc/operations_on_arrays.html#invert
edit:
in addition there is a solve()
method with additional methods:
http://docs.opencv.org/modules/core/doc/operations_on_arrays.html#solve
edit 2: there is a short performance comparison for all the three methods:
-
1that might be an error in the openCV documentation, I'll change it in the answer and I'll add some reference about performance. – Micka Jan 24 '14 at 15:56
-
1If you want to solve `Ax=b`, you should always use `solve()`, and not invert your matrix (for stability, accuracy & performance). – Ela782 Dec 16 '15 at 14:31