EditDepthArea.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the Universite de Sherbrooke nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef RTABMAP_EDITDEPTHAREA_H
29 #define RTABMAP_EDITDEPTHAREA_H
30 
31 #include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
32 
33 #include <QColor>
34 #include <QImage>
35 #include <QPoint>
36 #include <QWidget>
37 #include <opencv2/opencv.hpp>
38 #include "rtabmap/utilite/UCv2Qt.h"
39 
40 class QMenu;
41 class QAction;
42 
43 namespace rtabmap {
44 
45 class RTABMAPGUI_EXP EditDepthArea : public QWidget
46 {
47  Q_OBJECT
48 
49 public:
50  EditDepthArea(QWidget *parent = 0);
51 
52  void setImage(const cv::Mat & depth, const cv::Mat & rgb = cv::Mat());
53  cv::Mat getModifiedImage() const;
54  bool isModified() const {return modified_;}
55 
56  void setPenWidth(int newWidth);
57  int penWidth() const { return myPenWidth_; }
58  void setClusterError(double error) { clusterError_ = error; }
59  double clusterError() const { return clusterError_; }
60  void setColorMap(uCvQtDepthColorMap type);
61 
62 public Q_SLOTS:
63  void resetChanges();
64 
65 protected:
66  virtual void mousePressEvent(QMouseEvent *event);
67  virtual void mouseMoveEvent(QMouseEvent *event);
68  virtual void mouseReleaseEvent(QMouseEvent *event);
69  virtual void paintEvent(QPaintEvent *event);
70  virtual void resizeEvent(QResizeEvent *event);
71  virtual void contextMenuEvent(QContextMenuEvent * e);
72 
73 private:
74  void drawLineTo(const QPoint &endPoint);
75  void computeScaleOffsets(const QRect & targetRect, float & scale, float & offsetX, float & offsetY) const;
76 
77  bool modified_;
80  double clusterError_;
81  QImage imageRGB_;
82  QImage image_;
83  cv::Mat originalImage_;
84  QPoint lastPoint_;
85 
86  QMenu * menu_;
87  QAction * showRGB_;
88  QAction * removeCluster_;
90  QAction * resetChanges_;
91  QAction * setPenWidth_;
94  QAction * colorMapRedToBlue_;
95  QAction * colorMapBlueToRed_;
96 };
97 
98 }
99 
100 #endif
#define RTABMAPGUI_EXP
Definition: RtabmapGuiExp.h:38
QAction * colorMapRedToBlue_
Definition: EditDepthArea.h:94
QAction * clusterErrorCluster_
Definition: EditDepthArea.h:89
GLM_FUNC_DECL genType e()
GLM_FUNC_DECL detail::tmat4x4< T, P > scale(detail::tmat4x4< T, P > const &m, detail::tvec3< T, P > const &v)
QAction * colorMapWhiteToBlack_
Definition: EditDepthArea.h:92
QAction * colorMapBlackToWhite_
Definition: EditDepthArea.h:93
bool isModified() const
Definition: EditDepthArea.h:54
QAction * colorMapBlueToRed_
Definition: EditDepthArea.h:95
void setClusterError(double error)
Definition: EditDepthArea.h:58
double clusterError() const
Definition: EditDepthArea.h:59
uCvQtDepthColorMap
Definition: UCv2Qt.h:30


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Jan 23 2023 03:37:28