Skip to content
Snippets Groups Projects
Commit 9dd985c2 authored by Arnau Ramisa's avatar Arnau Ramisa
Browse files

fixes

parent b94cc67c
No related branches found
No related tags found
No related merge requests found
-1.000000 -0.000000 -0.000000
-0.707107 -0.707107 -0.000000
-0.707107 -0.000000 -0.707107
-0.707107 0.707107 0.000000
-0.000000 -1.000000 -0.000000
-0.000000 -0.707107 -0.707107
-0.000000 -0.000000 -1.000000
0.000000 0.707107 -0.707107
0.000000 1.000000 0.000000
0.707107 -0.707107 0.000000
0.707107 0.000000 -0.707107
0.707107 0.707107 0.000000
1.000000 0.000000 0.000000
...@@ -8,6 +8,8 @@ include_directories(${PCL_INCLUDE_DIRS}) ...@@ -8,6 +8,8 @@ include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS}) link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS}) add_definitions(${PCL_DEFINITIONS})
SET(CMAKE_BUILD_TYPE "RELEASE")
# add the necessary include directories # add the necessary include directories
INCLUDE_DIRECTORIES(.) INCLUDE_DIRECTORIES(.)
# application source files # application source files
......
...@@ -279,7 +279,6 @@ FindddAlgorithm::FindddAlgorithm(FindddConfig new_cfg) ...@@ -279,7 +279,6 @@ FindddAlgorithm::FindddAlgorithm(FindddConfig new_cfg)
// Main function to compute FINDDD descriptors // Main function to compute FINDDD descriptors
void FindddAlgorithm::compute_ndescs_integral_spatial_interpolation(pcl::PointCloud<pcl::PointXYZ>& cloud, DescriptorSet &descriptor_set) void FindddAlgorithm::compute_ndescs_integral_spatial_interpolation(pcl::PointCloud<pcl::PointXYZ>& cloud, DescriptorSet &descriptor_set)
{ {
clock_t start=clock(); clock_t start=clock();
if(this->verbose_level_>=2) if(this->verbose_level_>=2)
{ {
......
...@@ -306,42 +306,46 @@ protected: ...@@ -306,42 +306,46 @@ protected:
float num; float num;
getline(ifs, line); getline(ifs, line);
std::istringstream iss(line); std::istringstream iss(line);
int i=0;
do do
{ {
iss >> num; iss >> num;
this->pca_mean_.push_back(num); this->pca_mean_.push_back(num);
}while(iss); }while(!iss.eof());
} }
int dout=0; int dout=0;
while (ifs.good()) while (ifs.good())
{ {
float num; float num;
this->pca_matrix_.push_back(std::vector<float>());
getline(ifs, line); getline(ifs, line);
std::istringstream iss(line); //line.erase(line.find_last_not_of(" \n\r\t")+1);
do if(line.size()>0)
{ {
iss >> num; this->pca_matrix_.push_back(std::vector<float>());
this->pca_matrix_.back().push_back(num); std::istringstream iss(line);
}while(iss); do
if(dout==0) dout=this->pca_matrix_.back().size(); {
else if(dout!=this->pca_matrix_.back().size()) iss >> num;
{ this->pca_matrix_.back().push_back(num);
if(this->verbose_level_>=1) }while(!iss.eof());
std::cout<<"Not consistent PCA data."<<std::endl; if(dout==0) dout=this->pca_matrix_.back().size();
exit(-1); else if(dout!=this->pca_matrix_.back().size())
{
if(this->verbose_level_>=1)
std::cout<<"Not consistent PCA data. Previous PCA matrix row width: "<<dout<<". Current PCA matrix row width: "<<this->pca_matrix_.back().size()<<std::endl;
exit(-1);
}
} }
} }
if(this->pca_mean_.size() != this->pca_matrix_.size()) if(this->pca_mean_.size() != this->pca_matrix_.size())
{ {
if (this->verbose_level_>=1) if (this->verbose_level_>=1)
std::cout<<"Not consistent PCA data."<<std::endl; std::cout<<"Not consistent PCA data: mean vector size: "<<this->pca_mean_.size()<<" PCA matrix size: "<<this->pca_matrix_.size()<<"x"<<pca_matrix_[0].size()<<std::endl;
exit(-1); exit(-1);
} }
//matrix correctly loaded, transposing for ease of use later //matrix correctly loaded, transposing for ease of use later
std::vector< std::vector<float> > PCA_t; std::vector< std::vector<float> > PCA_t;
PCA_t.resize(this->pca_matrix_[0].size(), std::vector<float>(this->pca_matrix_.size())); PCA_t.resize(this->pca_matrix_[0].size(), std::vector<float>(this->pca_matrix_.size()));
for(int i=0;i<this->pca_matrix_[0].size();i++) for(int i=0;i<this->pca_matrix_[0].size();i++)
for(int j=0;j<this->pca_matrix_.size();j++) for(int j=0;j<this->pca_matrix_.size();j++)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment