-
Notifications
You must be signed in to change notification settings - Fork 3
/
PSMImplementation.h
72 lines (57 loc) · 1.5 KB
/
PSMImplementation.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
#ifndef PSM_IMPLEMENTATION_H
#define PSM_IMPLEMENTATION_H
#include "slBenchmark.h"
#include <queue>
#define PSM_NOISE_THRESHOLD 0.1
#define PSM_TWO_PI 6.2831853
#define PSM_TWO_PI_ON_3 PSM_TWO_PI / 3.0
#define PSM_RENDER_DETAIL 1
#define X_PROJECTOR_TOLERANCE 0.25
using namespace cv;
struct WrappedPixel {
int x;
int y;
float dist;
float phase;
};
struct CompareWrappedPixel {
bool operator()(const WrappedPixel& lhs, const WrappedPixel& rhs) const {
if (lhs.dist < rhs.dist) {
return true;
}
return false;
}
};
class PSMImplementation : public slImplementation {
public:
PSMImplementation();
// Constructor to set the number of columns to something else that 32...
PSMImplementation(unsigned int);
virtual ~PSMImplementation() {};
void preExperimentRun();
void postExperimentRun();
bool hasMoreIterations();
virtual double getPatternWidth();
virtual Mat generatePattern();
virtual void processCapture(Mat);
virtual void postIterationsProcess();
unsigned int getNumberColumns();
private:
float diff(float, float);
float min(float, float, float);
float max(float, float, float);
float averageBrightness(int, int, int);
void phaseWrap();
void phaseUnwrap(int, int, float, float);
void phaseUnwrap();
void makeDepth();
unsigned int numberColumns;
priority_queue<WrappedPixel, vector<WrappedPixel>, CompareWrappedPixel> *pixelsToProcess;
float *phase;
float *dist;
//bool *mask;
//bool *ready;
int *mask;
int *ready;
};
#endif //PSM_IMPLEMENTATION_H