41 main_window_(main_window),
43 setWindowTitle(
"Automatic reconstruction");
55 QLabel* data_type_label =
new QLabel(tr(
"Data type"),
this);
56 data_type_label->setFont(font());
57 data_type_label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
60 data_type_cb_ =
new QComboBox(
this);
61 data_type_cb_->addItem(
"Individual images");
62 data_type_cb_->addItem(
"Video frames");
63 data_type_cb_->addItem(
"Internet images");
66 QLabel* quality_label =
new QLabel(tr(
"Quality"),
this);
67 quality_label->setFont(font());
68 quality_label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
71 quality_cb_ =
new QComboBox(
this);
72 quality_cb_->addItem(
"Low");
73 quality_cb_->addItem(
"Medium");
74 quality_cb_->addItem(
"High");
75 quality_cb_->addItem(
"Extreme");
76 quality_cb_->setCurrentIndex(2);
86 QLabel* mesher_label =
new QLabel(tr(
"Mesher"),
this);
87 mesher_label->setFont(font());
88 mesher_label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
91 mesher_cb_ =
new QComboBox(
this);
92 mesher_cb_->addItem(
"Delaunay");
93 mesher_cb_->addItem(
"Poisson");
94 mesher_cb_->setCurrentIndex(0);
105 QPushButton* run_button =
new QPushButton(tr(
"Run"),
this);
107 connect(run_button, &QPushButton::released,
this,
110 render_result_ =
new QAction(
this);
111 connect(render_result_, &QAction::triggered,
this,
112 &AutomaticReconstructionWidget::RenderResult, Qt::QueuedConnection);
119 QMessageBox::critical(
this,
"", tr(
"Invalid workspace folder"));
124 QMessageBox::critical(
this,
"", tr(
"Invalid image folder"));
128 switch (data_type_cb_->currentIndex()) {
146 switch (quality_cb_->currentIndex()) {
164 switch (mesher_cb_->currentIndex()) {
179 main_window_->reconstruction_manager_.
Clear();
180 main_window_->reconstruction_manager_widget_->
Update();
181 main_window_->RenderClear();
182 main_window_->RenderNow();
186 options_, &main_window_->reconstruction_manager_);
189 [
this]() { render_result_->trigger(); });
191 thread_control_widget_->
StartThread(
"Reconstructing...",
true, controller);
194 void AutomaticReconstructionWidget::RenderResult() {
195 if (main_window_->reconstruction_manager_.
Size() > 0) {
196 main_window_->reconstruction_manager_widget_->
Update();
197 main_window_->RenderClear();
198 main_window_->RenderNow();
202 QMessageBox::information(
204 tr(
"Imported the reconstructed sparse models for visualization. The "
205 "models were also exported to the <i>sparse</i> sub-folder in the "
209 if (options_.
dense) {
210 QMessageBox::information(
212 tr(
"To visualize the reconstructed dense point cloud, navigate to the "
213 "<i>dense</i> sub-folder in your workspace with <i>File > Import "
214 "model from...</i>. To visualize the meshed model, you must use an "
215 "external viewer such as Meshlab."));
void AddCallback(const int id, const std::function< void()> &func)
bool ExistsDir(const std::string &path)
std::string workspace_path
std::string vocab_tree_path