Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
lpanaf committed Nov 19, 2024
1 parent b5c342b commit 03d2f33
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
24 changes: 11 additions & 13 deletions glomap/processors/reconstruction_normalizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace glomap {

colmap::Sim3d NormalizeReconstruction(std::unordered_map<camera_t, Camera>& cameras,
std::unordered_map<image_t, Image>& images,
std::unordered_map<track_t, Track>& tracks,
bool fixed_scale,
double extent,
double p0,
double p1) {

colmap::Sim3d NormalizeReconstruction(
std::unordered_map<camera_t, Camera>& cameras,
std::unordered_map<image_t, Image>& images,
std::unordered_map<track_t, Track>& tracks,
bool fixed_scale,
double extent,
double p0,
double p1) {
// Coordinates of image centers or point locations.
std::vector<float> coords_x;
std::vector<float> coords_y;
Expand All @@ -18,9 +18,8 @@ colmap::Sim3d NormalizeReconstruction(std::unordered_map<camera_t, Camera>& 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<float>(proj_center(0)));
coords_y.push_back(static_cast<float>(proj_center(1)));
Expand Down Expand Up @@ -65,13 +64,12 @@ colmap::Sim3d NormalizeReconstruction(std::unordered_map<camera_t, Camera>& came
image.cam_from_world = TransformCameraWorld(tform, image.cam_from_world);
}
}

for (auto& [_, track] : tracks) {
track.xyz = tform * track.xyz;
}

return tform;
}


} // namespace glomap
16 changes: 9 additions & 7 deletions glomap/processors/reconstruction_normalizer.h
Original file line number Diff line number Diff line change
@@ -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<camera_t, Camera>& cameras,
std::unordered_map<image_t, Image>& images,
std::unordered_map<track_t, Track>& tracks,
bool fixed_scale = false,
double extent = 10.,
double p0 = 0.1,
double p1 = 0.9);
colmap::Sim3d NormalizeReconstruction(
std::unordered_map<camera_t, Camera>& cameras,
std::unordered_map<image_t, Image>& images,
std::unordered_map<track_t, Track>& tracks,
bool fixed_scale = false,
double extent = 10.,
double p0 = 0.1,
double p1 = 0.9);
} // namespace glomap

0 comments on commit 03d2f33

Please sign in to comment.