-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add camera intrinsics priors and parameter bounds to bundle adjustment #4683
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
lpanaf
wants to merge
11
commits into
main
Choose a base branch
from
lpanaf/add_focal_prior
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+895
−2
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f749a23
Add camera intrinsics priors and parameter bounds to bundle adjustment
lpanaf d46f7c7
Make intrinsics bounds and prior targets camera-model aware
lpanaf 0b53d0c
Merge remote-tracking branch 'origin/main' into lpanaf/add_focal_prior
lpanaf 8ff03ab
Use pixel-space weights for camera intrinsics priors
lpanaf fddc19c
Merge remote-tracking branch 'origin/main' into lpanaf/add_focal_prior
lpanaf a6b97c3
Merge remote-tracking branch 'origin/main' into lpanaf/add_focal_prior
lpanaf 1d3b03f
Address review feedback on camera intrinsics priors
lpanaf bc88dcd
Do not force bound_camera_params off in structure-less registration
lpanaf e54b0cd
Merge remote-tracking branch 'origin/main' into lpanaf/add_focal_prior
lpanaf af15d57
f
lpanaf 38e1c6b
Merge remote-tracking branch 'origin/main' into lpanaf/add_focal_prior
lpanaf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -176,6 +176,44 @@ struct BundleAdjustmentOptions : public BundleAdjustmentBackendOptions { | |
| // Whether to print a final summary. | ||
| bool print_summary = true; | ||
|
|
||
| // Weights for soft priors on the camera intrinsics. Each weight is the | ||
| // inverse standard deviation of the assumed Gaussian prior, i.e. | ||
| // weight = 1 / stddev, so a weight of 0 means an infinite standard deviation | ||
| // and disables the respective prior. | ||
| // | ||
| // The focal length and principal point weights are direct multipliers on | ||
| // deviations in pixels. The extra parameter weight is multiplied by the mean | ||
| // focal length at the time the problem is constructed to convert | ||
| // dimensionless deviations to pixel-like residuals. Note that the effective | ||
| // strength of the extra parameter prior therefore depends on the field of | ||
| // view: at equal resolution, a small field-of-view camera is pulled towards | ||
| // its prior more strongly than a wide field-of-view one. | ||
| // | ||
| // The focal length prior is only applied to cameras with | ||
| // Camera::has_prior_focal_length and pulls towards the focal length at the | ||
| // time the problem is constructed. Thus "initial" means the construction-time | ||
| // value for each bundle adjustment problem, not necessarily the original | ||
| // database value. The prior therefore acts as a damping term across | ||
| // successive problems rather than as an anchor to the original prior, e.g. | ||
| // EXIF focal length. The principal point and extra parameter priors pull | ||
| // towards the values the camera model initializes them to, i.e. the image | ||
| // center and, for most models, zero. | ||
| double focal_length_prior_weight = 0; | ||
| double principal_point_prior_weight = 0; | ||
| double extra_params_prior_weight = 0; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Going with "weight" is probably fine here. The alternative would be "stddev". Maybe add a biref note about how these weights relate to expected standard deviations of the priors? |
||
|
|
||
| // Whether to constrain the camera parameters to bounds that are consistent | ||
| // with Camera::HasBogusParams, such that the intrinsics cannot leave the | ||
| // region that the bogus parameter filter considers valid. Parameters that | ||
| // already violate the bounds are clamped into them. | ||
| bool bound_camera_params = false; | ||
|
|
||
| // Bounds for the camera parameters, only used if bound_camera_params is set. | ||
| // The focal length bounds are relative to the maximum image dimension. | ||
| double min_focal_length_ratio = 0.1; | ||
| double max_focal_length_ratio = 10.0; | ||
| double max_extra_param = 1.0; | ||
|
|
||
| // Solver backend to use for bundle adjustment. | ||
| BundleAdjustmentBackend backend = BundleAdjustmentBackend::CERES; | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about use variance std as parameters and CovarianceWeighted wrapper where std = 1/weight