Commit 26671018 authored by Adam Paquette's avatar Adam Paquette
Browse files

fixed merge conflicts

parents baf06a7d 61e54f1d
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ class CandidateGraph(nx.Graph):
        self.node_counter = 0
        node_labels = {}
        self.node_name_map = {}
        self.graph_masks = {}
        self.graph_masks = pd.DataFrame()

        # the node_name is the relative path for the image
        for node_name, node in self.nodes_iter(data=True):
@@ -368,15 +368,21 @@ class CandidateGraph(nx.Graph):
                          of keys in graph_masks
        """

        if graph_mask_keys:
            merged_graph_mask = self.graph_masks[graph_mask_keys].all(axis=1)
            edges_to_iter = merged_graph_mask[merged_graph_mask].index
        else:
            edges_to_iter = self.edges()

        if not isinstance(func, str):
            func = func.__name__

        for s, d in edges_to_iter:
            curr_edge = self.get_edge_data(s, d)
            try:
                function = getattr(curr_edge, func)
            except:
                raise AttributeError('The passed function is not an attribute of Edge')
                raise AttributeError(func, ' is not an attribute of Edge')
            else:
                function(*args, **kwargs)

@@ -391,7 +397,9 @@ class CandidateGraph(nx.Graph):
           boolean mask for edges in the minimum spanning tree
        """

        self.graph_masks = pd.DataFrame(False, index=self.edges(), columns=['mst'])
        graph_mask = pd.Series(False, index=self.edges())
        self.graph_masks['mst'] = graph_mask

        mst = nx.minimum_spanning_tree(self)
        self.graph_masks['mst'][mst.edges()] = True

@@ -503,7 +511,6 @@ class CandidateGraph(nx.Graph):
             : C
               the cleaned control network
            """

            mask = np.zeros(len(cnet), dtype=bool)
            counter = 0
            for i, group in cnet.groupby('pid'):
+2 −1
Original line number Diff line number Diff line
@@ -52,7 +52,8 @@ class TestThreeImageMatching(unittest.TestCase):
        for source, destination, edge in cg.edges_iter(data=True):
            edge.symmetry_check()
            edge.ratio_check(clean_keys=['symmetry'], ratio=0.99)
        cg.compute_homographies(clean_keys=['symmetry', 'ratio'])

        cg.apply_func_to_edges("compute_homography", clean_keys=['symmetry', 'ratio'])

        # Step: And create a C object
        cnet = cg.to_cnet(clean_keys=['symmetry', 'ratio', 'ransac'])
+2 −2
Original line number Diff line number Diff line
@@ -73,14 +73,14 @@ class TestTwoImageMatching(unittest.TestCase):
            self.assertIn(edge.masks['ratio'].sum(), range(40, 100))

        # Step: Compute the homographies and apply RANSAC
        cg.compute_homographies(clean_keys=['symmetry', 'ratio'])
        cg.apply_func_to_edges("compute_homography", clean_keys=['symmetry', 'ratio'])

        # Step: Compute the overlap ratio and coverage ratio
        for s, d, edge in cg.edges_iter(data=True):
            edge.coverage_ratio(clean_keys=['symmetry', 'ratio'])

        # Step: Compute subpixel offsets for candidate points
        cg.subpixel_register(clean_keys=['ransac'])
        cg.apply_func_to_edges("subpixel_register", clean_keys=['ransac'])

        # Step: And create a C object
        cnet = cg.to_cnet(clean_keys=['symmetry', 'ratio', 'ransac', 'subpixel'])
+61 −35

File changed.

Preview size limit exceeded, changes collapsed.