9 |
jakw |
1 |
/*
|
|
|
2 |
*
|
|
|
3 |
SLStudio - Platform for Real-Time Structured Light
|
|
|
4 |
(c) 2013 -- 2014 Jakob Wilm, DTU, Kgs.Lyngby, Denmark
|
|
|
5 |
*
|
|
|
6 |
*/
|
|
|
7 |
|
24 |
jakw |
8 |
#ifndef SMTriangulator_H
|
|
|
9 |
#define SMTriangulator_H
|
9 |
jakw |
10 |
|
|
|
11 |
#include <QObject>
|
|
|
12 |
#include <QTime>
|
|
|
13 |
|
|
|
14 |
#include "SMCalibrationParams.h"
|
|
|
15 |
#include "Triangulator.h"
|
|
|
16 |
|
|
|
17 |
#include <pcl/point_cloud.h>
|
|
|
18 |
#include <pcl/point_types.h>
|
|
|
19 |
|
24 |
jakw |
20 |
class SMTriangulator : public QObject {
|
9 |
jakw |
21 |
Q_OBJECT
|
|
|
22 |
|
|
|
23 |
public:
|
24 |
jakw |
24 |
SMTriangulator(unsigned int _frameWidth, unsigned int _frameHeight) : frameWidth(_frameWidth), frameHeight(_frameHeight), writeToDisk(false){}
|
|
|
25 |
~SMTriangulator();
|
|
|
26 |
void triangulateFromUp(cv::Mat &up, cv::Mat &xyz);
|
|
|
27 |
void triangulateFromVp(cv::Mat &vp, cv::Mat &xyz);
|
|
|
28 |
void triangulateFromUpVp(cv::Mat &up, cv::Mat &vp, cv::Mat &xyz);
|
|
|
29 |
void triangulate(cv::Mat &up, cv::Mat &vp, cv::Mat &mask, cv::Mat &shading, cv::Mat &pointCloud);
|
|
|
30 |
|
9 |
jakw |
31 |
public slots:
|
|
|
32 |
void setup();
|
|
|
33 |
void triangulatePointCloud(cv::Mat up, cv::Mat vp, cv::Mat mask, cv::Mat shading);
|
|
|
34 |
signals:
|
|
|
35 |
void imshow(const char* windowName, cv::Mat mat, unsigned int x, unsigned int y);
|
|
|
36 |
void newPointCloud(pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointCloud);
|
|
|
37 |
void error(QString err);
|
|
|
38 |
//void finished();
|
|
|
39 |
private:
|
|
|
40 |
unsigned int frameWidth, frameHeight;
|
|
|
41 |
bool writeToDisk;
|
|
|
42 |
SMCalibrationParams *calibration;
|
|
|
43 |
Triangulator *triangulator;
|
|
|
44 |
QTime time;
|
24 |
jakw |
45 |
SMCalibrationParams calibration;
|
|
|
46 |
cv::Mat determinantTensor;
|
|
|
47 |
cv::Mat uc, vc;
|
|
|
48 |
cv::Mat lensMap1, lensMap2;
|
9 |
jakw |
49 |
};
|
|
|
50 |
|
|
|
51 |
#endif
|