Matrix initialization bug fix
parent
7413b50da1
commit
14e65ce607
|
@ -31,7 +31,7 @@ namespace gtsam {
|
||||||
Point3 triangulateDLT(const vector<Matrix>& projection_matrices,
|
Point3 triangulateDLT(const vector<Matrix>& projection_matrices,
|
||||||
const vector<Point2>& measurements, double rank_tol) {
|
const vector<Point2>& measurements, double rank_tol) {
|
||||||
|
|
||||||
Matrix A = Matrix_(projection_matrices.size() *2, 4);
|
Matrix A = zeros(projection_matrices.size() *2, 4);
|
||||||
|
|
||||||
for(size_t i=0; i< projection_matrices.size(); i++) {
|
for(size_t i=0; i< projection_matrices.size(); i++) {
|
||||||
size_t row = i*2;
|
size_t row = i*2;
|
||||||
|
@ -47,6 +47,7 @@ Point3 triangulateDLT(const vector<Matrix>& projection_matrices,
|
||||||
Vector v;
|
Vector v;
|
||||||
boost::tie(rank, error, v) = DLT(A, rank_tol);
|
boost::tie(rank, error, v) = DLT(A, rank_tol);
|
||||||
|
|
||||||
|
|
||||||
if(rank < 3)
|
if(rank < 3)
|
||||||
throw(TriangulationUnderconstrainedException());
|
throw(TriangulationUnderconstrainedException());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue