Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@B1ueber2y
Copy link
Contributor

@B1ueber2y B1ueber2y commented Jun 19, 2024

Just found a long-standing bug from #2378 in both cost functions in pose graph optimization:

After LLT it should be L_matrix.transpose() rather than L_matrix that is left multiplied on the residuals.

Moreover, SVD is faster and more stable compared to covariance.inverse().llt(). I have updated this as well.

@B1ueber2y B1ueber2y requested review from ahojnnes and sarlinpe June 19, 2024 10:04
@B1ueber2y
Copy link
Contributor Author

This only affects a covariance that is non-diagonal so might be overlooked for ages.

@B1ueber2y
Copy link
Contributor Author

B1ueber2y commented Jun 19, 2024

OK an update to this. While the approach from SVD is more robust to ill-conditioned covariance and gives correct residuals for least squares problems, the resulting submatrix is not necessarily lower-triangular, resulting in potentially different ordering of the residuals (which will not pass the unit test since we are testing each dimension of residuals there).

I have reverted the SVD to inverse + llt for now and will leave it to the users to make sure that the covariance is well-conditioned.

@ahojnnes ahojnnes enabled auto-merge (squash) June 19, 2024 13:36
@ahojnnes ahojnnes merged commit 581b38e into colmap:main Jun 19, 2024
@B1ueber2y B1ueber2y deleted the fix/covariance_cost branch June 19, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants