Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion glomap/estimators/global_rotation_averaging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ double RotationEstimator::ComputeAverageStepSize(
const std::unordered_map<frame_t, Frame>& frames) {
double total_update = 0;
for (const auto& [frame_id, frame] : frames) {
if (frames.at(frame_id).is_registered) continue;
if (!frames.at(frame_id).is_registered) continue;

if (options_.use_gravity && frame.HasGravity()) {
total_update += std::abs(tangent_space_step_[frame_id_to_idx_[frame_id]]);
Expand Down
1 change: 1 addition & 0 deletions glomap/exe/rotation_averager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ int RunRotationAverager(int argc, char** argv) {
for (auto& [image_id, image] : images) {
image.camera_id = image.image_id;
cameras[image.camera_id] = Camera();
cameras[image.camera_id].camera_id = image.camera_id;
}

CreateOneRigPerCamera(cameras, rigs);
Expand Down
1 change: 1 addition & 0 deletions glomap/io/colmap_converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ void CreateOneRigPerCamera(const std::unordered_map<camera_t, Camera>& cameras,
Rig rig;
rig.SetRigId(camera_id);
rig.AddRefSensor(camera.SensorId());
rigs[rig.RigId()] = rig;
}
}

Expand Down
12 changes: 8 additions & 4 deletions glomap/io/pose_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ void ReadRelPose(const std::string& file_path,
ViewGraph& view_graph) {
std::unordered_map<std::string, image_t> name_idx;
image_t max_image_id = 0;
camera_t max_camera_id = 0;
for (const auto& [image_id, image] : images) {
name_idx[image.file_name] = image_id;

max_image_id = std::max(max_image_id, image_id);
max_camera_id = std::max(max_camera_id, image.camera_id);
}

// Mark every edge in te view graph as invalid
Expand Down Expand Up @@ -42,14 +44,16 @@ void ReadRelPose(const std::string& file_path,

if (name_idx.find(file1) == name_idx.end()) {
max_image_id += 1;
images.insert(
std::make_pair(max_image_id, Image(max_image_id, -1, file1)));
max_camera_id += 1;
images.insert(std::make_pair(max_image_id,
Image(max_image_id, max_camera_id, file1)));
name_idx[file1] = max_image_id;
}
if (name_idx.find(file2) == name_idx.end()) {
max_image_id += 1;
images.insert(
std::make_pair(max_image_id, Image(max_image_id, -1, file2)));
max_camera_id += 1;
images.insert(std::make_pair(max_image_id,
Image(max_image_id, max_camera_id, file2)));
name_idx[file2] = max_image_id;
}

Expand Down
1 change: 1 addition & 0 deletions glomap/scene/view_graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ int ViewGraph::KeepLargestConnectedComponents(
}
}

max_img = 0;
for (auto& [image_id, image] : images) {
if (image.IsRegistered()) max_img++;
}
Expand Down
Loading