diff --git a/glomap/processors/reconstruction_normalizer.cc b/glomap/processors/reconstruction_normalizer.cc index 9679569..b2af04a 100644 --- a/glomap/processors/reconstruction_normalizer.cc +++ b/glomap/processors/reconstruction_normalizer.cc @@ -2,14 +2,14 @@ namespace glomap { -colmap::Sim3d NormalizeReconstruction(std::unordered_map& cameras, - std::unordered_map& images, - std::unordered_map& tracks, - bool fixed_scale, - double extent, - double p0, - double p1) { - +colmap::Sim3d NormalizeReconstruction( + std::unordered_map& cameras, + std::unordered_map& images, + std::unordered_map& tracks, + bool fixed_scale, + double extent, + double p0, + double p1) { // Coordinates of image centers or point locations. std::vector coords_x; std::vector coords_y; @@ -18,9 +18,8 @@ colmap::Sim3d NormalizeReconstruction(std::unordered_map& came coords_x.reserve(images.size()); coords_y.reserve(images.size()); coords_z.reserve(images.size()); - for (const auto &[image_id, image] : images) { - if (!image.is_registered) - continue; + for (const auto& [image_id, image] : images) { + if (!image.is_registered) continue; const Eigen::Vector3d proj_center = image.Center(); coords_x.push_back(static_cast(proj_center(0))); coords_y.push_back(static_cast(proj_center(1))); @@ -65,7 +64,7 @@ colmap::Sim3d NormalizeReconstruction(std::unordered_map& came image.cam_from_world = TransformCameraWorld(tform, image.cam_from_world); } } - + for (auto& [_, track] : tracks) { track.xyz = tform * track.xyz; } @@ -73,5 +72,4 @@ colmap::Sim3d NormalizeReconstruction(std::unordered_map& came return tform; } - } // namespace glomap \ No newline at end of file diff --git a/glomap/processors/reconstruction_normalizer.h b/glomap/processors/reconstruction_normalizer.h index 31447b7..51d51fd 100644 --- a/glomap/processors/reconstruction_normalizer.h +++ b/glomap/processors/reconstruction_normalizer.h @@ -1,15 +1,17 @@ #pragma once #include "glomap/scene/types_sfm.h" + #include "colmap/geometry/pose.h" namespace glomap { -colmap::Sim3d NormalizeReconstruction(std::unordered_map& cameras, - std::unordered_map& images, - std::unordered_map& tracks, - bool fixed_scale = false, - double extent = 10., - double p0 = 0.1, - double p1 = 0.9); +colmap::Sim3d NormalizeReconstruction( + std::unordered_map& cameras, + std::unordered_map& images, + std::unordered_map& tracks, + bool fixed_scale = false, + double extent = 10., + double p0 = 0.1, + double p1 = 0.9); } // namespace glomap