Fix the view-graph calibration crash #39
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed the view-graph calibration crash by handling the “no valid image pairs” case and by setting focal lower bounds only on parameter blocks that actually exist in the Ceres problem. The failure (“HasParameterBlock”) was due to calling set_parameter_lower_bound on the full focals array even when no parameter blocks were added, which happens when there are 0 valid pairs.
Changes
Added an early return when there are zero valid image pairs, with a clear log line.
Switched lower-bound setting to per-camera blocks after those blocks are added, avoiding invalid pointer lookups.
Also add option to skip ins-feat if database.db already exists, thereby speeding up resumes when there are crashes.