Skip to content

Commit

Permalink
[tracks] minor fix for union_find (algo and usage) openMVG#939
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoulon committed Jun 1, 2017
1 parent 70eb18a commit f5f4525
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/openMVG/tracks/tracks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ struct TracksBuilder
// Build tracks from the UF tree, track problematic ids.
for (uint32_t k = 0; k < map_node_to_index.size(); ++k)
{
const uint32_t & track_id = uf_tree.m_cc_parent[k];
const uint32_t & track_id = uf_tree.Find(k);
if (problematic_track_id.count(track_id) != 0)
continue; // Track already marked

Expand Down
2 changes: 1 addition & 1 deletion src/openMVG/tracks/union_find.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ struct UnionFind
{
m_cc_parent[j] = i;
m_cc_size[i] += m_cc_size[j];
if (m_cc_rank[i] > m_cc_rank[j])
if (m_cc_rank[i] == m_cc_rank[j])
++m_cc_rank[i];
}
}
Expand Down

0 comments on commit f5f4525

Please sign in to comment.