From 2a09d9fe6ce31032e25e4ba34447ddc5699489d2 Mon Sep 17 00:00:00 2001 From: ALouis38 Date: Fri, 24 Jun 2016 14:17:34 +0200 Subject: [PATCH 01/11] Added a launching window for Plane Sweep Lib directly into the GUI --- gui/CMakeLists.txt | 6 + gui/LaunchPlaneSweepView.cxx | 302 ++++++++++++++++++++++++ gui/LaunchPlaneSweepView.h | 72 ++++++ gui/LaunchPlaneSweepView.ui | 437 +++++++++++++++++++++++++++++++++++ gui/MainWindow.cxx | 25 ++ gui/MainWindow.h | 2 + gui/MainWindow.ui | 14 +- gui/OutputDialog.cxx | 101 ++++++++ gui/OutputDialog.h | 64 +++++ gui/OutputDialog.ui | 24 ++ gui/Project.cxx | 1 + gui/Project.h | 1 + 12 files changed, 1048 insertions(+), 1 deletion(-) create mode 100644 gui/LaunchPlaneSweepView.cxx create mode 100644 gui/LaunchPlaneSweepView.h create mode 100644 gui/LaunchPlaneSweepView.ui create mode 100644 gui/OutputDialog.cxx create mode 100644 gui/OutputDialog.h create mode 100644 gui/OutputDialog.ui diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index dc32eb31b..7a554451a 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -32,12 +32,14 @@ set(gui_am_ui set(gui_ui ${gui_am_ui} AboutDialog.ui + OutputDialog.ui CameraOptions.ui DataColorOptions.ui DataFilterOptions.ui FeatureOptions.ui ImageOptions.ui PointOptions.ui + LaunchPlaneSweepView.ui ) set(gui_resources @@ -47,6 +49,7 @@ set(gui_resources set(gui_moc_headers AboutDialog.h + OutputDialog.h ActorColorButton.h CameraOptions.h CameraView.h @@ -63,10 +66,12 @@ set(gui_moc_headers tools/BundleAdjustTool.h tools/CanonicalTransformTool.h tools/NeckerReversalTool.h + LaunchPlaneSweepView.h ) set(gui_sources AboutDialog.cxx + OutputDialog.cxx ActorColorButton.cxx CameraOptions.cxx CameraView.cxx @@ -90,6 +95,7 @@ set(gui_sources tools/BundleAdjustTool.cxx tools/CanonicalTransformTool.cxx tools/NeckerReversalTool.cxx + LaunchPlaneSweepView.cxx ) maptk_use_appdata( diff --git a/gui/LaunchPlaneSweepView.cxx b/gui/LaunchPlaneSweepView.cxx new file mode 100644 index 000000000..555fb793c --- /dev/null +++ b/gui/LaunchPlaneSweepView.cxx @@ -0,0 +1,302 @@ +/*ckwg +29 + * Copyright 2015 by Kitware, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither name of Kitware, Inc. nor the names of any contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "LaunchPlaneSweepView.h" + +#include "ui_LaunchPlaneSweepView.h" + +#include "OutputDialog.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////////// + +//BEGIN LaunchPlaneSweepViewPrivate + +//----------------------------------------------------------------------------- +class LaunchPlaneSweepViewPrivate +{ +public: + + Ui::LaunchPlaneSweepView UI; + qtUiState uiState; + + QStringList args; + + QProcess *psl; + + std::string krtdFolder; + std::string framesFolder; + std::string frameList; + std::string landmarksFile; + + void addArg(QWidget* item, std::string value=""); + void addArg(QWidget *item, double value); + + OutputDialog* dialog; +}; + +QTE_IMPLEMENT_D_FUNC(LaunchPlaneSweepView) + +//END LaunchPlaneSweepViewPrivate + +//BEGIN LaunchPlaneSweepView + +//----------------------------------------------------------------------------- +LaunchPlaneSweepView::LaunchPlaneSweepView(QWidget* parent, Qt::WindowFlags flags) + : QWidget(parent, flags), d_ptr(new LaunchPlaneSweepViewPrivate) +{ + QTE_D(); + + this->setAttribute(Qt::WA_DeleteOnClose); + + // Set up UI + d->UI.setupUi(this); + + // Set up UI persistence and restore previous state + d->uiState.setCurrentGroup("LaunchPlaneSweepView"); + + + // Set up signals/slots + connect(d->UI.pushButtonCompute, SIGNAL(clicked(bool)), + this, SLOT(compute())); + + connect(d->UI.checkBoxDepthAuto, SIGNAL(toggled(bool)), + d->UI.doubleSpinBoxDepthMin, SLOT(setDisabled(bool))); + + + connect(d->UI.checkBoxDepthAuto, SIGNAL(toggled(bool)), + d->UI.doubleSpinBoxDepthMax, SLOT(setDisabled(bool))); + + connect(d->UI.comboBoxMatchCost, SIGNAL(currentIndexChanged(int)), + this, SLOT(enableColorMatching())); + + d->dialog = new OutputDialog(); + + d->psl = new QProcess(); + + connect(d->psl, SIGNAL(readyRead()), + d->dialog, SLOT(ouputPSL())); + + connect(d->psl, SIGNAL(finished(int)), + this, SLOT(initialState())); + + connect(d->UI.pushButtonStop, SIGNAL(clicked(bool)), + d->psl, SLOT(kill())); +} + +//----------------------------------------------------------------------------- +LaunchPlaneSweepView::~LaunchPlaneSweepView() +{ + QTE_D(); + d->uiState.save(); +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::setKrtdFolder(std::string krtdFolder) +{ + QTE_D(); + + d->krtdFolder = "--krtdFolder="+krtdFolder; +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::setFramesFolder(std::string framesFolder) +{ + QTE_D(); + + d->framesFolder = framesFolder; +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::setLandmarksFile(std::string landmarksFile) +{ + QTE_D(); + + d->landmarksFile = "--landmarksPLY=" + landmarksFile; +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::compute() +{ + QTE_D(); + + std::string pslPath = d->UI.lineEditPSLPath->text().toStdString(); + + d->args << "--debug"; + + //Getting frame folder + + std::ifstream frameList(d->frameList); + std::string framePath, frameFolder, imageListFile; + + imageListFile = "--imageListFile=" + d->frameList; + + frameList >> framePath; + frameFolder = framePath.substr(0,framePath.find_last_of("/")); + + frameList.close(); + + frameFolder = "--frameFolder=" + frameFolder; + + d->args << QString::fromStdString(frameFolder) ; + d->args << QString::fromStdString(d->krtdFolder); + d->args << QString::fromStdString(imageListFile); + d->args << QString::fromStdString(d->landmarksFile); + + //Parsing arguments from form + + for (int i = 0; i < this->children().size(); ++i) + { + if (this->children().at(i)->inherits("QCheckBox")) + { + QCheckBox *child = (QCheckBox*) this->children().at(i); + + if (child->isChecked()) + { + d->addArg(child); + } + } + else if (this->children().at(i)->inherits("QComboBox")) + { + QComboBox *child = (QComboBox*) this->children().at(i); + + d->addArg(child, child->currentText().toStdString()); + } + else if (this->children().at(i)->inherits("QSpinBox")) + { + QSpinBox *child = (QSpinBox*) this->children().at(i); + + d->addArg(child,child->value()); + } + } + + d->addArg(d->UI.lineEditOutputDirectory,d->UI.lineEditOutputDirectory->text().toStdString()); + + + d->dialog->show(); + d->dialog->setOutputToDisplay(d->psl); + + runningState(); + + d->psl->setProcessChannelMode(QProcess::MergedChannels); + d->psl->start(QString::fromStdString(pslPath),d->args); +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::enableColorMatching() +{ + + QTE_D(); + + if (d->UI.comboBoxMatchCost->currentText().toStdString() == "SAD") + { + d->UI.checkBoxColorMatching->setEnabled(true); + d->UI.checkBoxColorMatching->setChecked(true); + } + else + { + d->UI.checkBoxColorMatching->setEnabled(false); + d->UI.checkBoxColorMatching->setChecked(false); + } +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::setFrameList(std::string frameList) +{ + QTE_D(); + + d->frameList = frameList; +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::initialState() +{ + QTE_D(); + + d->args.clear(); + for (int i = 0; i < this->children().size(); ++i) { + if (this->children().at(i)->inherits("QWidget")) { + QWidget *child = (QWidget*) this->children().at(i); + child->setEnabled(true); + } + } + d->UI.pushButtonStop->setEnabled(false); + + d->UI.doubleSpinBoxDepthMin->setEnabled(false); + d->UI.doubleSpinBoxDepthMax->setEnabled(false); + +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::runningState() +{ + QTE_D(); + + for (int i = 0; i < this->children().size(); ++i) { + if (this->children().at(i)->inherits("QWidget")) { + QWidget *child = (QWidget*) this->children().at(i); + child->setEnabled(false); + } + } + d->UI.pushButtonStop->setEnabled(true); +} + +//END LaunchPlaneSweepView + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepViewPrivate::addArg(QWidget *item, std::string value) +{ + std::string arg = item->property("configField").toString().toStdString(); + + if(!value.empty()) + { + arg += "=" + value; + } + args << QString::fromStdString(arg); + +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepViewPrivate::addArg(QWidget *item, double value) +{ + std::ostringstream sstream; + sstream << value; + std::string valueStr = sstream.str(); + + addArg(item,valueStr); +} diff --git a/gui/LaunchPlaneSweepView.h b/gui/LaunchPlaneSweepView.h new file mode 100644 index 000000000..752b55035 --- /dev/null +++ b/gui/LaunchPlaneSweepView.h @@ -0,0 +1,72 @@ +/*ckwg +29 + * Copyright 2015 by Kitware, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither name of Kitware, Inc. nor the names of any contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef MAPTK_LAUNCHPLANESWEEPVIEW_H_ +#define MAPTK_LAUNCHPLANESWEEPVIEW_H_ + +#include + +#include + +#include + +class LaunchPlaneSweepViewPrivate; + +class LaunchPlaneSweepView : public QWidget +{ + Q_OBJECT + +public: + explicit LaunchPlaneSweepView(QWidget* parent = 0, Qt::WindowFlags flags = 0); + virtual ~LaunchPlaneSweepView(); + + void setKrtdFolder(std::string krtdFolder); + void setFramesFolder(std::string framesFolder); + void setLandmarksFile(std::string landmarksFile); + void setFrameList(std::string frameList); + + void runningState(); + +public slots: + void compute(); + void enableColorMatching(); + void initialState(); + + +protected slots: + +private: + QTE_DECLARE_PRIVATE_RPTR(LaunchPlaneSweepView) + QTE_DECLARE_PRIVATE(LaunchPlaneSweepView) + + QTE_DISABLE_COPY(LaunchPlaneSweepView) +}; + +#endif diff --git a/gui/LaunchPlaneSweepView.ui b/gui/LaunchPlaneSweepView.ui new file mode 100644 index 000000000..f6c4af780 --- /dev/null +++ b/gui/LaunchPlaneSweepView.ui @@ -0,0 +1,437 @@ + + + LaunchPlaneSweepView + + + + 0 + 0 + 427 + 775 + + + + Compute Depthmaps with PSL + + + + + + Min. Angle Degree Between Frames + + + + + + + --PS_MATCHING_COSTS + + + + SAD + + + + + ZNCC + + + + + + + + + 75 + true + + + + Outputs parameters + + + + + + + + 75 + true + + + + Matching Cost Parameters + + + + + + + Reference Frame Step + + + + + + + 1 + + + 20 + + + --PS_MAX_NUM_IMAGES + + + + + + + Use Sub Pixel Computation + + + true + + + --PS_USE_SUBPIXEL + + + + + + + --writePointClouds + + + + vti + + + + + vtp + + + + + vts + + + + + vtpvts + + + + + vrml + + + + + + + + Depth Max + + + + + + + Number of Planes + + + + + + + false + + + 0 + + + 0.000000000000000 + + + --PS_MIN_DEPTH + + + + + + + Matching Window Size + + + + + + + 0.100000000000000 + + + 0.250000000000000 + + + 1.000000000000000 + + + --PS_RESCALE_FACTOR + + + + + + + false + + + --PS_MAX_DEPTH + + + + + + + Outputs + + + + + + + Rescale Factor + + + + + + + Occlusion Mode + + + + + + + /home/louis/develop/PlaneSweepLib/build/bin/cudaPlanesweepMAPTk + + + + + + + + 75 + true + + + + Frames Parameters + + + + + + + ArrowCursor + + + 1 + + + 5 + + + --ref_view_step + + + + + + + 2.000000000000000 + + + --PS_MIN_ANGLE_DEGREE + + + + + + + Depth Min + + + + + + + Number of Frame to Use + + + + + + + Use Color matching + + + true + + + --PS_COLOR_MATCHING + + + + + + + Matching Costs Algorithm + + + + + + + Depth Auto + + + true + + + + + + --PS_AUTO_RANGE + + + + + + + --PS_OCCLUSION_MODE + + + + None + + + + + RefSplit + + + + + BestK + + + + + + + + + 75 + true + + + + Misc. parameters + + + + + + + 1 + + + 5 + + + --PS_MATCHING_WINDOW_SIZE + + + + + + + PlaneSweepLib path + + + + + + + 10000 + + + 512 + + + --PS_NUM_PLANES + + + + + + + true + + + depthmaps + + + --outputDirectory + + + + + + + Output Directory + + + + + + + + 75 + true + + + + Depth Parameters + + + + + + + Compute + + + + + + + false + + + Stop + + + false + + + + + + + + diff --git a/gui/MainWindow.cxx b/gui/MainWindow.cxx index 6829f2e28..0a47641cf 100644 --- a/gui/MainWindow.cxx +++ b/gui/MainWindow.cxx @@ -41,6 +41,7 @@ #include "MatchMatrixWindow.h" #include "Project.h" #include "vtkMaptkCamera.h" +#include "LaunchPlaneSweepView.h" #include #include @@ -266,6 +267,10 @@ class MainWindowPrivate QQueue orphanImages; QQueue orphanCameras; + + QString krtdFolder; + QString landmarksFile; + QString framesFolder; }; QTE_IMPLEMENT_D_FUNC(MainWindow) @@ -628,6 +633,9 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags) connect(d->UI.camera, SIGNAL(valueChanged(int)), this, SLOT(setActiveCamera(int))); + connect(d->UI.actionPlaneSweepLib, SIGNAL(triggered(bool)), + this, SLOT(showComputeDepthmaps())); + this->setSlideDelay(d->UI.slideDelay->value()); // Set up UI persistence and restore previous state @@ -766,6 +774,10 @@ void MainWindow::loadProject(QString const& path) } } + d->krtdFolder = project.cameraPath; + d->landmarksFile = project.landmarks; + d->framesFolder = project.frameListPath; + d->UI.worldView->resetView(); } @@ -1111,6 +1123,19 @@ void MainWindow::showMatchMatrix() } } +void MainWindow::showComputeDepthmaps() +{ + QTE_D(); + + auto window = new LaunchPlaneSweepView(); + + window->setKrtdFolder(d->krtdFolder.toStdString()); + window->setFrameList(d->framesFolder.toStdString()); + window->setLandmarksFile(d->landmarksFile.toStdString()); + + window->show(); +} + //----------------------------------------------------------------------------- void MainWindow::setViewBackroundColor() { diff --git a/gui/MainWindow.h b/gui/MainWindow.h index 06776d7e5..04cc860f8 100644 --- a/gui/MainWindow.h +++ b/gui/MainWindow.h @@ -67,6 +67,8 @@ public slots: void showMatchMatrix(); + void showComputeDepthmaps(); + void showAboutDialog(); void showUserManual(); diff --git a/gui/MainWindow.ui b/gui/MainWindow.ui index 479abcd68..5ddfe6905 100644 --- a/gui/MainWindow.ui +++ b/gui/MainWindow.ui @@ -62,6 +62,13 @@ &Compute + + + Depthmaps... + + + + @@ -274,6 +281,11 @@ Change the background color of the views + + + Plane Sweep Lib + + @@ -291,7 +303,7 @@ qtMenu QMenu -
qtMenu.h
+
qtMenu.h
diff --git a/gui/OutputDialog.cxx b/gui/OutputDialog.cxx new file mode 100644 index 000000000..ece5658f3 --- /dev/null +++ b/gui/OutputDialog.cxx @@ -0,0 +1,101 @@ +/*ckwg +29 + * Copyright 2015 by Kitware, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither name of Kitware, Inc. nor the names of any contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "OutputDialog.h" + +#include "ui_OutputDialog.h" + +#include +#include +#include +#include +#include +#include + +//BEGIN OutputDialogPrivate + +//----------------------------------------------------------------------------- +class OutputDialogPrivate +{ +public: + + Ui::OutputDialog UI; + qtUiState uiState; + + QProcess *psl; +}; + +QTE_IMPLEMENT_D_FUNC(OutputDialog) + + +//END OutputDialogPrivate + + +//BEGIN OutputDialog + +//----------------------------------------------------------------------------- +OutputDialog::OutputDialog(QWidget* parent, Qt::WindowFlags flags) + : QDialog(parent, flags), d_ptr(new OutputDialogPrivate) +{ + QTE_D(); + + this->setAttribute(Qt::WA_DeleteOnClose); + // Set up UI + d->UI.setupUi(this); + + // Set up signals/slots + +} + +//----------------------------------------------------------------------------- +OutputDialog::~OutputDialog() +{ + QTE_D(); + d->uiState.save(); +} + +//----------------------------------------------------------------------------- +void OutputDialog::setOutputToDisplay(QProcess *process) +{ + QTE_D(); + + d->psl = process; +} + +void OutputDialog::ouputPSL() +{ + QTE_D(); + + QString outputText(d->psl->readAll()); + d->UI.plainTextEdit->appendPlainText(outputText); +} + + +//END OutputDialog diff --git a/gui/OutputDialog.h b/gui/OutputDialog.h new file mode 100644 index 000000000..deb13902d --- /dev/null +++ b/gui/OutputDialog.h @@ -0,0 +1,64 @@ +/*ckwg +29 + * Copyright 2015 by Kitware, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither name of Kitware, Inc. nor the names of any contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef MAPTK_OUTPUTDIALOG_H_ +#define MAPTK_OUTPUTDIALOG_H_ + +#include +#include + +#include + + +class OutputDialogPrivate; + +class QProcess; + +class OutputDialog : public QDialog +{ + Q_OBJECT + +public: + explicit OutputDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0); + virtual ~OutputDialog(); + void setOutputToDisplay(QProcess *process); + + +public slots: + void ouputPSL(); + +private: + QTE_DECLARE_PRIVATE_RPTR(OutputDialog) + QTE_DECLARE_PRIVATE(OutputDialog) + + QTE_DISABLE_COPY(OutputDialog) +}; + +#endif diff --git a/gui/OutputDialog.ui b/gui/OutputDialog.ui new file mode 100644 index 000000000..8af4eb85b --- /dev/null +++ b/gui/OutputDialog.ui @@ -0,0 +1,24 @@ + + + OutputDialog + + + + 0 + 0 + 508 + 369 + + + + Dialog + + + + + + + + + + diff --git a/gui/Project.cxx b/gui/Project.cxx index 95d989b8f..59e034181 100644 --- a/gui/Project.cxx +++ b/gui/Project.cxx @@ -79,6 +79,7 @@ bool Project::read(QString const& path) // Read image list auto const& iflPath = config->get_value("image_list_file"); + this->frameListPath = QString::fromStdString(iflPath); QFile ifl(base.filePath(qtString(iflPath))); if (!ifl.open(QIODevice::ReadOnly | QIODevice::Text)) { diff --git a/gui/Project.h b/gui/Project.h index c47ca942a..834b3e7ed 100644 --- a/gui/Project.h +++ b/gui/Project.h @@ -38,6 +38,7 @@ struct Project bool read(QString const& path); QStringList images; + QString frameListPath; QString cameraPath; QString tracks; From ce1203bef44532eeacea6a81db678e8999e8f2df Mon Sep 17 00:00:00 2001 From: ALouis38 Date: Fri, 24 Jun 2016 14:25:45 +0200 Subject: [PATCH 02/11] Added a file explorer and modified the output dialog --- gui/LaunchPlaneSweepView.cxx | 24 +- gui/LaunchPlaneSweepView.h | 1 + gui/LaunchPlaneSweepView.ui | 439 ++++++++++++++++++----------------- gui/OutputDialog.cxx | 9 +- gui/OutputDialog.h | 2 +- 5 files changed, 250 insertions(+), 225 deletions(-) diff --git a/gui/LaunchPlaneSweepView.cxx b/gui/LaunchPlaneSweepView.cxx index 555fb793c..d963207fe 100644 --- a/gui/LaunchPlaneSweepView.cxx +++ b/gui/LaunchPlaneSweepView.cxx @@ -42,6 +42,7 @@ #include #include #include +#include /////////////////////////////////////////////////////////////////////////////// @@ -110,13 +111,16 @@ LaunchPlaneSweepView::LaunchPlaneSweepView(QWidget* parent, Qt::WindowFlags flag d->psl = new QProcess(); connect(d->psl, SIGNAL(readyRead()), - d->dialog, SLOT(ouputPSL())); + d->dialog, SLOT(ouputProcess())); connect(d->psl, SIGNAL(finished(int)), this, SLOT(initialState())); connect(d->UI.pushButtonStop, SIGNAL(clicked(bool)), d->psl, SLOT(kill())); + + connect(d->UI.pushButtonExplore, SIGNAL(clicked(bool)), + this, SLOT(openFileExplorer())); } //----------------------------------------------------------------------------- @@ -167,7 +171,7 @@ void LaunchPlaneSweepView::compute() imageListFile = "--imageListFile=" + d->frameList; frameList >> framePath; - frameFolder = framePath.substr(0,framePath.find_last_of("/")); + frameFolder = framePath.substr(0,framePath.find_last_of("/\\")); frameList.close(); @@ -262,13 +266,25 @@ void LaunchPlaneSweepView::initialState() } +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::openFileExplorer() +{ + QTE_D(); + QString path = QFileDialog::getOpenFileName(); + + d->UI.lineEditPSLPath->setText(path); + +} + //----------------------------------------------------------------------------- void LaunchPlaneSweepView::runningState() { QTE_D(); - for (int i = 0; i < this->children().size(); ++i) { - if (this->children().at(i)->inherits("QWidget")) { + for (int i = 0; i < this->children().size(); ++i) + { + if (this->children().at(i)->inherits("QWidget")) + { QWidget *child = (QWidget*) this->children().at(i); child->setEnabled(false); } diff --git a/gui/LaunchPlaneSweepView.h b/gui/LaunchPlaneSweepView.h index 752b55035..58793f8b8 100644 --- a/gui/LaunchPlaneSweepView.h +++ b/gui/LaunchPlaneSweepView.h @@ -58,6 +58,7 @@ public slots: void compute(); void enableColorMatching(); void initialState(); + void openFileExplorer(); protected slots: diff --git a/gui/LaunchPlaneSweepView.ui b/gui/LaunchPlaneSweepView.ui index f6c4af780..97c5f336c 100644 --- a/gui/LaunchPlaneSweepView.ui +++ b/gui/LaunchPlaneSweepView.ui @@ -6,40 +6,30 @@ 0 0 - 427 - 775 + 518 + 691 Compute Depthmaps with PSL - - + + - Min. Angle Degree Between Frames + Rescale Factor - - - - --PS_MATCHING_COSTS + + + + Output Directory - - - SAD - - - - - ZNCC - - - - + + 75 @@ -47,11 +37,27 @@ - Outputs parameters + Misc. parameters - + + + + false + + + 0 + + + 0.000000000000000 + + + --PS_MIN_DEPTH + + + + @@ -64,176 +70,98 @@ - - + + - Reference Frame Step - - - - - - - 1 - - - 20 - - - --PS_MAX_NUM_IMAGES + PlaneSweepLib path - - + + - Use Sub Pixel Computation - - - true - - - --PS_USE_SUBPIXEL + Depth Min - - + + - --writePointClouds + --PS_OCCLUSION_MODE - vti - - - - - vtp - - - - - vts + None - vtpvts + RefSplit - vrml + BestK - - + + - Depth Max + Number of Frame to Use - - + + - Number of Planes - - - - - - - false - - - 0 - - - 0.000000000000000 - - - --PS_MIN_DEPTH + Compute - - + + - Matching Window Size - - - - - - - 0.100000000000000 - - - 0.250000000000000 - - - 1.000000000000000 - - - --PS_RESCALE_FACTOR + Use Sub Pixel Computation - - - - - - false + + true - --PS_MAX_DEPTH - - - - - - - Outputs + --PS_USE_SUBPIXEL - - + + - Rescale Factor + ... - + - Occlusion Mode + Matching Window Size - - + + - /home/louis/develop/PlaneSweepLib/build/bin/cudaPlanesweepMAPTk + Depth Max - - - - 75 - true - - + - Frames Parameters + Occlusion Mode - + ArrowCursor @@ -249,51 +177,27 @@ - - - - 2.000000000000000 - - - --PS_MIN_ANGLE_DEGREE - - - - - - - Depth Min - - - - - + + - Number of Frame to Use + Number of Planes - - - - Use Color matching + + + + 1 - - true + + 5 - --PS_COLOR_MATCHING - - - - - - - Matching Costs Algorithm + --PS_MATCHING_WINDOW_SIZE - + Depth Auto @@ -309,30 +213,76 @@ - - + + + + 10000 + + + 512 + - --PS_OCCLUSION_MODE + --PS_NUM_PLANES + + + + + + + --writePointClouds - None + vti - RefSplit + vtp - BestK + vts + + + + + vtpvts + + + + + vrml - - + + + + Outputs + + + + + + + 0.100000000000000 + + + 0.250000000000000 + + + 1.000000000000000 + + + --PS_RESCALE_FACTOR + + + + + 75 @@ -340,44 +290,78 @@ - Misc. parameters + Frames Parameters - - - - 1 + + + + --PS_MATCHING_COSTS - - 5 + + + SAD + + + + + ZNCC + + + + + + + + false - --PS_MATCHING_WINDOW_SIZE + --PS_MAX_DEPTH - - + + + + false + - PlaneSweepLib path + Stop + + + false - - - - 10000 + + + + + 75 + true + - - 512 + + Depth Parameters - - --PS_NUM_PLANES + + + + + + Matching Costs Algorithm - + + + + + + + + true @@ -390,15 +374,21 @@ - - + + - Output Directory + Use Color matching + + + true + + + --PS_COLOR_MATCHING - - + + 75 @@ -406,27 +396,44 @@ - Depth Parameters + Outputs parameters - - - - Compute + + + + 1 + + + 20 + + + --PS_MAX_NUM_IMAGES - - - - false + + + + 2.000000000000000 + + + --PS_MIN_ANGLE_DEGREE + + + + - Stop + Reference Frame Step - - false + + + + + + Min. Angle Degree Between Frames diff --git a/gui/OutputDialog.cxx b/gui/OutputDialog.cxx index ece5658f3..e6e2f52db 100644 --- a/gui/OutputDialog.cxx +++ b/gui/OutputDialog.cxx @@ -49,7 +49,7 @@ class OutputDialogPrivate Ui::OutputDialog UI; qtUiState uiState; - QProcess *psl; + QProcess *process; }; QTE_IMPLEMENT_D_FUNC(OutputDialog) @@ -86,14 +86,15 @@ void OutputDialog::setOutputToDisplay(QProcess *process) { QTE_D(); - d->psl = process; + d->process = process; } -void OutputDialog::ouputPSL() +//----------------------------------------------------------------------------- +void OutputDialog::ouputProcess() { QTE_D(); - QString outputText(d->psl->readAll()); + QString outputText(d->process->readAll()); d->UI.plainTextEdit->appendPlainText(outputText); } diff --git a/gui/OutputDialog.h b/gui/OutputDialog.h index deb13902d..a3ad935a5 100644 --- a/gui/OutputDialog.h +++ b/gui/OutputDialog.h @@ -52,7 +52,7 @@ class OutputDialog : public QDialog public slots: - void ouputPSL(); + void ouputProcess(); private: QTE_DECLARE_PRIVATE_RPTR(OutputDialog) From 550efdf2e2f73f52435a3425f9fcaf72c1c56072 Mon Sep 17 00:00:00 2001 From: ALouis38 Date: Fri, 24 Jun 2016 11:12:40 +0200 Subject: [PATCH 03/11] Modified casts in LaunchPlaneSweepView --- gui/LaunchPlaneSweepView.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gui/LaunchPlaneSweepView.cxx b/gui/LaunchPlaneSweepView.cxx index d963207fe..d6858effe 100644 --- a/gui/LaunchPlaneSweepView.cxx +++ b/gui/LaunchPlaneSweepView.cxx @@ -159,7 +159,7 @@ void LaunchPlaneSweepView::compute() { QTE_D(); - std::string pslPath = d->UI.lineEditPSLPath->text().toStdString(); + QString pslPath = d->UI.lineEditPSLPath->text(); d->args << "--debug"; @@ -188,7 +188,7 @@ void LaunchPlaneSweepView::compute() { if (this->children().at(i)->inherits("QCheckBox")) { - QCheckBox *child = (QCheckBox*) this->children().at(i); + QCheckBox *child = qobject_cast(this->children().at(i)); if (child->isChecked()) { @@ -197,19 +197,20 @@ void LaunchPlaneSweepView::compute() } else if (this->children().at(i)->inherits("QComboBox")) { - QComboBox *child = (QComboBox*) this->children().at(i); + QComboBox *child = qobject_cast(this->children().at(i)); d->addArg(child, child->currentText().toStdString()); } else if (this->children().at(i)->inherits("QSpinBox")) { - QSpinBox *child = (QSpinBox*) this->children().at(i); + QSpinBox *child = qobject_cast(this->children().at(i)); d->addArg(child,child->value()); } } - d->addArg(d->UI.lineEditOutputDirectory,d->UI.lineEditOutputDirectory->text().toStdString()); + d->addArg(d->UI.lineEditOutputDirectory, + d->UI.lineEditOutputDirectory->text().toStdString()); d->dialog->show(); @@ -218,7 +219,7 @@ void LaunchPlaneSweepView::compute() runningState(); d->psl->setProcessChannelMode(QProcess::MergedChannels); - d->psl->start(QString::fromStdString(pslPath),d->args); + d->psl->start(pslPath,d->args); } //----------------------------------------------------------------------------- @@ -255,7 +256,7 @@ void LaunchPlaneSweepView::initialState() d->args.clear(); for (int i = 0; i < this->children().size(); ++i) { if (this->children().at(i)->inherits("QWidget")) { - QWidget *child = (QWidget*) this->children().at(i); + QWidget *child = qobject_cast(this->children().at(i)); child->setEnabled(true); } } @@ -285,7 +286,7 @@ void LaunchPlaneSweepView::runningState() { if (this->children().at(i)->inherits("QWidget")) { - QWidget *child = (QWidget*) this->children().at(i); + QWidget *child = qobject_cast(this->children().at(i)); child->setEnabled(false); } } From 564d535ed6530f12d569bebc9de3ab50ab030118 Mon Sep 17 00:00:00 2001 From: ALouis38 Date: Fri, 24 Jun 2016 11:44:36 +0200 Subject: [PATCH 04/11] Replaced std::string by QString --- gui/LaunchPlaneSweepView.cxx | 43 ++++++++++++++++++------------------ gui/LaunchPlaneSweepView.h | 8 +++---- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/gui/LaunchPlaneSweepView.cxx b/gui/LaunchPlaneSweepView.cxx index d6858effe..1f93e49b5 100644 --- a/gui/LaunchPlaneSweepView.cxx +++ b/gui/LaunchPlaneSweepView.cxx @@ -60,12 +60,12 @@ class LaunchPlaneSweepViewPrivate QProcess *psl; - std::string krtdFolder; - std::string framesFolder; - std::string frameList; - std::string landmarksFile; + QString krtdFolder; + QString framesFolder; + QString frameList; + QString landmarksFile; - void addArg(QWidget* item, std::string value=""); + void addArg(QWidget* item, QString value=""); void addArg(QWidget *item, double value); OutputDialog* dialog; @@ -131,7 +131,7 @@ LaunchPlaneSweepView::~LaunchPlaneSweepView() } //----------------------------------------------------------------------------- -void LaunchPlaneSweepView::setKrtdFolder(std::string krtdFolder) +void LaunchPlaneSweepView::setKrtdFolder(QString krtdFolder) { QTE_D(); @@ -139,7 +139,7 @@ void LaunchPlaneSweepView::setKrtdFolder(std::string krtdFolder) } //----------------------------------------------------------------------------- -void LaunchPlaneSweepView::setFramesFolder(std::string framesFolder) +void LaunchPlaneSweepView::setFramesFolder(QString framesFolder) { QTE_D(); @@ -147,7 +147,7 @@ void LaunchPlaneSweepView::setFramesFolder(std::string framesFolder) } //----------------------------------------------------------------------------- -void LaunchPlaneSweepView::setLandmarksFile(std::string landmarksFile) +void LaunchPlaneSweepView::setLandmarksFile(QString landmarksFile) { QTE_D(); @@ -165,10 +165,10 @@ void LaunchPlaneSweepView::compute() //Getting frame folder - std::ifstream frameList(d->frameList); + std::ifstream frameList(d->frameList.toStdString()); std::string framePath, frameFolder, imageListFile; - imageListFile = "--imageListFile=" + d->frameList; + imageListFile = "--imageListFile=" + d->frameList.toStdString(); frameList >> framePath; frameFolder = framePath.substr(0,framePath.find_last_of("/\\")); @@ -178,9 +178,9 @@ void LaunchPlaneSweepView::compute() frameFolder = "--frameFolder=" + frameFolder; d->args << QString::fromStdString(frameFolder) ; - d->args << QString::fromStdString(d->krtdFolder); + d->args << d->krtdFolder; d->args << QString::fromStdString(imageListFile); - d->args << QString::fromStdString(d->landmarksFile); + d->args << d->landmarksFile; //Parsing arguments from form @@ -199,7 +199,7 @@ void LaunchPlaneSweepView::compute() { QComboBox *child = qobject_cast(this->children().at(i)); - d->addArg(child, child->currentText().toStdString()); + d->addArg(child, child->currentText()); } else if (this->children().at(i)->inherits("QSpinBox")) { @@ -209,8 +209,7 @@ void LaunchPlaneSweepView::compute() } } - d->addArg(d->UI.lineEditOutputDirectory, - d->UI.lineEditOutputDirectory->text().toStdString()); + d->addArg(d->UI.lineEditOutputDirectory, d->UI.lineEditOutputDirectory->text()); d->dialog->show(); @@ -241,7 +240,7 @@ void LaunchPlaneSweepView::enableColorMatching() } //----------------------------------------------------------------------------- -void LaunchPlaneSweepView::setFrameList(std::string frameList) +void LaunchPlaneSweepView::setFrameList(QString frameList) { QTE_D(); @@ -296,15 +295,15 @@ void LaunchPlaneSweepView::runningState() //END LaunchPlaneSweepView //----------------------------------------------------------------------------- -void LaunchPlaneSweepViewPrivate::addArg(QWidget *item, std::string value) +void LaunchPlaneSweepViewPrivate::addArg(QWidget *item, QString value) { - std::string arg = item->property("configField").toString().toStdString(); + QString arg = item->property("configField").toString(); - if(!value.empty()) + if(!value.isEmpty()) { - arg += "=" + value; + arg = arg + "=" + value; } - args << QString::fromStdString(arg); + args << arg; } @@ -315,5 +314,5 @@ void LaunchPlaneSweepViewPrivate::addArg(QWidget *item, double value) sstream << value; std::string valueStr = sstream.str(); - addArg(item,valueStr); + addArg(item,QString::fromStdString(valueStr)); } diff --git a/gui/LaunchPlaneSweepView.h b/gui/LaunchPlaneSweepView.h index 58793f8b8..11a54db4e 100644 --- a/gui/LaunchPlaneSweepView.h +++ b/gui/LaunchPlaneSweepView.h @@ -47,10 +47,10 @@ class LaunchPlaneSweepView : public QWidget explicit LaunchPlaneSweepView(QWidget* parent = 0, Qt::WindowFlags flags = 0); virtual ~LaunchPlaneSweepView(); - void setKrtdFolder(std::string krtdFolder); - void setFramesFolder(std::string framesFolder); - void setLandmarksFile(std::string landmarksFile); - void setFrameList(std::string frameList); + void setKrtdFolder(QString krtdFolder); + void setFramesFolder(QString framesFolder); + void setLandmarksFile(QString landmarksFile); + void setFrameList(QString frameList); void runningState(); From 6520ae855067567ff96ab46811337ed7e59208e2 Mon Sep 17 00:00:00 2001 From: ALouis38 Date: Fri, 24 Jun 2016 11:45:03 +0200 Subject: [PATCH 05/11] Replaced parameters according to new function definition --- gui/MainWindow.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/MainWindow.cxx b/gui/MainWindow.cxx index 0a47641cf..8eae52dba 100644 --- a/gui/MainWindow.cxx +++ b/gui/MainWindow.cxx @@ -1129,9 +1129,9 @@ void MainWindow::showComputeDepthmaps() auto window = new LaunchPlaneSweepView(); - window->setKrtdFolder(d->krtdFolder.toStdString()); - window->setFrameList(d->framesFolder.toStdString()); - window->setLandmarksFile(d->landmarksFile.toStdString()); + window->setKrtdFolder(d->krtdFolder); + window->setFrameList(d->framesFolder); + window->setLandmarksFile(d->landmarksFile); window->show(); } From c203975bbb7115a976d2a4f5490b23b9236ed47e Mon Sep 17 00:00:00 2001 From: ALouis38 Date: Fri, 24 Jun 2016 12:02:37 +0200 Subject: [PATCH 06/11] Fixed doublespinbox for min depth --- gui/LaunchPlaneSweepView.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/LaunchPlaneSweepView.ui b/gui/LaunchPlaneSweepView.ui index 97c5f336c..e3bccc1f3 100644 --- a/gui/LaunchPlaneSweepView.ui +++ b/gui/LaunchPlaneSweepView.ui @@ -47,7 +47,7 @@ false - 0 + 2 0.000000000000000 From d534161f43114ba4d43c169b17060fe14534a6d4 Mon Sep 17 00:00:00 2001 From: ALouis38 Date: Fri, 24 Jun 2016 13:27:34 +0200 Subject: [PATCH 07/11] Added an initializeValues function --- gui/LaunchPlaneSweepView.cxx | 28 ++++++++++++++++++++-------- gui/LaunchPlaneSweepView.h | 4 +++- gui/MainWindow.cxx | 8 +++++--- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/gui/LaunchPlaneSweepView.cxx b/gui/LaunchPlaneSweepView.cxx index 1f93e49b5..fe9ab983f 100644 --- a/gui/LaunchPlaneSweepView.cxx +++ b/gui/LaunchPlaneSweepView.cxx @@ -138,14 +138,6 @@ void LaunchPlaneSweepView::setKrtdFolder(QString krtdFolder) d->krtdFolder = "--krtdFolder="+krtdFolder; } -//----------------------------------------------------------------------------- -void LaunchPlaneSweepView::setFramesFolder(QString framesFolder) -{ - QTE_D(); - - d->framesFolder = framesFolder; -} - //----------------------------------------------------------------------------- void LaunchPlaneSweepView::setLandmarksFile(QString landmarksFile) { @@ -247,6 +239,26 @@ void LaunchPlaneSweepView::setFrameList(QString frameList) d->frameList = frameList; } +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::setNumCam(int numCam) +{ + QTE_D(); + + d->UI.spinBoxFrameSample->setMaximum(numCam); + d->UI.spinBoxRefFrameStep->setMaximum(numCam); +} + +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::initalizeValues(QString krtdFolder, + QString landmarksFile, + QString frameList, int numCam) +{ + setKrtdFolder(krtdFolder); + setLandmarksFile(landmarksFile); + setFrameList(frameList); + setNumCam(numCam); +} + //----------------------------------------------------------------------------- void LaunchPlaneSweepView::initialState() { diff --git a/gui/LaunchPlaneSweepView.h b/gui/LaunchPlaneSweepView.h index 11a54db4e..2a15066af 100644 --- a/gui/LaunchPlaneSweepView.h +++ b/gui/LaunchPlaneSweepView.h @@ -48,10 +48,12 @@ class LaunchPlaneSweepView : public QWidget virtual ~LaunchPlaneSweepView(); void setKrtdFolder(QString krtdFolder); - void setFramesFolder(QString framesFolder); void setLandmarksFile(QString landmarksFile); void setFrameList(QString frameList); + void setNumCam(int numCam); + void initalizeValues(QString krtdFolder,QString landmarksFile, + QString frameList,int numCam); void runningState(); public slots: diff --git a/gui/MainWindow.cxx b/gui/MainWindow.cxx index 8eae52dba..81155ddef 100644 --- a/gui/MainWindow.cxx +++ b/gui/MainWindow.cxx @@ -1129,10 +1129,12 @@ void MainWindow::showComputeDepthmaps() auto window = new LaunchPlaneSweepView(); - window->setKrtdFolder(d->krtdFolder); - window->setFrameList(d->framesFolder); - window->setLandmarksFile(d->landmarksFile); +// window->setKrtdFolder(d->krtdFolder); +// window->setFrameList(d->framesFolder); +// window->setLandmarksFile(d->landmarksFile); + window->initalizeValues(d->krtdFolder, d->landmarksFile, + d->framesFolder, d->cameras.size()); window->show(); } From 2f1e1bad3dbffe89364063345a08b61416c0c99f Mon Sep 17 00:00:00 2001 From: ALouis38 Date: Fri, 24 Jun 2016 13:35:17 +0200 Subject: [PATCH 08/11] Modified the combo boxes initialisation --- gui/LaunchPlaneSweepView.cxx | 23 ++++++++++++++++- gui/LaunchPlaneSweepView.h | 2 ++ gui/LaunchPlaneSweepView.ui | 50 ------------------------------------ 3 files changed, 24 insertions(+), 51 deletions(-) diff --git a/gui/LaunchPlaneSweepView.cxx b/gui/LaunchPlaneSweepView.cxx index fe9ab983f..fa824745b 100644 --- a/gui/LaunchPlaneSweepView.cxx +++ b/gui/LaunchPlaneSweepView.cxx @@ -121,6 +121,8 @@ LaunchPlaneSweepView::LaunchPlaneSweepView(QWidget* parent, Qt::WindowFlags flag connect(d->UI.pushButtonExplore, SIGNAL(clicked(bool)), this, SLOT(openFileExplorer())); + + initializeComboBoxes(); } //----------------------------------------------------------------------------- @@ -191,7 +193,7 @@ void LaunchPlaneSweepView::compute() { QComboBox *child = qobject_cast(this->children().at(i)); - d->addArg(child, child->currentText()); + d->addArg(child, child->itemData(child->currentIndex()).toString()); } else if (this->children().at(i)->inherits("QSpinBox")) { @@ -304,6 +306,25 @@ void LaunchPlaneSweepView::runningState() d->UI.pushButtonStop->setEnabled(true); } +//----------------------------------------------------------------------------- +void LaunchPlaneSweepView::initializeComboBoxes() +{ + QTE_D(); + + d->UI.comboBoxMatchCost->addItem("SAD",QVariant("SAD")); + d->UI.comboBoxMatchCost->addItem("ZNCC",QVariant("ZNCC")); + + d->UI.comboBoxOcclusionMode->addItem("None",QVariant("None")); + d->UI.comboBoxOcclusionMode->addItem("Ref Split",QVariant("RefSplit")); + d->UI.comboBoxOcclusionMode->addItem("Best K",QVariant("BestK")); + + d->UI.comboBoxOutputs->addItem("VTI files only",QVariant("vti")); + d->UI.comboBoxOutputs->addItem("VTI and VTS",QVariant("vts")); + d->UI.comboBoxOutputs->addItem("VTI and VTP",QVariant("vtp")); + d->UI.comboBoxOutputs->addItem("VTI, VTP and VTS files",QVariant("vtpvts")); + d->UI.comboBoxOutputs->addItem("VTI and VRML files",QVariant("vrml")); +} + //END LaunchPlaneSweepView //----------------------------------------------------------------------------- diff --git a/gui/LaunchPlaneSweepView.h b/gui/LaunchPlaneSweepView.h index 2a15066af..1e7d8be00 100644 --- a/gui/LaunchPlaneSweepView.h +++ b/gui/LaunchPlaneSweepView.h @@ -56,6 +56,7 @@ class LaunchPlaneSweepView : public QWidget QString frameList,int numCam); void runningState(); + public slots: void compute(); void enableColorMatching(); @@ -64,6 +65,7 @@ public slots: protected slots: + void initializeComboBoxes(); private: QTE_DECLARE_PRIVATE_RPTR(LaunchPlaneSweepView) diff --git a/gui/LaunchPlaneSweepView.ui b/gui/LaunchPlaneSweepView.ui index e3bccc1f3..3346cecac 100644 --- a/gui/LaunchPlaneSweepView.ui +++ b/gui/LaunchPlaneSweepView.ui @@ -89,21 +89,6 @@ --PS_OCCLUSION_MODE - - - None - - - - - RefSplit - - - - - BestK - - @@ -231,31 +216,6 @@ --writePointClouds - - - vti - - - - - vtp - - - - - vts - - - - - vtpvts - - - - - vrml - - @@ -299,16 +259,6 @@ --PS_MATCHING_COSTS - - - SAD - - - - - ZNCC - - From 3f3beee65b59dcea12d7cef7219b9ac0764fea6c Mon Sep 17 00:00:00 2001 From: ALouis38 Date: Fri, 24 Jun 2016 13:37:41 +0200 Subject: [PATCH 09/11] Dialog window is now named "Output Trace" --- gui/OutputDialog.cxx | 3 +-- gui/OutputDialog.ui | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/gui/OutputDialog.cxx b/gui/OutputDialog.cxx index e6e2f52db..558c39247 100644 --- a/gui/OutputDialog.cxx +++ b/gui/OutputDialog.cxx @@ -67,11 +67,10 @@ OutputDialog::OutputDialog(QWidget* parent, Qt::WindowFlags flags) QTE_D(); this->setAttribute(Qt::WA_DeleteOnClose); + // Set up UI d->UI.setupUi(this); - // Set up signals/slots - } //----------------------------------------------------------------------------- diff --git a/gui/OutputDialog.ui b/gui/OutputDialog.ui index 8af4eb85b..658bafd1e 100644 --- a/gui/OutputDialog.ui +++ b/gui/OutputDialog.ui @@ -11,7 +11,7 @@ - Dialog + Output Trace From 9abadd02722446b201a8a9ebae181515bc4819ef Mon Sep 17 00:00:00 2001 From: ALouis38 Date: Fri, 24 Jun 2016 14:36:17 +0200 Subject: [PATCH 10/11] Only activate the Depthmaps computation menu when a project is loaded --- gui/MainWindow.cxx | 1 + gui/MainWindow.ui | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gui/MainWindow.cxx b/gui/MainWindow.cxx index 81155ddef..3c9fd1b78 100644 --- a/gui/MainWindow.cxx +++ b/gui/MainWindow.cxx @@ -777,6 +777,7 @@ void MainWindow::loadProject(QString const& path) d->krtdFolder = project.cameraPath; d->landmarksFile = project.landmarks; d->framesFolder = project.frameListPath; + d->UI.menuDepthmaps->setEnabled(true); d->UI.worldView->resetView(); } diff --git a/gui/MainWindow.ui b/gui/MainWindow.ui index 5ddfe6905..787dc3ad3 100644 --- a/gui/MainWindow.ui +++ b/gui/MainWindow.ui @@ -20,7 +20,7 @@ 0 0 800 - 21 + 27 @@ -63,6 +63,9 @@ &Compute + + false + Depthmaps... @@ -282,6 +285,9 @@ + + true + Plane Sweep Lib @@ -303,7 +309,7 @@ qtMenu QMenu -
qtMenu.h
+
qtMenu.h
From 5200339f4ee6996781fd8f19b8765d7d57c64f2d Mon Sep 17 00:00:00 2001 From: ALouis38 Date: Mon, 27 Jun 2016 09:45:46 +0200 Subject: [PATCH 11/11] Updated copyright --- gui/LaunchPlaneSweepView.cxx | 2 +- gui/LaunchPlaneSweepView.h | 2 +- gui/OutputDialog.cxx | 2 +- gui/OutputDialog.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gui/LaunchPlaneSweepView.cxx b/gui/LaunchPlaneSweepView.cxx index fa824745b..0ed41fc61 100644 --- a/gui/LaunchPlaneSweepView.cxx +++ b/gui/LaunchPlaneSweepView.cxx @@ -1,5 +1,5 @@ /*ckwg +29 - * Copyright 2015 by Kitware, Inc. + * Copyright 2016 by Kitware, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/gui/LaunchPlaneSweepView.h b/gui/LaunchPlaneSweepView.h index 1e7d8be00..164e6dbd2 100644 --- a/gui/LaunchPlaneSweepView.h +++ b/gui/LaunchPlaneSweepView.h @@ -1,5 +1,5 @@ /*ckwg +29 - * Copyright 2015 by Kitware, Inc. + * Copyright 2016 by Kitware, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/gui/OutputDialog.cxx b/gui/OutputDialog.cxx index 558c39247..87068d256 100644 --- a/gui/OutputDialog.cxx +++ b/gui/OutputDialog.cxx @@ -1,5 +1,5 @@ /*ckwg +29 - * Copyright 2015 by Kitware, Inc. + * Copyright 2016 by Kitware, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/gui/OutputDialog.h b/gui/OutputDialog.h index a3ad935a5..0e024fa58 100644 --- a/gui/OutputDialog.h +++ b/gui/OutputDialog.h @@ -1,5 +1,5 @@ /*ckwg +29 - * Copyright 2015 by Kitware, Inc. + * Copyright 2016 by Kitware, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without