Skip to content

Commit

Permalink
Made sure to carry along node attributes during shortest path pruning
Browse files Browse the repository at this point in the history
  • Loading branch information
m-albert committed Oct 29, 2024
1 parent 6faa9b8 commit fd9189a
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/multiview_stitcher/mv_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,23 +630,11 @@ def prune_to_shortest_weighted_paths(g):
"""

g_reg = nx.Graph()
g_reg.add_nodes_from(g.nodes())
g_reg = copy.deepcopy(g)
g_reg.remove_edges_from(g_reg.edges)

ccs = list(nx.connected_components(g))

# if len(ccs) > 1:
# warnings.warn(
# """
# The provided tiles/views are not globally linked, instead there
# are %s connected components composed of the following tile indices:\n"""
# % (len(ccs))
# + "\n".join([str(list(cc)) for cc in ccs])
# + "\nProceeding without registering between the disconnected components.",
# UserWarning,
# stacklevel=1,
# )

if np.max([len(cc) for cc in ccs]) < 2:
raise (NotEnoughOverlapError("No overlap between views/tiles."))
elif np.min([len(cc) for cc in ccs]) < 2:
Expand Down

0 comments on commit fd9189a

Please sign in to comment.