Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef ObjectRecognitionDisplay_H
00012 #define ObjectRecognitionDisplay_H
00013
00014 #include <ros/ros.h>
00015
00016 #include <QGLWidget>
00017
00018 #include <list>
00019 #include <vector>
00020 #include <map>
00021
00022
00023
00024 #include "Workers/Math/Box2D.h"
00025 #include "Workers/ImageSources/ImageSources.h"
00026 #include "KeyPointExtraction/KeyPoint.h"
00027 #include "ObjectRecognition/MatchResult.h"
00028 #include "Workers/Puma2/ColorImageRGB8.h"
00029 #include "Workers/Puma2/ImageMask.h"
00030
00031
00032 class QLabel;
00033 class QGridLayout;
00034 class ImageM;
00035 class GLImageWidget;
00036 class QCheckBox;
00037 class QVBoxLayout;
00038 class QBoxLayout;
00039 class QTableWidget;
00040 class QPushButton;
00041 class QGroupBox;
00042 class QComboBox;
00043 class QWidget;
00044
00050 class ObjectRecognitionDisplay : public QGLWidget {
00051
00052 Q_OBJECT
00053
00054 public:
00055
00056 ObjectRecognitionDisplay(ros::NodeHandle *nh, QBoxLayout* checkBoxLayout, QWidget* parent = 0 );
00057 ~ObjectRecognitionDisplay();
00058
00059 void updateObjectTable(std::vector<std::string> names, std::vector<std::string> types);
00060
00061 public slots:
00062
00064
00065
00066 void optionsChanged();
00067
00068 void cellClicked(int row,int column);
00069
00070 void setCameraId( ImageSources::SourceId cameraId );
00071
00075 void deleteObject();
00076
00077 void grabImage();
00078 void loadImage();
00079 void startLoop();
00080 void stopLoop();
00081
00085 void loadObjectDialog();
00086 void loadObject(std::string file);
00087
00088 protected:
00089
00090 private:
00091
00092 enum Stage3MatcherT
00093 {
00094 HomographyMat=1,
00095 FundamentalMat=2
00096 };
00097
00098 void updateDisplay( );
00099 void updateMatches( MatchResult& matchResult, std::list<KeyPointMatch> &matches );
00100
00101 void addCheckBox( QBoxLayout* checkBoxLayout, std::map<std::string,QCheckBox*>& CBMap, std::string id, std::string label, bool checked=true );
00102 void initBinChooser();
00103
00104 GLImageWidget* m_GlImageWidget;
00105
00106
00107
00108
00109
00110 QTableWidget* m_ObjectsList;
00111
00112 std::map< std::string, int > m_ObjectRows;
00113 int m_SelectedRow;
00114
00115 QPushButton* m_DeleteObjectButton;
00116 QGroupBox* m_ObjectsGroupBox;
00117
00118
00119 std::map< std::string, QCheckBox* > m_OptionCheckBoxes;
00120 QVBoxLayout* m_ObjCheckboxLayout;
00121 QComboBox* binChooserComboBox;
00122
00123
00124 QString m_LastOpenPath;
00125
00126
00127 ImageSources::SourceId m_CameraId;
00128
00129
00130 std::vector< KeyPoint > m_SceneKeyPoints;
00131 std::vector<MatchResult> m_MatchResults;
00132 std::vector< Box2D<int> > m_BoundingBoxes;
00133
00134 Stage3MatcherT m_Stage3Matcher;
00135
00136 ros::Publisher m_ORCommandPublisher;
00137
00138
00139 bool m_Ready;
00140 };
00141
00142 #endif