| 493 | } |
| 494 | |
| 495 | void OptionManager::AddBundleAdjustmentOptions() { |
| 496 | if (added_ba_options_) { |
| 497 | return; |
| 498 | } |
| 499 | added_ba_options_ = true; |
| 500 | |
| 501 | // Solver-agnostic options |
| 502 | AddDefaultOption("BundleAdjustment.refine_focal_length", |
| 503 | &bundle_adjustment->refine_focal_length); |
| 504 | AddDefaultOption("BundleAdjustment.refine_principal_point", |
| 505 | &bundle_adjustment->refine_principal_point); |
| 506 | AddDefaultOption("BundleAdjustment.refine_extra_params", |
| 507 | &bundle_adjustment->refine_extra_params); |
| 508 | AddDefaultOption("BundleAdjustment.refine_rig_from_world", |
| 509 | &bundle_adjustment->refine_rig_from_world); |
| 510 | AddDefaultOption("BundleAdjustment.refine_sensor_from_rig", |
| 511 | &bundle_adjustment->refine_sensor_from_rig); |
| 512 | AddDefaultOption("BundleAdjustment.refine_points3D", |
| 513 | &bundle_adjustment->refine_points3D); |
| 514 | AddDefaultOption("BundleAdjustment.constant_rig_from_world_rotation", |
| 515 | &bundle_adjustment->constant_rig_from_world_rotation); |
| 516 | AddDefaultOption("BundleAdjustment.min_track_length", |
| 517 | &bundle_adjustment->min_track_length); |
| 518 | AddDefaultEnumOption("BundleAdjustment.backend", |
| 519 | &bundle_adjustment->backend, |
| 520 | BundleAdjustmentBackendToString, |
| 521 | BundleAdjustmentBackendFromString); |
| 522 | |
| 523 | // Ceres-specific options |
| 524 | AddDefaultOption( |
| 525 | "BundleAdjustmentCeres.max_num_iterations", |
| 526 | &bundle_adjustment->ceres->solver_options.max_num_iterations); |
| 527 | AddDefaultOption( |
| 528 | "BundleAdjustmentCeres.max_linear_solver_iterations", |
| 529 | &bundle_adjustment->ceres->solver_options.max_linear_solver_iterations); |
| 530 | AddDefaultOption( |
| 531 | "BundleAdjustmentCeres.function_tolerance", |
| 532 | &bundle_adjustment->ceres->solver_options.function_tolerance); |
| 533 | AddDefaultOption( |
| 534 | "BundleAdjustmentCeres.gradient_tolerance", |
| 535 | &bundle_adjustment->ceres->solver_options.gradient_tolerance); |
| 536 | AddDefaultOption( |
| 537 | "BundleAdjustmentCeres.parameter_tolerance", |
| 538 | &bundle_adjustment->ceres->solver_options.parameter_tolerance); |
| 539 | AddDefaultOption("BundleAdjustmentCeres.use_gpu", |
| 540 | &bundle_adjustment->ceres->use_gpu); |
| 541 | AddDefaultOption("BundleAdjustmentCeres.gpu_index", |
| 542 | &bundle_adjustment->ceres->gpu_index); |
| 543 | AddDefaultOption("BundleAdjustmentCeres.min_num_images_gpu_solver", |
| 544 | &bundle_adjustment->ceres->min_num_images_gpu_solver); |
| 545 | AddDefaultOption( |
| 546 | "BundleAdjustmentCeres.min_num_residuals_for_cpu_multi_threading", |
| 547 | &bundle_adjustment->ceres->min_num_residuals_for_cpu_multi_threading); |
| 548 | AddDefaultOption( |
| 549 | "BundleAdjustmentCeres.max_num_images_direct_dense_cpu_solver", |
| 550 | &bundle_adjustment->ceres->max_num_images_direct_dense_cpu_solver); |
| 551 | AddDefaultOption( |
| 552 | "BundleAdjustmentCeres.max_num_images_direct_sparse_cpu_solver", |