mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Merged Audio branch to trunk
git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@560 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
74
guilib/include/rtabmap/gui/ImageView.h
Normal file
74
guilib/include/rtabmap/gui/ImageView.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2011, Mathieu Labbe and IntRoLab - Universite de Sherbrooke
|
||||
*
|
||||
* This file is part of RTAB-Map.
|
||||
*
|
||||
* RTAB-Map is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* RTAB-Map is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RTAB-Map. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef IMAGEVIEW_H_
|
||||
#define IMAGEVIEW_H_
|
||||
|
||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
||||
|
||||
#include <QtGui/QGraphicsView>
|
||||
#include <QtCore/QRectF>
|
||||
|
||||
class QAction;
|
||||
class QMenu;
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
class RTABMAP_EXP ImageView : public QGraphicsView {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ImageView(QWidget * parent = 0);
|
||||
virtual ~ImageView();
|
||||
|
||||
void resetZoom();
|
||||
|
||||
bool isImageShown();
|
||||
bool isFeaturesShown();
|
||||
bool isLinesShown();
|
||||
|
||||
void setFeaturesShown(bool shown);
|
||||
void setLinesShown(bool shown);
|
||||
|
||||
protected:
|
||||
virtual void contextMenuEvent(QContextMenuEvent * e);
|
||||
virtual void wheelEvent(QWheelEvent * e);
|
||||
|
||||
private slots:
|
||||
void updateZoom();
|
||||
|
||||
private:
|
||||
void updateItemsShown();
|
||||
|
||||
private:
|
||||
int _zoom;
|
||||
int _minZoom;
|
||||
QString _savedFileName;
|
||||
|
||||
QMenu * _menu;
|
||||
QAction * _showImage;
|
||||
QAction * _showFeatures;
|
||||
QAction * _showLines;
|
||||
QAction * _saveImage;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* IMAGEVIEW_H_ */
|
||||
56
guilib/include/rtabmap/gui/KeypointItem.h
Normal file
56
guilib/include/rtabmap/gui/KeypointItem.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2011, Mathieu Labbe and IntRoLab - Universite de Sherbrooke
|
||||
*
|
||||
* This file is part of RTAB-Map.
|
||||
*
|
||||
* RTAB-Map is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* RTAB-Map is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RTAB-Map. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef KEYPOINTITEM_H_
|
||||
#define KEYPOINTITEM_H_
|
||||
|
||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
||||
|
||||
#include <QtGui/QGraphicsEllipseItem>
|
||||
#include <QtGui/QGraphicsTextItem>
|
||||
#include <QtGui/QPen>
|
||||
#include <QtGui/QBrush>
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
class RTABMAP_EXP KeypointItem : public QGraphicsEllipseItem
|
||||
{
|
||||
public:
|
||||
KeypointItem(qreal x, qreal y, int r, const QString & info, const QColor & color = Qt::green, QGraphicsItem * parent = 0);
|
||||
virtual ~KeypointItem();
|
||||
|
||||
protected:
|
||||
virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event );
|
||||
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
|
||||
virtual void focusInEvent ( QFocusEvent * event );
|
||||
virtual void focusOutEvent ( QFocusEvent * event );
|
||||
|
||||
private:
|
||||
void showDescription();
|
||||
void hideDescription();
|
||||
|
||||
private:
|
||||
QString _info;
|
||||
QGraphicsRectItem * _placeHolder;
|
||||
int _width;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* KEYPOINTITEM_H_ */
|
||||
@@ -30,6 +30,9 @@
|
||||
|
||||
namespace rtabmap {
|
||||
class Camera;
|
||||
class Micro;
|
||||
class CameraMicro;
|
||||
class DBReader;
|
||||
}
|
||||
|
||||
class QGraphicsScene;
|
||||
@@ -85,6 +88,7 @@ protected:
|
||||
virtual void resizeEvent(QResizeEvent* anEvent);
|
||||
|
||||
private slots:
|
||||
void beep();
|
||||
void startDetection();
|
||||
void pauseDetection();
|
||||
void stopDetection();
|
||||
@@ -95,6 +99,8 @@ private slots:
|
||||
void selectImages();
|
||||
void selectVideo();
|
||||
void selectStream();
|
||||
void selectMic();
|
||||
void selectAudioFile();
|
||||
void selectDatabase();
|
||||
void resetTheMemory();
|
||||
void dumpTheMemory();
|
||||
@@ -112,6 +118,15 @@ private slots:
|
||||
void changeImgRateSetting();
|
||||
void changeTimeLimitSetting();
|
||||
void captureScreen();
|
||||
void setAspectRatio(int w, int h);
|
||||
void setAspectRatio16_9();
|
||||
void setAspectRatio16_10();
|
||||
void setAspectRatio4_3();
|
||||
void setAspectRatio240p();
|
||||
void setAspectRatio360p();
|
||||
void setAspectRatio480p();
|
||||
void setAspectRatio720p();
|
||||
void setAspectRatio1080p();
|
||||
|
||||
signals:
|
||||
void statsReceived(const rtabmap::Statistics &);
|
||||
@@ -128,13 +143,18 @@ signals:
|
||||
private:
|
||||
void drawKeypoints(const std::multimap<int, cv::KeyPoint> & refWords, const std::multimap<int, cv::KeyPoint> & loopWords);
|
||||
void setupMainLayout(bool vertical);
|
||||
void updateSelectSourceMenu(int type);
|
||||
void updateSelectSourceImageMenu(int type);
|
||||
void updateSelectSourceAudioMenu(int type);
|
||||
void updateSelectSourceDatabase(bool used);
|
||||
|
||||
private:
|
||||
Ui_mainWindow * _ui;
|
||||
|
||||
State _state;
|
||||
rtabmap::Camera * _camera;
|
||||
rtabmap::Micro * _mic;
|
||||
rtabmap::CameraMicro * _cameraMic;
|
||||
rtabmap::DBReader * _dbReader;
|
||||
|
||||
SrcType _srcType;
|
||||
QString _srcPath;
|
||||
@@ -156,8 +176,13 @@ private:
|
||||
PdfPlotCurve * _posteriorCurve;
|
||||
PdfPlotCurve * _likelihoodCurve;
|
||||
|
||||
UPlotCurve * _audioCurve;
|
||||
UPlotCurve * _audioCurveLoop;
|
||||
|
||||
DetailedProgressDialog * _initProgressDialog;
|
||||
QActionGroup * _selectSourceGrp;
|
||||
QActionGroup * _selectSourceImageGrp;
|
||||
QActionGroup * _selectSourceAudioGrp;
|
||||
|
||||
|
||||
QString _graphSavingFileName;
|
||||
QString _autoScreenCaptureFormat;
|
||||
|
||||
@@ -38,11 +38,10 @@ class QMainWindow;
|
||||
class QLineEdit;
|
||||
class QSlider;
|
||||
class QProgressDialog;
|
||||
class UPlotCurve;
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
class PlotCurve;
|
||||
|
||||
class RTABMAP_EXP PreferencesDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -64,8 +63,13 @@ public:
|
||||
kSrcUndef,
|
||||
kSrcUsbDevice,
|
||||
kSrcImages,
|
||||
kSrcVideo,
|
||||
kSrcDatabase
|
||||
kSrcVideo
|
||||
};
|
||||
|
||||
enum SrcAudio {
|
||||
kSrcAudioUndef,
|
||||
kSrcAudioMicDevice,
|
||||
kSrcAudioFile
|
||||
};
|
||||
|
||||
public:
|
||||
@@ -102,13 +106,17 @@ public:
|
||||
QString getWorkingDirectory();
|
||||
|
||||
// source panel
|
||||
double getGeneralImageRate() const;
|
||||
double getGeneralInputRate() const;
|
||||
bool isSourceImageUsed() const;
|
||||
bool isSourceAudioUsed() const;
|
||||
bool isSourceDatabaseUsed() const;
|
||||
bool getGeneralAutoRestart() const;
|
||||
bool getGeneralCameraKeypoints() const;
|
||||
int getSourceType() const;
|
||||
QString getSourceTypeStr() const;
|
||||
int getSourceImageType() const;
|
||||
QString getSourceImageTypeStr() const;
|
||||
int getSourceWidth() const;
|
||||
int getSourceHeight() const;
|
||||
int getFramesDropped() const;
|
||||
QString getSourceImagesPath() const; //Images group
|
||||
QString getSourceImagesSuffix() const; //Images group
|
||||
int getSourceImagesSuffixIndex() const; //Images group
|
||||
@@ -116,31 +124,44 @@ public:
|
||||
bool getSourceImagesRefreshDir() const; //Images group
|
||||
QString getSourceVideoPath() const; //Video group
|
||||
int getSourceUsbDeviceId() const; //UsbDevice group
|
||||
QString getSourceDatabasePath() const; //Database group
|
||||
bool getSourceDatabaseIgnoreChildren() const; //Database group
|
||||
bool getSourceDatabaseLoadActions() const; //Database group
|
||||
int getSourceAudioType() const; //Audio group
|
||||
QString getSourceAudioTypeStr() const; //Audio group
|
||||
int getSourceMicDevice() const; //Audio group
|
||||
int getSourceMicFs() const; //Audio group
|
||||
int getSourceMicSampleSize() const; //Audio group
|
||||
QString getSourceAudioPath() const; //Audio group
|
||||
bool getSourceAudioPlayWhileRecording() const; //Audio group
|
||||
QString getSourceDatabasePath() const; //Database group
|
||||
|
||||
//
|
||||
bool isImagesKept() const;
|
||||
float getTimeLimit() const;
|
||||
int getMemoryType() const;
|
||||
|
||||
//specific
|
||||
bool isStatisticsPublished() const;
|
||||
double getLoopThr() const;
|
||||
double getRetrievalThr() const;
|
||||
double getVpThr() const;
|
||||
double getExpThr() const;
|
||||
|
||||
//
|
||||
void disableSourceAudio();
|
||||
void disableGeneralCameraKeypoints();
|
||||
|
||||
signals:
|
||||
void settingsChanged(PreferencesDialog::PANEL_FLAGS);
|
||||
void settingsChanged(rtabmap::ParametersMap);
|
||||
|
||||
public slots:
|
||||
void setInputRate(double value);
|
||||
void setHardThr(int value);
|
||||
void setRetrievalThr(int value);
|
||||
void setImgRate(double value);
|
||||
void setAutoRestart(bool value);
|
||||
void setTimeLimit(float value);
|
||||
void selectSource(Src src = kSrcUndef);
|
||||
void selectSourceImage(Src src = kSrcUndef);
|
||||
void selectSourceAudio(SrcAudio = kSrcAudioUndef);
|
||||
void selectSourceDatabase(bool user = false);
|
||||
|
||||
private slots:
|
||||
void closeDialog ( QAbstractButton * button );
|
||||
@@ -160,6 +181,7 @@ private slots:
|
||||
void changeDictionaryPath();
|
||||
void readSettingsEnd();
|
||||
void setupTreeView();
|
||||
void updateBasicParameter();
|
||||
|
||||
protected:
|
||||
virtual void showEvent ( QShowEvent * event );
|
||||
|
||||
34
guilib/include/rtabmap/gui/qtipl.h
Normal file
34
guilib/include/rtabmap/gui/qtipl.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2011, Mathieu Labbe and IntRoLab - Universite de Sherbrooke
|
||||
*
|
||||
* This file is part of RTAB-Map.
|
||||
*
|
||||
* RTAB-Map is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* RTAB-Map is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RTAB-Map. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef QTIPL_H
|
||||
#define QTIPL_H
|
||||
|
||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
||||
|
||||
#include <QtGui/QImage>
|
||||
#include <opencv2/core/core.hpp>
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
QImage RTABMAP_EXP Ipl2QImage(const IplImage *newImage, int alpha = 255);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user