8000 Compute reprojection error in generalized absolute solver by sarlinpe · Pull Request #1257 · colmap/colmap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Compute reprojection error in generalized absolute solver #1257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 24, 2021

Conversation

sarlinpe
Copy link
Member

Currently the generalized absolute pose solver computes the squared cosine similarity:

const double cosine_dist =
1 - inv_pcx_norm * inv_x_norm * (pcx_0 * x_0 + pcx_1 * x_1 + pcx_2);
(*residuals)[i] = cosine_dist * cosine_dist;

This is not consistent with the single-camera solver, which uses the squared reprojection error, and makes it tricky to tune the RANSAC inlier threshold. This PR allows the GP3P solver to optionally instead compute the reprojection error.

Catch: in-class initialization of non-static data members requires C++>=11, but afaik COLMAP already assumed C++11.
@mihaidusmanu @ahojnnes @mgprt

@mgprt
Copy link
mgprt commented Jul 15, 2021

Non-static data member initialization was apparently added in GCC 4.7 (https://gcc.gnu.org/projects/cxx-status.html#cxx11) and COLMAP requires at least 4.9 on Linux.
Not sure about MSVC.

@ahojnnes
Copy link
Contributor
ahojnnes commented Aug 5, 2021

Thanks Paul. Have not had time to look into this until now. One problem with this approach arises when the intrinsics of the different cameras in the rig are different. Then the single reprojection threshold in normalized coordinates will correspond to different pixel values in the different cameras. It might be worth noting that in a comment somewhere.

@sarlinpe
Copy link
Member Author
sarlinpe commented Aug 8, 2021

Thanks @ahojnnes for the comment. This is indeed a problem and I don't see an easy way to get around this. I thus added a warning to the docstring. I usually compute the normalized threshold using the average of the focal lengths over all cameras in the rig.

@ahojnnes ahojnnes enabled auto-merge (squash) August 24, 2021 12:26
@ahojnnes ahojnnes merged commit 06a230f into colmap:dev Aug 24, 2021
@sarlinpe sarlinpe deleted the gp3p-residual branch August 24, 2021 15:34
sarlinpe added a commit to sarlinpe/pycolmap that referenced this pull request Aug 24, 2021
sarlinpe added a commit to colmap/pycolmap that referenced this pull request Jan 5, 2022
lucasthahn pushed a commit to tne-ai/colmap that referenced this pull request Aug 17, 2022
* Add reprojection error to GP3P

* Update tests

* Fix style

* Add warning

* Update generalized_absolute_pose.h

* Update generalized_absolute_pose.cc

Co-authored-by: Johannes Schönberger <jsch@demuc.de>
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.

4 participants
0