Loading autocnet/graph/network.py +4 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,10 @@ class CandidateGraph(nx.Graph): : object A Network graph object """ if not isinstance(filelist, list): with open(filelist, 'r') as f: filelist = f.readlines() filelist = map(str.rstrip, filelist) # TODO: Reject unsupported file formats + work with more file formats Loading bin/image_match.py +41 −19 Original line number Diff line number Diff line Loading @@ -8,9 +8,20 @@ from autocnet.graph.network import CandidateGraph from autocnet.fileio.io_controlnetwork import to_isis from autocnet.fileio.io_controlnetwork import write_filelist # parses command line arguments into a single args variable def parse_arguments(): parser = argparse.ArgumentParser() parser.add_argument('input_filename', action='store', help='Provide the name of the file list/adjacency list') parser.add_argument('output_filename', action='store', help='Provide the name of the output file') args = parser.parse_args() return args def match_images(args): # Matches the images in the input file using various candidate graph methods # produces two files usable in isis cg = CandidateGraph.from_adjacency(sys.argv[1], basepath='') cg = CandidateGraph.from_adjacency(args.input_filename, basepath='') # Apply SIFT to extract features cg.extract_features(method='sift', extractor_parameters={'nfeatures': 1000}) Loading @@ -34,7 +45,18 @@ cg.suppress(clean_keys=['fundamental'], k=50) cnet = cg.to_cnet(clean_keys=['subpixel'], isis_serials=True) filelist = cg.to_filelist() write_filelist(filelist,'TestFile.lis') write_filelist(filelist, args.output_filename + '.lis') to_isis(args.output_filename + '.net', cnet, mode='wb', targetname='Moon') if __name__ == '__main__': command_line_args = parse_arguments() match_images(command_line_args) to_isis('TestFile.net', cnet, mode='wb', targetname='Moon') file = CandidateGraph.from_filelist(["/home/acpaquette/Desktop/AS15-M-0414_sub4.cub", "/home/acpaquette/Desktop/AS15-M-0413_sub4.cub", "/home/acpaquette/Desktop/AS15-M-0412_sub4.cub"]) file2 = CandidateGraph.from_filelist('/home/acpaquette/autocnet/autocnet/examples/Apollo15/user_image_list.json') print(file2) No newline at end of file Loading
autocnet/graph/network.py +4 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,10 @@ class CandidateGraph(nx.Graph): : object A Network graph object """ if not isinstance(filelist, list): with open(filelist, 'r') as f: filelist = f.readlines() filelist = map(str.rstrip, filelist) # TODO: Reject unsupported file formats + work with more file formats Loading
bin/image_match.py +41 −19 Original line number Diff line number Diff line Loading @@ -8,9 +8,20 @@ from autocnet.graph.network import CandidateGraph from autocnet.fileio.io_controlnetwork import to_isis from autocnet.fileio.io_controlnetwork import write_filelist # parses command line arguments into a single args variable def parse_arguments(): parser = argparse.ArgumentParser() parser.add_argument('input_filename', action='store', help='Provide the name of the file list/adjacency list') parser.add_argument('output_filename', action='store', help='Provide the name of the output file') args = parser.parse_args() return args def match_images(args): # Matches the images in the input file using various candidate graph methods # produces two files usable in isis cg = CandidateGraph.from_adjacency(sys.argv[1], basepath='') cg = CandidateGraph.from_adjacency(args.input_filename, basepath='') # Apply SIFT to extract features cg.extract_features(method='sift', extractor_parameters={'nfeatures': 1000}) Loading @@ -34,7 +45,18 @@ cg.suppress(clean_keys=['fundamental'], k=50) cnet = cg.to_cnet(clean_keys=['subpixel'], isis_serials=True) filelist = cg.to_filelist() write_filelist(filelist,'TestFile.lis') write_filelist(filelist, args.output_filename + '.lis') to_isis(args.output_filename + '.net', cnet, mode='wb', targetname='Moon') if __name__ == '__main__': command_line_args = parse_arguments() match_images(command_line_args) to_isis('TestFile.net', cnet, mode='wb', targetname='Moon') file = CandidateGraph.from_filelist(["/home/acpaquette/Desktop/AS15-M-0414_sub4.cub", "/home/acpaquette/Desktop/AS15-M-0413_sub4.cub", "/home/acpaquette/Desktop/AS15-M-0412_sub4.cub"]) file2 = CandidateGraph.from_filelist('/home/acpaquette/autocnet/autocnet/examples/Apollo15/user_image_list.json') print(file2) No newline at end of file