OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Tue, 27 May 2014 01:53:20 -0500opencv solve linear equation system too slowhttp://answers.opencv.org/question/34125/opencv-solve-linear-equation-system-too-slow/I used `solve` function to solve `Ax=b` problem. The A is large (about 40000*7000).
But it is very slow. Even slower than matlab.
By the way, I used the `SVD` method.
Any suggestion?Mon, 26 May 2014 22:52:38 -0500http://answers.opencv.org/question/34125/opencv-solve-linear-equation-system-too-slow/Answer by tuannhtn for <p>I used <code>solve</code> function to solve <code>Ax=b</code> problem. The A is large (about 40000*7000).
But it is very slow. Even slower than matlab.
By the way, I used the <code>SVD</code> method.
Any suggestion?</p>
http://answers.opencv.org/question/34125/opencv-solve-linear-equation-system-too-slow/?answer=34135#post-id-34135AFAIK, OpenCV is not designed for solving matrix related operation like: multiplication, eigenvalue decomposition or SVD, etc., so your result is not surprise to me. For your problem, there two kinds of choice: the first choice is using a dedicated library, [**lapack**](http://www.netlib.org/lapack/) or [Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page) is recommended, the second one is using a wrapped library, such as [Armadillo](http://arma.sourceforge.net/) or [CVMlib](http://www.cvmlib.com/). I have tested all of them, or you can see more at [this](http://nghiaho.com/?p=1726), and my choice is **lapack**, which gives the fastest speed (on Windows, with VS IDE). Hope this help.Tue, 27 May 2014 01:53:20 -0500http://answers.opencv.org/question/34125/opencv-solve-linear-equation-system-too-slow/?answer=34135#post-id-34135