From 81b3b49f97cf47a08152a39c29336bc0895189a5 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Sat, 14 Jun 2014 17:01:14 +0000 Subject: [PATCH] Updated Source menu, sorted RGB-D choices by sensor type Fixed openni from opencv available() method git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1365 f169173b-cf89-36c8-b27e-44dbe73f0c83 --- corelib/src/Camera.cpp | 4 +--- guilib/src/MainWindow.cpp | 15 ++++---------- guilib/src/ui/mainWindow.ui | 40 +++++++++++++++++++++++++++++-------- 3 files changed, 37 insertions(+), 22 deletions(-) diff --git a/corelib/src/Camera.cpp b/corelib/src/Camera.cpp index 00d569bd..34dbcf08 100644 --- a/corelib/src/Camera.cpp +++ b/corelib/src/Camera.cpp @@ -390,8 +390,7 @@ void CameraVideo::captureImage(cv::Mat & rgb, cv::Mat & depth, float & depthCons ///////////////////////// bool CameraRGBD::available() { - printf("\nOpencV build: \n", cv::getBuildInformation().c_str()); - return true; + return cv::getBuildInformation().find("OpenNI: YES") != std::string::npos; } CameraRGBD::CameraRGBD(float imageRate, bool asus) : @@ -428,7 +427,6 @@ bool CameraRGBD::init() UINFO("BASELINE %f mm", _capture.get( CV_CAP_PROP_OPENNI_BASELINE )); UINFO("FPS %f", _capture.get( CV_CAP_PROP_FPS )); UINFO("Focal %f", _capture.get( CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH )); - UINFO("Focal2 %f", _capture.get( CV_CAP_PROP_OPENNI_FOCAL_LENGTH )); UINFO("REGISTRATION %f", _capture.get( CV_CAP_PROP_OPENNI_REGISTRATION )); if(_capture.get( CV_CAP_PROP_OPENNI_REGISTRATION ) == 0.0) { diff --git a/guilib/src/MainWindow.cpp b/guilib/src/MainWindow.cpp index 823618c5..1e6cf468 100644 --- a/guilib/src/MainWindow.cpp +++ b/guilib/src/MainWindow.cpp @@ -278,15 +278,6 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent) : #endif //Settings menu - QActionGroup * selectSourceImageGrp = new QActionGroup(this); - selectSourceImageGrp->addAction(_ui->actionUsbCamera); - selectSourceImageGrp->addAction(_ui->actionImageFiles); - selectSourceImageGrp->addAction(_ui->actionVideo); - selectSourceImageGrp->addAction(_ui->actionOpenNI); - selectSourceImageGrp->addAction(_ui->actionFreenect); - selectSourceImageGrp->addAction(_ui->actionOpenNI_CV); - selectSourceImageGrp->addAction(_ui->actionOpenNI_CV_ASUS); - selectSourceImageGrp->addAction(_ui->actionOpenNI2); this->updateSelectSourceImageMenu(_preferencesDialog->getSourceImageType()); connect(_ui->actionImageFiles, SIGNAL(triggered()), this, SLOT(selectImages())); connect(_ui->actionVideo, SIGNAL(triggered()), this, SLOT(selectVideo())); @@ -294,7 +285,8 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent) : this->updateSelectSourceDatabase(_preferencesDialog->isSourceDatabaseUsed()); connect(_ui->actionDatabase, SIGNAL(triggered()), this, SLOT(selectDatabase())); this->updateSelectSourceRGBDMenu(_preferencesDialog->isSourceOpenniUsed(), _preferencesDialog->getSourceRGBD()); - connect(_ui->actionOpenNI, SIGNAL(triggered()), this, SLOT(selectOpenni())); + connect(_ui->actionOpenNI_PCL, SIGNAL(triggered()), this, SLOT(selectOpenni())); + connect(_ui->actionOpenNI_PCL_ASUS, SIGNAL(triggered()), this, SLOT(selectOpenni())); connect(_ui->actionFreenect, SIGNAL(triggered()), this, SLOT(selectFreenect())); _ui->actionFreenect->setEnabled(CameraFreenect::available()); connect(_ui->actionOpenNI_CV, SIGNAL(triggered()), this, SLOT(selectOpenniCv())); @@ -1842,7 +1834,8 @@ void MainWindow::updateSelectSourceDatabase(bool used) void MainWindow::updateSelectSourceRGBDMenu(bool used, PreferencesDialog::Src src) { - _ui->actionOpenNI->setChecked(used && src == PreferencesDialog::kSrcOpenNI_PCL); + _ui->actionOpenNI_PCL->setChecked(used && src == PreferencesDialog::kSrcOpenNI_PCL); + _ui->actionOpenNI_PCL_ASUS->setChecked(used && src == PreferencesDialog::kSrcOpenNI_PCL); _ui->actionFreenect->setChecked(used && src == PreferencesDialog::kSrcFreenect); _ui->actionOpenNI_CV->setChecked(used && src == PreferencesDialog::kSrcOpenNI_CV); _ui->actionOpenNI_CV_ASUS->setChecked(used && src == PreferencesDialog::kSrcOpenNI_CV_ASUS); diff --git a/guilib/src/ui/mainWindow.ui b/guilib/src/ui/mainWindow.ui index 78f94a54..a1e46c6c 100644 --- a/guilib/src/ui/mainWindow.ui +++ b/guilib/src/ui/mainWindow.ui @@ -80,7 +80,7 @@ - Image + Image-only @@ -90,15 +90,28 @@ RGB-D camera - - - - - + + + Kinect for Xbox 360 + + + + + + + + Xtion PRO LIVE + + + + + + + + - @@ -981,7 +994,7 @@ Take a screenshot - + true @@ -1014,10 +1027,21 @@ + + true + OpenNI2 + + + true + + + OpenNI-PCL + +