Skip to content

Commit

Permalink
Fix model_cropper not resetting image.num_points3D of cropped_rec (#2557
Browse files Browse the repository at this point in the history
)

* Fix model_cropper not resetting image.num_points3D for cropped_reconstruction

* code consistency

---------

Co-authored-by: Johannes Schönberger <joschonb@microsoft.com>
  • Loading branch information
ArneSchulzTUBS and ahojnnes committed May 9, 2024
1 parent d84c5b6 commit eaffee3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/colmap/scene/reconstruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,9 @@ Reconstruction Reconstruction::Crop(
for (const auto& image : images_) {
auto new_image = image.second;
new_image.SetRegistered(false);
for (auto& point2D : new_image.Points2D()) {
point2D.point3D_id = kInvalidPoint3DId;
const auto num_points2D = new_image.NumPoints2D();
for (point2D_t point2D_idx = 0; point2D_idx < num_points2D; ++point2D_idx) {
new_image.ResetPoint3DForPoint2D(point2D_idx);
}
cropped_reconstruction.AddImage(std::move(new_image));
}
Expand Down

0 comments on commit eaffee3

Please sign in to comment.