-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.cpp
77 lines (62 loc) · 3.29 KB
/
main.cpp
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
#include "slBenchmark.h"
// Implementations
#include "BinaryImplementation.h"
#include "GrayCodedBinaryImplementation.h"
#include "PSMImplementation.h"
#include "DeBruijnImplementation.h"
#include "RaycastImplementation.h"
#include "SingleLineImplementation.h"
int main() {
slCameraDevice logitechC920(1920, 1080, 70.42, 43.3);
slCameraDevice canonLegriaHFG25(1920, 1080, 71.00817551, 43.72998906,
string("decklinkvideosrc mode=11 ! videobalance brightness=-0.2 contrast=1.75 saturation=1.75 ! videoconvert ! video/x-raw, format=(string)BGR ! appsink")
);
slProjectorDevice acerX1261P(1024, 768, 31.21119655, 23.66278431);
slProjectorDevice hitachiPJTX100(1280, 720, 38.76968605, 22.39062111);
slInfrastructureSetup setup(canonLegriaHFG25, hitachiPJTX100, 17.5);
slBlenderVirtualInfrastructure blenderVirtualInfrastructure(setup);
slPhysicalInfrastructure physicalInfrastructure(setup);
slFileInfrastructure fileInfrastructure(setup);
// slInfrastructure *currentInfrastructure = &blenderVirtualInfrastructure;
// slInfrastructure *currentInfrastructure = &physicalInfrastructure;
slInfrastructure *currentInfrastructure = &fileInfrastructure;
int implementationColumns = 128;
int projectorWidth = (int)setup.projectorDevice.resolution.width;
BinaryImplementation binaryImplementation(implementationColumns);
GrayCodedBinaryImplementation grayCodedBinaryImplementation(implementationColumns);
DeBruijnImplementation deBruijnImplementation(implementationColumns);
// PSMImplementation psmImplementation;
SingleLineImplementation singleLineImplementation(projectorWidth);
// SingleLineImplementation singleLineImplementation(implementationColumns);
// RaycastImplementation raycastImplementation(projectorWidth);
slSpeedDepthExperiment binaryExperiment(currentInfrastructure, &binaryImplementation);
slSpeedDepthExperiment grayCodedBinaryExperiment(currentInfrastructure, &grayCodedBinaryImplementation);
slSpeedDepthExperiment deBruijnExperiment(currentInfrastructure, &deBruijnImplementation);
// slSpeedDepthExperiment psmExperiment(currentInfrastructure, &psmImplementation);
slSpeedDepthExperiment singleLineExperiment(currentInfrastructure, &singleLineImplementation);
// slSpeedDepthExperiment raycastExperiment(&blenderVirtualInfrastructure, &raycastImplementation);
binaryExperiment.run();
grayCodedBinaryExperiment.run();
deBruijnExperiment.run();
// psmExperiment.run();
// raycastExperiment.run();
singleLineExperiment.run();
// slBenchmark benchmark(&raycastExperiment);
slBenchmark benchmark(&singleLineExperiment);
benchmark.addExperiment(&binaryExperiment);
benchmark.addExperiment(&grayCodedBinaryExperiment);
benchmark.addExperiment(&deBruijnExperiment);
// benchmark.addExperiment(&psmExperiment);
// benchmark.addExperiment(&singleLineExperiment);
benchmark.addMetric(new slSpeedMetric());
benchmark.addMetric(new slAccuracyMetric());
benchmark.addMetric(new slResolutionMetric());
benchmark.compareExperiments();
sl3DReconstructor::writeXYZPointCloud(&binaryExperiment);
sl3DReconstructor::writeXYZPointCloud(&grayCodedBinaryExperiment);
sl3DReconstructor::writeXYZPointCloud(&deBruijnExperiment);
// sl3DReconstructor::writeXYZPointCloud(&psmExperiment);
// sl3DReconstructor::writeXYZPointCloud(&raycastExperiment);
sl3DReconstructor::writeXYZPointCloud(&singleLineExperiment);
return 0;
}