@@ -14,30 +14,54 @@ int main(int argc, char *argv[]) {
14
14
return 1;
15
15
}*/
16
16
// input
17
- QString depthmapPath = " /Users/erika/Desktop/testcenterRel_copia/photogrammetry/Malt/Z_Num7_DeZoom4_STD-MALT.tif" ;
18
- QString orientationXmlPath = " /Users/erika/Desktop/testcenterRel_copia/photogrammetry/Ori-Relative/Orientation-L05C12.tif.xml" ;
19
- QString maskPath = " /Users/erika/Desktop/testcenterRel_copia/photogrammetry/Malt/Masq_STD-MALT_DeZoom4.tif" ;
17
+ // #define MACOS 1
18
+ #ifdef MACOS
19
+ QString base = " /User/erika/Desktop/" ;
20
+ #else
21
+ QString base = " /home/erika/" ;
22
+ #endif
23
+
24
+ QString depthmapPath = base + " testcenterRel_copia/photogrammetry/Malt/Z_Num7_DeZoom4_STD-MALT.tif" ;
25
+ QString orientationXmlPath = base + " testcenterRel_copia/photogrammetry/Ori-Relative/Orientation-L05C12.tif.xml" ;
26
+ QString maskPath = base + " testcenterRel_copia/photogrammetry/Malt/Masq_STD-MALT_DeZoom4.tif" ;
27
+
20
28
21
29
// output
22
- QString outputPath = " /Users/erika/Desktop/testcenterRel_copia/photogrammetry/depthmap_projectL05C13.png" ;
30
+ QString outputPath = base + " testcenterRel_copia/photogrammetry/depthmap_projectL05C13.png" ;
31
+ QString output_mask = base + " testcenterRel_copia/photogrammetry/mask_test.png" ;
32
+ QString output_depth = base + " testcenterRel_copia/photogrammetry/depth_test.png" ;
23
33
Depthmap depth;
24
34
OrthoDepthmap ortho;
25
35
26
- depth.loadDepth (qPrintable (depthmapPath));
27
- depth.computeNormals ();
28
- depth.loadNormals (" /Users/erika/Desktop/testcenterRel_copia/rti/L05C12/means.png" );
29
- depth.saveNormals (" /Users/erika/Desktop/testcenterRel_copia/photogrammetry/original.obj" );
30
- ortho.saveObj (" /Users/erika/Desktop/testcenterRel_copia/photogrammetry/original.obj" );
36
+ if (!ortho.load (qPrintable (depthmapPath), qPrintable (maskPath))){
37
+ cout <<" accidenti" << endl;
38
+ return -1 ;
39
+ }
40
+ // ortho.computeNormals();
41
+ // ortho.saveNormals(qPrintable(base + "testcenterRel_copia/photogrammetry/original.png"));
42
+ // ortho.saveObj(qPrintable(base + "testcenterRel_copia/photogrammetry/original.obj"));
43
+ ortho.saveDepth (qPrintable (output_depth));
44
+ ortho.saveMask (qPrintable (output_mask));
45
+
46
+ Camera camera;
47
+ camera.loadXml (orientationXmlPath);
48
+ // int pixelX = 165;
49
+ // int pixelY = 144;
50
+ // float pixelZ = 4.5;
51
+ ortho.projectToCameraDepthMap (camera, outputPath);
52
+
53
+ Eigen::Matrix3f rotationMatrix;
54
+ Eigen::Vector3f center;
31
55
32
- depth.loadMask (qPrintable (maskPath));
33
- depth.saveDepth (qPrintable (depthmapPath));
56
+ // depth.loadMask(qPrintable(maskPath));
57
+ // depth.saveDepth(qPrintable(depthmapPath));
34
58
// depth.saveMask(qPrintable(maskPath));
35
- // QString maskObjPath = "/Users/erika/Desktop/ testcenterRel_copia/photogrammetry/mask.obj";
36
- ortho.saveObj (" /Users/erika/Desktop/ testcenterRel_copia/photogrammetry/depthmap_projectL05C13.obj" );
59
+ // QString maskObjPath = base + " testcenterRel_copia/photogrammetry/mask.obj";
60
+ // ortho.saveObj(qPrintable(base + " testcenterRel_copia/photogrammetry/depthmap_projectL05C13.obj") );
37
61
38
62
39
- depth.depthIntegrateNormals ();
40
- ortho.saveObj (" /Users/erika/Desktop/ testcenterRel_copia/photogrammetry/integrated.obj" );
63
+ // depth.depthIntegrateNormals();
64
+ // ortho.saveObj(qPrintable(base + " testcenterRel_copia/photogrammetry/integrated.obj") );
41
65
42
66
43
67
@@ -78,21 +102,11 @@ fai la formula inversa, inverti la matrice. interpola bilinarmente dati 4 valori
78
102
/* int factorPowerOfTwo = 1;
79
103
depth.resizeNormals(factorPowerOfTwo, 2);
80
104
depth.depthIntegrateNormals();
81
- depth.saveNormals("/Users/erika/Desktop/testcenterRel_copia/photogrammetry/resized_integrated2.jpg");
82
- depth.saveObj("/Users/erika/Desktop/testcenterRel_copia/photogrammetry/resized_integrated2.obj");*/
83
-
105
+ depth.saveNormals(base + "testcenterRel_copia/photogrammetry/resized_integrated2.jpg");
106
+ depth.saveObj(base + "testcenterRel_copia/photogrammetry/resized_integrated2.obj");*/
84
107
85
108
86
109
87
- Camera camera;
88
- camera.loadXml (orientationXmlPath);
89
- // int pixelX = 165;
90
- // int pixelY = 144;
91
- // float pixelZ = 4.5;
92
- ortho.projectToCameraDepthMap (camera, outputPath);
93
-
94
- Eigen::Matrix3f rotationMatrix;
95
- Eigen::Vector3f center;
96
110
97
111
// depth.getOrientationVector(orientationXmlPath, rotationMatrix, center);
98
112
// Eigen::Vector3f realCoordinates = depth.pixelToRealCoordinates(pixelX, pixelY, pixelZ);
0 commit comments