ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
reconstruction_options_widget.cc
Go to the documentation of this file.
1 // Copyright (c) 2018, ETH Zurich and UNC Chapel Hill.
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are met:
6 //
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 //
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 //
14 // * Neither the name of ETH Zurich and UNC Chapel Hill nor the names of
15 // its contributors may be used to endorse or promote products derived
16 // from this software without specific prior written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
22 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 // POSSIBILITY OF SUCH DAMAGE.
29 //
30 // Author: Johannes L. Schoenberger (jsch-at-demuc-dot-de)
31 
33 
35 
36 namespace colmap {
37 
39  OptionManager* options)
40  : OptionsWidget(parent) {
41  AddOptionBool(&options->mapper->multiple_models, "multiple_models");
42  AddOptionInt(&options->mapper->max_num_models, "max_num_models");
43  AddOptionInt(&options->mapper->max_model_overlap, "max_model_overlap");
44  AddOptionInt(&options->mapper->min_model_size, "min_model_size");
45  AddOptionBool(&options->mapper->extract_colors, "extract_colors");
46  AddOptionInt(&options->mapper->num_threads, "num_threads", -1);
47  AddOptionInt(&options->mapper->min_num_matches, "min_num_matches");
48  AddOptionBool(&options->mapper->ignore_watermarks, "ignore_watermarks");
49  AddOptionDirPath(&options->mapper->snapshot_path, "snapshot_path");
50  AddOptionInt(&options->mapper->snapshot_images_freq, "snapshot_images_freq",
51  0);
52 }
53 
55  QWidget* parent, OptionManager* options)
56  : OptionsWidget(parent) {
57  AddOptionInt(&options->mapper->triangulation.max_transitivity,
58  "max_transitivity");
59  AddOptionDouble(&options->mapper->triangulation.create_max_angle_error,
60  "create_max_angle_error [deg]");
61  AddOptionDouble(&options->mapper->triangulation.continue_max_angle_error,
62  "continue_max_angle_error [deg]");
63  AddOptionDouble(&options->mapper->triangulation.merge_max_reproj_error,
64  "merge_max_reproj_error [px]");
65  AddOptionDouble(&options->mapper->triangulation.re_max_angle_error,
66  "re_max_angle_error [deg]");
67  AddOptionDouble(&options->mapper->triangulation.re_min_ratio, "re_min_ratio");
68  AddOptionInt(&options->mapper->triangulation.re_max_trials, "re_max_trials");
69  AddOptionDouble(&options->mapper->triangulation.complete_max_reproj_error,
70  "complete_max_reproj_error [px]");
71  AddOptionInt(&options->mapper->triangulation.complete_max_transitivity,
72  "complete_max_transitivity");
73  AddOptionDouble(&options->mapper->triangulation.min_angle, "min_angle [deg]",
74  0, 180);
75  AddOptionBool(&options->mapper->triangulation.ignore_two_view_tracks,
76  "ignore_two_view_tracks");
77 }
78 
80  QWidget* parent, OptionManager* options)
81  : OptionsWidget(parent) {
82  AddOptionDouble(&options->mapper->mapper.abs_pose_max_error,
83  "abs_pose_max_error [px]");
84  AddOptionInt(&options->mapper->mapper.abs_pose_min_num_inliers,
85  "abs_pose_min_num_inliers");
86  AddOptionDouble(&options->mapper->mapper.abs_pose_min_inlier_ratio,
87  "abs_pose_min_inlier_ratio");
88  AddOptionInt(&options->mapper->mapper.max_reg_trials, "max_reg_trials", 1);
89 }
90 
92  QWidget* parent, OptionManager* options)
93  : OptionsWidget(parent) {
94  AddOptionInt(&options->mapper->init_image_id1, "init_image_id1", -1);
95  AddOptionInt(&options->mapper->init_image_id2, "init_image_id2", -1);
96  AddOptionInt(&options->mapper->init_num_trials, "init_num_trials");
97  AddOptionInt(&options->mapper->mapper.init_min_num_inliers,
98  "init_min_num_inliers");
99  AddOptionDouble(&options->mapper->mapper.init_max_error, "init_max_error");
100  AddOptionDouble(&options->mapper->mapper.init_max_forward_motion,
101  "init_max_forward_motion");
102  AddOptionDouble(&options->mapper->mapper.init_min_tri_angle,
103  "init_min_tri_angle [deg]");
104  AddOptionInt(&options->mapper->mapper.init_max_reg_trials,
105  "init_max_reg_trials", 1);
106 }
107 
109  QWidget* parent, OptionManager* options)
110  : OptionsWidget(parent) {
111  AddSection("Camera parameters");
112  AddOptionBool(&options->mapper->ba_refine_focal_length,
113  "refine_focal_length");
114  AddOptionBool(&options->mapper->ba_refine_principal_point,
115  "refine_principal_point");
116  AddOptionBool(&options->mapper->ba_refine_extra_params,
117  "refine_extra_params");
118 
119  AddSpacer();
120 
121  AddSection("Local Bundle Adjustment");
122  AddOptionInt(&options->mapper->ba_local_num_images, "num_images");
123  AddOptionInt(&options->mapper->ba_local_max_num_iterations,
124  "max_num_iterations");
125  AddOptionInt(&options->mapper->ba_local_max_refinements, "max_refinements",
126  1);
127  AddOptionDouble(&options->mapper->ba_local_max_refinement_change,
128  "max_refinement_change", 0, 1, 1e-6, 6);
129 
130  AddSpacer();
131 
132  AddSection("Global Bundle Adjustment");
133 #ifdef PBA_ENABLED
134  AddOptionBool(&options->mapper->ba_global_use_pba,
135  "use_pba\n(requires SIMPLE_RADIAL)");
136  AddOptionInt(&options->mapper->ba_global_pba_gpu_index, "pba_gpu_index", -1);
137 #endif
138  AddOptionDouble(&options->mapper->ba_global_images_ratio, "images_ratio");
139  AddOptionInt(&options->mapper->ba_global_images_freq, "images_freq");
140  AddOptionDouble(&options->mapper->ba_global_points_ratio, "points_ratio");
141  AddOptionInt(&options->mapper->ba_global_points_freq, "points_freq");
142  AddOptionInt(&options->mapper->ba_global_max_num_iterations,
143  "max_num_iterations");
144  AddOptionInt(&options->mapper->ba_global_max_refinements, "max_refinements",
145  1);
146  AddOptionDouble(&options->mapper->ba_global_max_refinement_change,
147  "max_refinement_change", 0, 1, 1e-6, 6);
148 }
149 
151  QWidget* parent, OptionManager* options)
152  : OptionsWidget(parent) {
153  AddOptionDouble(&options->mapper->min_focal_length_ratio,
154  "min_focal_length_ratio");
155  AddOptionDouble(&options->mapper->max_focal_length_ratio,
156  "max_focal_length_ratio");
157  AddOptionDouble(&options->mapper->max_extra_param, "max_extra_param");
158 
159  AddOptionDouble(&options->mapper->mapper.filter_max_reproj_error,
160  "filter_max_reproj_error [px]");
161  AddOptionDouble(&options->mapper->mapper.filter_min_tri_angle,
162  "filter_min_tri_angle [deg]");
163 }
164 
166  OptionManager* options)
167  : QWidget(parent) {
168  setWindowFlags(Qt::Dialog);
169  setWindowModality(Qt::ApplicationModal);
170  setWindowTitle("Reconstruction options");
171 
172  QGridLayout* grid = new QGridLayout(this);
173 
174  QTabWidget* tab_widget = new QTabWidget(this);
175  tab_widget->setElideMode(Qt::TextElideMode::ElideRight);
176  tab_widget->addTab(new MapperGeneralOptionsWidget(this, options),
177  tr("General"));
178  tab_widget->addTab(new MapperInitializationOptionsWidget(this, options),
179  tr("Init"));
180  tab_widget->addTab(new MapperRegistrationOptionsWidget(this, options),
181  tr("Registration"));
182  tab_widget->addTab(new MapperTriangulationOptionsWidget(this, options),
183  tr("Triangulation"));
184  tab_widget->addTab(new MapperBundleAdjustmentOptionsWidget(this, options),
185  tr("Bundle"));
186  tab_widget->addTab(new MapperFilteringOptionsWidget(this, options),
187  tr("Filter"));
188 
189  grid->addWidget(tab_widget, 0, 0);
190 }
191 
192 } // namespace colmap
MapperBundleAdjustmentOptionsWidget(QWidget *parent, OptionManager *options)
MapperFilteringOptionsWidget(QWidget *parent, OptionManager *options)
MapperGeneralOptionsWidget(QWidget *parent, OptionManager *options)
MapperInitializationOptionsWidget(QWidget *parent, OptionManager *options)
MapperRegistrationOptionsWidget(QWidget *parent, OptionManager *options)
MapperTriangulationOptionsWidget(QWidget *parent, OptionManager *options)
std::shared_ptr< IncrementalMapperOptions > mapper
QDoubleSpinBox * AddOptionDouble(double *option, const std::string &label_text, const double min=0, const double max=1e7, const double step=0.01, const int decimals=2)
QSpinBox * AddOptionInt(int *option, const std::string &label_text, const int min=0, const int max=static_cast< int >(1e7))
QLineEdit * AddOptionDirPath(std::string *option, const std::string &label_text)
void AddSection(const std::string &title)
QCheckBox * AddOptionBool(bool *option, const std::string &label_text)
ReconstructionOptionsWidget(QWidget *parent, OptionManager *options)
const double * e