5

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

oz123
  • 27,559
  • 27
  • 125
  • 187
user3198312
  • 51
  • 1
  • 1
  • 4

1 Answers1

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:

  1. Gaussian elimination with the optimal pivot element chosen.

  2. singular value decomposition (SVD) method.

  3. 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:

Fastest method in inverse of matrix

Community
  • 1
  • 1
Micka
  • 19,585
  • 4
  • 56
  • 74
  • 1
    that 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
  • 1
    If 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