40 reconstruction_(nullptr),
42 setWindowFlags(Qt::Dialog);
43 setWindowModality(Qt::ApplicationModal);
44 setWindowTitle(
"Undistortion");
46 output_format_ =
new QComboBox(
this);
47 output_format_->addItem(
"COLMAP");
48 output_format_->addItem(
"PMVS");
49 output_format_->addItem(
"CMP-MVS");
50 output_format_->setFont(font());
65 QPushButton* undistort_button =
new QPushButton(tr(
"Undistort"),
this);
66 connect(undistort_button, &QPushButton::released,
this,
67 &UndistortionWidget::Undistort);
72 reconstruction_ = &reconstruction;
79 void UndistortionWidget::Undistort() {
80 CHECK_NOTNULL(reconstruction_);
85 Thread* undistorter =
nullptr;
87 if (output_format_->currentIndex() == 0) {
91 }
else if (output_format_->currentIndex() == 1) {
92 undistorter =
new PMVSUndistorter(undistortion_options_,
const_cast<Reconstruction*
>(reconstruction_),
94 }
else if (output_format_->currentIndex() == 2) {
96 new CMPMVSUndistorter(undistortion_options_,
const_cast<Reconstruction*
>(reconstruction_),
99 QMessageBox::critical(
this,
"", tr(
"Invalid output format"));
103 thread_control_widget_->
StartThread(
"Undistorting...",
true, undistorter);
105 QMessageBox::critical(
this,
"", tr(
"Invalid output path"));
std::shared_ptr< std::string > image_path
bool ExistsDir(const std::string &path)