Skip to content

Commit

Permalink
Merge tracks after finding the best match.
Browse files Browse the repository at this point in the history
  • Loading branch information
zlogic committed May 30, 2024
1 parent cc1f32f commit 758e165
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
17 changes: 9 additions & 8 deletions src/reconstruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,7 @@ pub fn reconstruct(args: &Args) -> Result<(), ReconstructionError> {
f_matrices_i.push(f);
}
f_matrices.push(f_matrices_i);

reconstruction_task.merge_tracks(img_i, img1_filename.as_str())?;
}
reconstruction_task.merge_tracks(
images_count - 1,
reconstruction_task.img_filenames[images_count - 1]
.to_owned()
.as_str(),
)?;

let linked_images = match reconstruction_task.recover_camera_poses() {
Ok(img_index) => img_index,
Expand Down Expand Up @@ -665,6 +657,15 @@ impl ImageReconstruction {
t.as_secs_f32()
);
}

images.iter().try_for_each(
|img_i| -> Result<(), triangulation::TriangulationError> {
let img_filename = self.img_filenames[*img_i].to_owned();
self.merge_tracks(*img_i, img_filename.as_str())?;
Ok(())
},
)?;

camera_order.append(&mut images);
}

Expand Down
1 change: 0 additions & 1 deletion src/triangulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,6 @@ impl PerspectiveTriangulation {
self.cameras[best_candidate] = Some(camera2);
self.projections[best_candidate] = Some(projection2);

self.triangulate_tracks();
Ok(vec![best_candidate])
}

Expand Down

0 comments on commit 758e165

Please sign in to comment.