Loading autocnet/graph/network.py +1 −0 Original line number Diff line number Diff line Loading @@ -59,3 +59,4 @@ class CandidateGraph(DiGraph): adjacency_dict = io_json.read_json(inputfile) return cls(adjacency_dict) functional_tests/test_two_image.py +12 −4 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ from autocnet.examples import get_path from autocnet.fileio.io_gdal import GeoDataset from autocnet.fileio.io_controlnetwork import to_isis from autocnet.graph.network import CandidateGraph from autocnet.matcher.matcher import FlannMatcher class TestTwoImageMatching(unittest.TestCase): """ Loading @@ -22,8 +22,8 @@ class TestTwoImageMatching(unittest.TestCase): Then extract image data and attribute nodes And find features and descriptors Then tag these to the graph nodes Then apply a FLANN matcher And create a C object And apply a FLANN matcher Then create a C object from the graph matches Then output a control network """ Loading @@ -45,10 +45,18 @@ class TestTwoImageMatching(unittest.TestCase): # Step: And tag these to the graph nodes for node, attributes in cg.nodes_iter(data=True): attributes['features'] = 'a' # Will be our feature/descriptor data structure attributes['keypoints'] = 'a' # Will be our feature/descriptor data structure attributes['descriptors'] = 'b' # Step: Then apply a FLANN matcher fl = FlannMatcher() for node, attributes in cg.nodes_iter(data=True): fl.add(attributes['descriptors']) fl.train() for node, attributes in cg.nodes_iter(data=True): descriptors = attributes['descriptors'] attributes['matches'] = fl.query(descriptors, k=2) # Step: And create a C object cnet = C() Loading Loading
autocnet/graph/network.py +1 −0 Original line number Diff line number Diff line Loading @@ -59,3 +59,4 @@ class CandidateGraph(DiGraph): adjacency_dict = io_json.read_json(inputfile) return cls(adjacency_dict)
functional_tests/test_two_image.py +12 −4 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ from autocnet.examples import get_path from autocnet.fileio.io_gdal import GeoDataset from autocnet.fileio.io_controlnetwork import to_isis from autocnet.graph.network import CandidateGraph from autocnet.matcher.matcher import FlannMatcher class TestTwoImageMatching(unittest.TestCase): """ Loading @@ -22,8 +22,8 @@ class TestTwoImageMatching(unittest.TestCase): Then extract image data and attribute nodes And find features and descriptors Then tag these to the graph nodes Then apply a FLANN matcher And create a C object And apply a FLANN matcher Then create a C object from the graph matches Then output a control network """ Loading @@ -45,10 +45,18 @@ class TestTwoImageMatching(unittest.TestCase): # Step: And tag these to the graph nodes for node, attributes in cg.nodes_iter(data=True): attributes['features'] = 'a' # Will be our feature/descriptor data structure attributes['keypoints'] = 'a' # Will be our feature/descriptor data structure attributes['descriptors'] = 'b' # Step: Then apply a FLANN matcher fl = FlannMatcher() for node, attributes in cg.nodes_iter(data=True): fl.add(attributes['descriptors']) fl.train() for node, attributes in cg.nodes_iter(data=True): descriptors = attributes['descriptors'] attributes['matches'] = fl.query(descriptors, k=2) # Step: And create a C object cnet = C() Loading