Skip to content

Commit

Permalink
Enhanced memory alignement.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoulon committed Jun 20, 2017
1 parent 54b3798 commit 6daf4e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/software/SfM/io_readGT.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ bool readGt(
std::string suffix,
std::vector<std::string> & vec_filenames,
std::map< std::string, std::pair<Mat3, Vec3> > & map_Rt_gt,
std::map< size_t, PinholeCamera> & map_camerasGT)
std::map< size_t, PinholeCamera, std::less<size_t>,
Eigen::aligned_allocator<std::pair<size_t, PinholeCamera>>> & map_camerasGT)
{
// IF GT_Folder exists, perform evaluation of the quality of rotation estimates
if (!stlplus::is_folder(sGTPath)) {
Expand All @@ -142,7 +143,7 @@ bool readGt(
{
std::cout << std::endl << "Read rotation and translation estimates" << std::endl;
// Load GT
std::map< std::string, Mat3 > map_R_gt;
std::map< std::string, Mat3, Eigen::aligned_allocator<Mat3> > map_R_gt;
//Try to read .suffix camera (parse camera names)
std::vector<std::string> vec_camfilenames =
stlplus::folder_wildcard(sGTPath, "*."+suffix, false, true);
Expand All @@ -155,8 +156,8 @@ bool readGt(
if (fcnReadCamPtr(stlplus::create_filespec(sGTPath, *iter), cam))
{
vec_filenames.push_back(stlplus::create_filespec(sGTPath, *iter));
map_Rt_gt[ stlplus::basename_part(*iter) ] = std::make_pair(cam._R, cam._t);
map_camerasGT[ std::distance(std::vector<std::string>::const_iterator(vec_camfilenames.begin()),iter)] = cam;
map_Rt_gt.insert({stlplus::basename_part(*iter), {cam._R, cam._t}});
map_camerasGT.insert({std::distance(vec_camfilenames.cbegin(), iter), cam});
}
else
return false;
Expand Down
3 changes: 2 additions & 1 deletion src/software/SfM/main_evalQuality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ int main(int argc, char **argv)
// Load GT camera rotations & positions [R|C]:

std::map< std::string, std::pair<Mat3, Vec3> > map_Rt_gt;
std::map< size_t, PinholeCamera> map_Cam_gt;
std::map< size_t, PinholeCamera, std::less<size_t>,
Eigen::aligned_allocator<std::pair<size_t, PinholeCamera>>> map_Cam_gt;
// READ DATA FROM GT
{
std::cout << "\nTry to read data from GT";
Expand Down

0 comments on commit 6daf4e1

Please sign in to comment.