11 #include "feature/matching.h"
12 #include "ui/options_widget.h"
13 #include "util/misc.h"
14 #include "util/option_manager.h"
24 virtual void Run() = 0;
27 void CreateGeneralOptions();
71 std::string match_list_path_;
72 QComboBox* match_type_cb_;
78 options_widget_(new OptionsWidget(this)),
79 grid_layout_(new QGridLayout(this)),
105 "confidence", 0, 1, 0.00001, 5);
109 "min_inlier_ratio", 0, 1, 0.001, 3);
119 QScrollArea* options_scroll_area =
new QScrollArea(
this);
120 options_scroll_area->setAlignment(Qt::AlignHCenter);
124 QPushButton* run_button =
new QPushButton(tr(
"Run"),
this);
141 Thread* matcher =
new ExhaustiveFeatureMatcher(
153 &
options_->sequential_matching->quadratic_overlap,
154 "quadratic_overlap");
156 &
options_->sequential_matching->loop_detection,
"loop_detection");
158 &
options_->sequential_matching->loop_detection_period,
159 "loop_detection_period");
161 &
options_->sequential_matching->loop_detection_num_images,
162 "loop_detection_num_images");
165 ->loop_detection_num_nearest_neighbors,
166 "loop_detection_num_nearest_neighbors");
168 &
options_->sequential_matching->loop_detection_num_checks,
169 "loop_detection_num_checks", 1);
172 ->loop_detection_num_images_after_verification,
173 "loop_detection_num_images_after_verification", 0);
175 &
options_->sequential_matching->loop_detection_max_num_features,
176 "loop_detection_max_num_features", -1);
178 &
options_->sequential_matching->vocab_tree_path,
"vocab_tree_path");
186 if (
options_->sequential_matching->loop_detection &&
187 !ExistsFile(
options_->sequential_matching->vocab_tree_path)) {
188 QMessageBox::critical(
this,
"", tr(
"Invalid vocabulary tree path."));
192 Thread* matcher =
new SequentialFeatureMatcher(
204 &
options_->vocab_tree_matching->num_nearest_neighbors,
205 "num_nearest_neighbors");
209 &
options_->vocab_tree_matching->num_images_after_verification,
210 "num_images_after_verification", 0);
212 &
options_->vocab_tree_matching->max_num_features,
213 "max_num_features", -1);
215 &
options_->vocab_tree_matching->vocab_tree_path,
"vocab_tree_path");
223 if (!ExistsFile(
options_->vocab_tree_matching->vocab_tree_path)) {
224 QMessageBox::critical(
this,
"", tr(
"Invalid vocabulary tree path."));
228 Thread* matcher =
new VocabTreeFeatureMatcher(
241 &
options_->spatial_matching->max_num_neighbors,
242 "max_num_neighbors");
252 Thread* matcher =
new SpatialFeatureMatcher(*
options_->spatial_matching,
261 options_widget_->AddOptionInt(&options->transitive_matching->batch_size,
263 options_widget_->AddOptionInt(&options->transitive_matching->num_iterations,
272 Thread* matcher =
new TransitiveFeatureMatcher(
280 match_type_cb_ =
new QComboBox(
this);
281 match_type_cb_->addItem(QString(
"Image pairs"));
282 match_type_cb_->addItem(QString(
"Raw feature matches"));
283 match_type_cb_->addItem(QString(
"Inlier feature matches"));
286 options_widget_->AddOptionFilePath(&match_list_path_,
"match_list_path");
296 if (!ExistsFile(match_list_path_)) {
297 QMessageBox::critical(
this,
"", tr(
"Path does not exist!"));
301 Thread* matcher =
nullptr;
302 if (match_type_cb_->currentIndex() == 0) {
303 ImagePairsMatchingOptions matcher_options;
304 matcher_options.match_list_path = match_list_path_;
305 matcher =
new ImagePairsFeatureMatcher(matcher_options,
309 FeaturePairsMatchingOptions matcher_options;
310 matcher_options.match_list_path = match_list_path_;
311 if (match_type_cb_->currentIndex() == 1) {
312 matcher_options.verify_matches =
true;
313 }
else if (match_type_cb_->currentIndex() == 2) {
314 matcher_options.verify_matches =
false;
317 matcher =
new FeaturePairsFeatureMatcher(matcher_options,
331 setWindowTitle(
"Feature matching");
333 QGridLayout* grid =
new QGridLayout(
this);
335 tab_widget_ =
new QTabWidget(
this);
347 grid->addWidget(tab_widget_, 0, 0);
350 void FeatureMatchingWidget::showEvent(QShowEvent*
event) {
351 parent_->setDisabled(
true);
354 void FeatureMatchingWidget::hideEvent(QHideEvent*
event) {
355 parent_->setEnabled(
true);
int Run(int argc, const char *argv[])
CustomMatchingTab(QWidget *parent, OptionManager *options)
ExhaustiveMatchingTab(QWidget *parent, OptionManager *options)
FeatureMatchingTab(QWidget *parent, OptionManager *options)
QGridLayout * grid_layout_
ThreadControlWidget * thread_control_widget_
void CreateGeneralOptions()
OptionsWidget * options_widget_
SequentialMatchingTab(QWidget *parent, OptionManager *options)
SpatialMatchingTab(QWidget *parent, OptionManager *options)
TransitiveMatchingTab(QWidget *parent, OptionManager *options)
VocabTreeMatchingTab(QWidget *parent, OptionManager *options)
Generic file read and write utility for python interface.
colmap::OptionManager OptionManager