Skip to content

Commit

Permalink
Fixed incorrect filtering of unmatched images.
Browse files Browse the repository at this point in the history
This should prevent tracks from being dropped just because they don't
match on an unused image.
  • Loading branch information
zlogic committed Jun 1, 2024
1 parent 78fe5ae commit aeaa596
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/reconstruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ impl ImageReconstruction {
}
};

for (img2_index, img2_filename) in img_filenames.iter().skip(img1_index + 1).enumerate()
for (img2_index, img2_filename) in img_filenames.iter().enumerate().skip(img1_index + 1)
{
if !linked_images.contains(&img2_index) {
continue;
Expand All @@ -701,7 +701,7 @@ impl ImageReconstruction {
};

let f_matrices_i = f_matrices[img1_index].to_owned();
let f = if let Some(f) = f_matrices_i[img2_index] {
let f = if let Some(f) = f_matrices_i[img2_index - 1 - img1_index] {
f
} else {
// No matches between images, skip correlation.
Expand All @@ -716,7 +716,7 @@ impl ImageReconstruction {
&img1,
&img2,
img1_index,
img1_index + 1 + img2_index,
img2_index,
f,
) {
Ok(_) => {}
Expand Down

0 comments on commit aeaa596

Please sign in to comment.