12/16/2016

Inhomogeneous linear system solver in opencv (Example code)


double dm2[3][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
 Mat A(3, 3, CV_64FC1, dm2);
 Mat x(3, 1, CV_64FC1);
 double vvb[] = { 14, 32, 52 };
 Mat b(3, 1, CV_64FC1, vvb);
 cv::solve(A, b, x, DECOMP_SVD); //// solve (Ax=b) for x
 cout << x << endl;

No comments:

Post a Comment