21
21
22
22
#include " framework-utiles.hpp"
23
23
24
- Eigen::Vector3d convertCartesian2Spherical (double x, double y, int width, int height){
25
- double lam ( (x / width) * 2 . * M_PI );
26
- double phi ( ((y / (height-1 )) - 0.5 ) * M_PI );
27
- Eigen::Vector3d pos3d ( cos (phi)*cos (lam), cos (phi)*sin (lam), sin (phi) );
28
- return pos3d;
24
+ Eigen::Vector3d utiles_direction (double x, double y, int width, int height){
25
+
26
+ // Convert pixel coordinates to geographic mapping coordinates
27
+ double lamda ( (x/width) * 2 .* M_PI );
28
+ double phi ( ((y/(height-1 )) - 0.5 ) * M_PI );
29
+
30
+ // Compute and return direction vector
31
+ return Eigen::Vector3d (cos (phi)*cos (lamda), cos (phi)*sin (lamda), sin (phi));
32
+
29
33
}
30
34
35
+ /* delete */
31
36
void profile (std::string msg){
32
37
static struct timespec specOld;
33
38
static std::string msgLast = " " ;
@@ -95,7 +100,7 @@ float bilinear_sample(float *p, float x, float y, int width){
95
100
return (p[i00]*(1 .0f -fx) + p[i01]*fx)*(1 .0f -fy) + (p[i10]*(1 .0f -fx) + p[i11]*fx)*fy;
96
101
}
97
102
98
- void create_directories ( std::string rootPath, std::string modeName ) {
103
+ void utiles_directories ( std::string rootPath, std::string modeName ) {
99
104
100
105
// Sub-sequent path variable
101
106
std::string modePath ( rootPath + " /" + modeName );
@@ -115,8 +120,5 @@ void create_directories( std::string rootPath, std::string modeName ) {
115
120
116
121
}
117
122
118
- // Create debug
119
- fs::create_directory ( rootPath + " /debug" );
120
-
121
123
}
122
124
0 commit comments