12 #include "controllers/bundle_adjustment.h"
13 #include "util/option_manager.h"
22 : OptionsWidget(main_window),
23 main_window_(main_window),
25 reconstruction_(nullptr),
27 setWindowTitle(
"Bundle adjustment");
29 AddOptionInt(&options->bundle_adjustment->solver_options.max_num_iterations,
30 "max_num_iterations");
31 AddOptionInt(&options->bundle_adjustment->solver_options
32 .max_linear_solver_iterations,
33 "max_linear_solver_iterations");
36 &options->bundle_adjustment->solver_options.function_tolerance,
37 "function_tolerance [10eX]", -1000, 1000);
39 &options->bundle_adjustment->solver_options.gradient_tolerance,
40 "gradient_tolerance [10eX]", -1000, 1000);
42 &options->bundle_adjustment->solver_options.parameter_tolerance,
43 "parameter_tolerance [10eX]", -1000, 1000);
45 AddOptionBool(&options->bundle_adjustment->refine_focal_length,
46 "refine_focal_length");
47 AddOptionBool(&options->bundle_adjustment->refine_principal_point,
48 "refine_principal_point");
49 AddOptionBool(&options->bundle_adjustment->refine_extra_params,
50 "refine_extra_params");
51 AddOptionBool(&options->bundle_adjustment->refine_extrinsics,
54 QPushButton* run_button =
new QPushButton(tr(
"Run"),
this);
55 grid_layout_->addWidget(run_button, grid_layout_->rowCount(), 1);
56 connect(run_button, &QPushButton::released,
this,
57 &BundleAdjustmentWidget::Run);
59 render_action_ =
new QAction(
this);
60 connect(render_action_, &QAction::triggered,
this,
61 &BundleAdjustmentWidget::Render, Qt::QueuedConnection);
65 reconstruction_ = reconstruction;
70 void BundleAdjustmentWidget::Run() {
71 CHECK_NOTNULL(reconstruction_);
76 thread->AddCallback(Thread::FINISHED_CALLBACK,
77 [
this]() { render_action_->trigger(); });
81 reconstruction_->Normalize();
83 thread_control_widget_->
StartThread(
"Bundle adjusting...",
true, thread);
86 void BundleAdjustmentWidget::Render() { main_window_->RenderNow(); }
Generic file read and write utility for python interface.
colmap::BundleAdjustmentController BundleAdjustmentController
colmap::OptionManager OptionManager