Loading CHANGELOG.md +3 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,9 @@ heading to indicate that only the bug fixes and security fixes are in the bug fi release. --> ## [Unreleased] ### Fixed - Errors when importing sensor model in `overlap.py` - Dealt with None values trying to be converted to a shapely point in `centroids.py` ## [1.1.0] ### Added Loading autocnet/spatial/centroids.py +11 −3 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ from autocnet.cg.cg import create_points_along_line from autocnet.io.db.model import Images, Points, JsonEncoder from autocnet.graph.node import NetworkNode from autocnet.spatial import isis from autocnet.spatial import sensor from autocnet.transformation import roi from autocnet.matcher.cpu_extractor import extract_most_interesting from autocnet.matcher.validation import is_valid_lroc_polar_image Loading Loading @@ -178,13 +179,17 @@ def find_intresting_point(nodes, lon, lat, size=71): log.debug(f'Trying image: {node["image_path"].split("/")[-1]}') # reference_index is the index into the list of measures for the image that is not shifted and is set at the # reference against which all other images are registered. sample, line = isis.ground_to_image(node["image_path"], lon, lat) try_sample, try_line = isis.ground_to_image(node["image_path"], lon, lat) # If sample/line are None, point is not in image if sample == None or line == None: if try_sample == None or try_line == None: log.info(f'point ({lon}, {lat}) does not project to reference image {node["image_path"]}') continue # This a prevention in case the last sample/line are NULL when itterating sample = try_sample line = try_line # Extract ORB features in a sub-image around the desired point image_roi = roi.Roi(node.geodata, sample, line, size_x=size, size_y=size) try: Loading Loading @@ -346,8 +351,11 @@ def add_point_to_network(valid, # It has been added by the create_point_with_reference_measure function. del nodes[reference_index] # Determine what sensor type to use current_sensor = sensor.create_sensor('isis') # Iterate through all other, non-reference images in the overlap and attempt to add a measure. point.add_measures_to_point(nodes, choosername=identifier) point.add_measures_to_point(nodes, current_sensor, choosername=identifier) # Insert the point into the database asynchronously (via redis) or synchronously via the ncg if use_cache: Loading autocnet/spatial/overlap.py +6 −6 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ def place_points_in_overlap(overlap, raise BrokenPipeError('This func requires a database session from a NetworkCandidateGraph.') # Determine what sensor type to use sensor = sensor.create_sensor(cam_type) current_sensor = sensor.create_sensor(cam_type) # Determine the point distribution in the overlap geom geom = overlap.geom Loading @@ -240,7 +240,7 @@ def place_points_in_overlap(overlap, for valid in candidate_points: add_point_to_overlap_network(valid, nodes, sensor, current_sensor, geom, identifier=identifier, interesting_func=interesting_func, Loading @@ -254,7 +254,7 @@ def place_points_in_overlap(overlap, def add_point_to_overlap_network(valid, nodes, sensor, current_sensor, geom, identifier="place_points_in_overlap", interesting_func=find_interesting_point, Loading @@ -275,8 +275,8 @@ def add_point_to_overlap_network(valid, nodes: list list of node objects (the images) sensor: string sensor that is being used, either isis or csm current_sensor: string current_sensor that is being used, either isis or csm geom: obj overlap geom to be used Loading Loading @@ -358,7 +358,7 @@ def add_point_to_overlap_network(valid, # TODO: Take this projection out of the CSM model and work it into the point kwargs['needs_projection']=False # Iterate through all other, non-reference images in the overlap and attempt to add a measure. point.add_measures_to_point(nodes, sensor, choosername=identifier, **csm_kwargs) point.add_measures_to_point(nodes, current_sensor, choosername=identifier, **csm_kwargs) # Insert the point into the database asynchronously (via redis) or synchronously via the ncg if use_cache: Loading Loading
CHANGELOG.md +3 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,9 @@ heading to indicate that only the bug fixes and security fixes are in the bug fi release. --> ## [Unreleased] ### Fixed - Errors when importing sensor model in `overlap.py` - Dealt with None values trying to be converted to a shapely point in `centroids.py` ## [1.1.0] ### Added Loading
autocnet/spatial/centroids.py +11 −3 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ from autocnet.cg.cg import create_points_along_line from autocnet.io.db.model import Images, Points, JsonEncoder from autocnet.graph.node import NetworkNode from autocnet.spatial import isis from autocnet.spatial import sensor from autocnet.transformation import roi from autocnet.matcher.cpu_extractor import extract_most_interesting from autocnet.matcher.validation import is_valid_lroc_polar_image Loading Loading @@ -178,13 +179,17 @@ def find_intresting_point(nodes, lon, lat, size=71): log.debug(f'Trying image: {node["image_path"].split("/")[-1]}') # reference_index is the index into the list of measures for the image that is not shifted and is set at the # reference against which all other images are registered. sample, line = isis.ground_to_image(node["image_path"], lon, lat) try_sample, try_line = isis.ground_to_image(node["image_path"], lon, lat) # If sample/line are None, point is not in image if sample == None or line == None: if try_sample == None or try_line == None: log.info(f'point ({lon}, {lat}) does not project to reference image {node["image_path"]}') continue # This a prevention in case the last sample/line are NULL when itterating sample = try_sample line = try_line # Extract ORB features in a sub-image around the desired point image_roi = roi.Roi(node.geodata, sample, line, size_x=size, size_y=size) try: Loading Loading @@ -346,8 +351,11 @@ def add_point_to_network(valid, # It has been added by the create_point_with_reference_measure function. del nodes[reference_index] # Determine what sensor type to use current_sensor = sensor.create_sensor('isis') # Iterate through all other, non-reference images in the overlap and attempt to add a measure. point.add_measures_to_point(nodes, choosername=identifier) point.add_measures_to_point(nodes, current_sensor, choosername=identifier) # Insert the point into the database asynchronously (via redis) or synchronously via the ncg if use_cache: Loading
autocnet/spatial/overlap.py +6 −6 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ def place_points_in_overlap(overlap, raise BrokenPipeError('This func requires a database session from a NetworkCandidateGraph.') # Determine what sensor type to use sensor = sensor.create_sensor(cam_type) current_sensor = sensor.create_sensor(cam_type) # Determine the point distribution in the overlap geom geom = overlap.geom Loading @@ -240,7 +240,7 @@ def place_points_in_overlap(overlap, for valid in candidate_points: add_point_to_overlap_network(valid, nodes, sensor, current_sensor, geom, identifier=identifier, interesting_func=interesting_func, Loading @@ -254,7 +254,7 @@ def place_points_in_overlap(overlap, def add_point_to_overlap_network(valid, nodes, sensor, current_sensor, geom, identifier="place_points_in_overlap", interesting_func=find_interesting_point, Loading @@ -275,8 +275,8 @@ def add_point_to_overlap_network(valid, nodes: list list of node objects (the images) sensor: string sensor that is being used, either isis or csm current_sensor: string current_sensor that is being used, either isis or csm geom: obj overlap geom to be used Loading Loading @@ -358,7 +358,7 @@ def add_point_to_overlap_network(valid, # TODO: Take this projection out of the CSM model and work it into the point kwargs['needs_projection']=False # Iterate through all other, non-reference images in the overlap and attempt to add a measure. point.add_measures_to_point(nodes, sensor, choosername=identifier, **csm_kwargs) point.add_measures_to_point(nodes, current_sensor, choosername=identifier, **csm_kwargs) # Insert the point into the database asynchronously (via redis) or synchronously via the ncg if use_cache: Loading