-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdepthdevice.h
82 lines (77 loc) · 2.47 KB
/
depthdevice.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef DEPTHDEVICE_H
#define DEPTHDEVICE_H
#include "MSHLabel/MSHLabel.h"
#include <QPushButton>
#include "Calibrator.h"
#include "RobotDetector.h"
#include "string.h"
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/io/openni_grabber.h>
#include "Defines.h"
#include "pointcloudviewer.h"
#include <QSlider>
class DepthDevice : public QFrame
{
Q_OBJECT
public:
DepthDevice(std::string ID = string("0"),QWidget* parent = 0);
~DepthDevice();
void Start();
void Stop();
void SetDeviceID(std::string ID);
const vector<QPoint>& getClustersToField();
const vector<QPoint>& getRefereeToField();
const vector<QPoint>& getRedRobotsToField();
const vector<QPoint>& getBlueRobotsToField();
const vector<QPoint>& getWhiteRobotsToField();
const vector<QPoint>& getBlackRobotsToField();
const vector<QPoint>& getBallToField();
private:
void DoProcessings(const pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr &cloud);
void cloud_cb_(const pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr &cloud);
void run();
private:
std::string ID;
Calibrator calibrator;
IplImage* frameRGB;
RobotDetector robotDetector;
bool Calibrated,BoundToFunction;
pcl::Grabber* interface;
QGraphicsScene Scene;
MSHLabel ImageLabel;
QPushButton buttons[POSITION_NUMBER];
QPushButton CalibratedButton;
QPushButton SwitchButton;
CAMERAPOSITION Position;
PointCloudViewer pointCloudViewer;
double scale;
vector<Point3D> cgalPoints;
vector<QPoint> qtPoints;
QSlider thresholdSlider;
vector<Segment3D> s;
vector<QLineF> Lines;
QPoint clickedPoint;
signals:
void UpdateImage(unsigned char* image,int width,int height);
void UpdateImage(const QImage&,ConstLineVector);
void UpdateScene(const QGraphicsScene& Scene);
void ShowPlane(pcl::ModelCoefficients::Ptr plane);
void ShowCloud(pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr Cloud);
void ShowBoxes(const std::vector<std::pair<pcl::PointXYZ,pcl::PointXYZ> >&);
void dataUpdated();
void clearScreen();
void ShowLines(const std::vector<Segment3D>& );
private slots:
void ButtonOneReleased();
void ButtonTwoReleased();
void ButtonThreeReleased();
void ButtonFourReleased();
void ButtonFiveReleased();
void ButtonSixReleased();
void CalibratedButtonReleased();
void OnSwitchRelease();
void thresholdValueChange(int value);
void clickedOnImage(QMouseEvent*);
};
#endif // DEPTHDEVICE_H