Skip to content

Commit 3b3b893

Browse files
author
nils-hamel
committed
Minor corrections - Validation of densification - Tested pipeline
1 parent 043b9ea commit 3b3b893

7 files changed

+20
-17
lines changed

src/framework-database.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ int Database::prepareState(int pipeState){
243243
rangeShigh = structures.size()-1;
244244

245245
// Set structure minimal activity
246-
stateStructure = STRUCTURE_FULLVP;
246+
stateStructure = STRUCTURE_PIONER;
247247

248248
}else{
249249

@@ -281,7 +281,7 @@ void Database::prepareStructures(){
281281
structure->computeState(configGroup, rangeVhigh);
282282

283283
// Check structure state
284-
if(structure->getState()==STRUCTURE_FULLVP){
284+
if(structure->getState()==STRUCTURE_PIONER){
285285

286286
// Reset structure
287287
structure->setReset();

src/framework-feature.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void Feature::setFeature(double x, double y, int imageWidth, int imageHeight){
7676
position=Eigen::Vector2f(x,y);
7777

7878
// Compute direction vector
79-
direction=convertCartesian2Spherical(x,y,imageWidth,imageHeight);
79+
direction=utiles_direction(x,y,imageWidth,imageHeight);
8080

8181
}
8282

src/framework-structure.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void Structure::computeState(unsigned int scaleGroup, unsigned int highViewpoint
128128
if(features.size()>=scaleGroup){
129129

130130
// Assume state
131-
state=STRUCTURE_FULLVP;
131+
state=STRUCTURE_PIONER;
132132

133133
// Check if structure has continuous sequence of feature from last viewpoint
134134
for(unsigned int i(0); i<scaleGroup; i++){

src/framework-structure.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
// Define structure activity
3636
#define STRUCTURE_REMOVE ( 0 ) /* Removed by filtering process - no more usable */
3737
#define STRUCTURE_NORMAL ( 1 ) /* Normal structure, containing two features or more */
38-
#define STRUCTURE_FULLVP ( 2 ) /* Structure that contains all the last viewpoints in the pipeline active head (configGroup) */
38+
#define STRUCTURE_PIONER ( 2 ) /* Structure that contains all the last viewpoints in the pipeline active head (configGroup) */
3939

4040
// Module object
4141
class Structure {

src/framework-utiles.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,18 @@
2121

2222
#include "framework-utiles.hpp"
2323

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+
2933
}
3034

35+
/* delete */
3136
void profile(std::string msg){
3237
static struct timespec specOld;
3338
static std::string msgLast = "";
@@ -95,7 +100,7 @@ float bilinear_sample(float *p, float x, float y, int width){
95100
return (p[i00]*(1.0f-fx) + p[i01]*fx)*(1.0f-fy) + (p[i10]*(1.0f-fx) + p[i11]*fx)*fy;
96101
}
97102

98-
void create_directories( std::string rootPath, std::string modeName ) {
103+
void utiles_directories( std::string rootPath, std::string modeName ) {
99104

100105
// Sub-sequent path variable
101106
std::string modePath( rootPath + "/" + modeName );
@@ -115,8 +120,5 @@ void create_directories( std::string rootPath, std::string modeName ) {
115120

116121
}
117122

118-
// Create debug
119-
fs::create_directory( rootPath + "/debug" );
120-
121123
}
122124

src/framework-utiles.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ template<typename T> std::pair<bool, int> findInVector(
114114
return result;
115115
}
116116

117-
Eigen::Vector3d convertCartesian2Spherical (double x, double y, int width, int height);
117+
Eigen::Vector3d utiles_direction(double x, double y, int width, int height);
118+
118119
void profile(std::string msg);
119120

120121
void exitRetain();
@@ -123,5 +124,5 @@ void exitRelease();
123124
double bilinear_sample(double *p, double x, double y, int width);
124125
double bilinear_sample(float *p, double x, double y, int width);
125126

126-
void create_directories( std::string rootPath, std::string modeName );
127+
void utiles_directories( std::string rootPath, std::string modeName );
127128

src/framework.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ int main(int argc, char ** argv){
106106
//
107107

108108
// Create exportation directories
109-
create_directories(yamlExport["path"].as<std::string>(), yamlFrontend["type"].as<std::string>());
109+
utiles_directories(yamlExport["path"].as<std::string>(), yamlFrontend["type"].as<std::string>());
110110

111111
//
112112
// Framework front-end

0 commit comments

Comments
 (0)