Loading .coveragerc +1 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ omit = autocnet/fileio/ControlNetFileV0002_pb2.py autocnet/vis/graph_view.py autocnet/fileio/sqlalchemy_json/* bin/* exclude_lines = pragma: no cover def __repr__ Loading autocnet/graph/network.py +4 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,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 +36 −17 Original line number Diff line number Diff line Loading @@ -8,7 +8,24 @@ from autocnet.graph.network import CandidateGraph from autocnet.fileio.io_controlnetwork import to_isis from autocnet.fileio.io_controlnetwork import write_filelist cg = CandidateGraph.from_adjacency(sys.argv[1], basepath='') # parses command line arguments into a single args variable def parse_arguments(): parser = argparse.ArgumentParser() parser.add_argument('-i', action='store', dest='input_file', default='No_Input', help='Provide the name of the file list/adjacency list') parser.add_argument('-o', action='store', dest='output_file', help='Provide the name of the output file') parser.add_argument('-p', action='store', dest='basepath', help='Provide the path to the image files') 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 try: cg = CandidateGraph.from_adjacency(args.input_file, basepath=args.basepath) except: cg = CandidateGraph.from_filelist(args.input_file) # Apply SIFT to extract features cg.extract_features(method='sift', extractor_parameters={'nfeatures': 1000}) Loading @@ -20,8 +37,6 @@ cg.match_features() cg.symmetry_checks() cg.ratio_checks() m = cg.edge[0][1].masks # Compute a homography and apply RANSAC cg.compute_fundamental_matrices(clean_keys=['ratio', 'symmetry']) Loading @@ -32,6 +47,10 @@ cg.suppress(clean_keys=['fundamental'], k=50) cnet = cg.to_cnet(clean_keys=['subpixel'], isis_serials=True) filelist = cg.to_filelist() write_filelist(filelist, 'TestList.lis') write_filelist(filelist, args.output_file + '.lis') to_isis(args.output_file + '.net', cnet, mode='wb', targetname='Moon') to_isis('TestList.net', cnet, mode='wb', targetname='Moon') if __name__ == '__main__': command_line_args = parse_arguments() match_images(command_line_args) No newline at end of file Loading
.coveragerc +1 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ omit = autocnet/fileio/ControlNetFileV0002_pb2.py autocnet/vis/graph_view.py autocnet/fileio/sqlalchemy_json/* bin/* exclude_lines = pragma: no cover def __repr__ Loading
autocnet/graph/network.py +4 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,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 +36 −17 Original line number Diff line number Diff line Loading @@ -8,7 +8,24 @@ from autocnet.graph.network import CandidateGraph from autocnet.fileio.io_controlnetwork import to_isis from autocnet.fileio.io_controlnetwork import write_filelist cg = CandidateGraph.from_adjacency(sys.argv[1], basepath='') # parses command line arguments into a single args variable def parse_arguments(): parser = argparse.ArgumentParser() parser.add_argument('-i', action='store', dest='input_file', default='No_Input', help='Provide the name of the file list/adjacency list') parser.add_argument('-o', action='store', dest='output_file', help='Provide the name of the output file') parser.add_argument('-p', action='store', dest='basepath', help='Provide the path to the image files') 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 try: cg = CandidateGraph.from_adjacency(args.input_file, basepath=args.basepath) except: cg = CandidateGraph.from_filelist(args.input_file) # Apply SIFT to extract features cg.extract_features(method='sift', extractor_parameters={'nfeatures': 1000}) Loading @@ -20,8 +37,6 @@ cg.match_features() cg.symmetry_checks() cg.ratio_checks() m = cg.edge[0][1].masks # Compute a homography and apply RANSAC cg.compute_fundamental_matrices(clean_keys=['ratio', 'symmetry']) Loading @@ -32,6 +47,10 @@ cg.suppress(clean_keys=['fundamental'], k=50) cnet = cg.to_cnet(clean_keys=['subpixel'], isis_serials=True) filelist = cg.to_filelist() write_filelist(filelist, 'TestList.lis') write_filelist(filelist, args.output_file + '.lis') to_isis(args.output_file + '.net', cnet, mode='wb', targetname='Moon') to_isis('TestList.net', cnet, mode='wb', targetname='Moon') if __name__ == '__main__': command_line_args = parse_arguments() match_images(command_line_args) No newline at end of file