Skip to content

ParameterizeVariables returns false when no poses are present in the optimization #188

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gareth-cross
Copy link
Contributor

This change addresses an edge case that produces a confusing exception:

  • When previous steps of the problem produce poor results (global positioning + track selection), no images will be added to the optimization. In other words, AddPointToCameraConstraints adds no variables for the cameras.
  • If this occurs, then the variable center is never assigned in the loop of ParameterizeVariables. As a result, SetParameterBlockConstant is passed an address that Ceres is unfamiliar with, causing an exception to occur.

This change explicitly checks for the case where no valid image variables were found, and returns false from ParameterizeVariables. An error message is printed, rather than throwing an exception inside ceres.

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