Loading autocnet/cg/cg.py +6 −5 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ import json import ogr import pandas as pd from autocnet.fileio import io_gdal from scipy.spatial import ConvexHull Loading Loading @@ -61,9 +60,9 @@ def convex_hull(points): Returns ------- hull_poly : ogr an ogr polygon that is built out of the convex_hull hull : 2-D convex hull Provides a convex hull that is used to determine coverage """ Loading @@ -73,6 +72,7 @@ def convex_hull(points): hull = ConvexHull(points) return hull def two_poly_overlap(poly1, poly2): """ Loading @@ -89,7 +89,8 @@ def two_poly_overlap(poly1, poly2): Returns ------- overlap_info : list The ratio convex hull volume / ideal_area Percentage of overlap between the two images and the area that is being overlapped """ a_o = poly2.Intersection(poly1).GetArea() Loading autocnet/graph/edge.py +5 −2 Original line number Diff line number Diff line import warnings from collections import MutableMapping import json import ogr import numpy as np import pandas as pd Loading Loading @@ -422,6 +420,11 @@ class Edge(dict, MutableMapping): return matches, mask def overlap(self): """ Acts on an edge and returns the overlap area and percentage of overlap between the two images on the edge. Data is returned to the weight dictionary """ poly1 = self.source.geodata.footprint poly2 = self.destination.geodata.footprint Loading autocnet/graph/node.py +12 −3 Original line number Diff line number Diff line from collections import MutableMapping import os import warnings import json import ogr import numpy as np import pandas as pd from scipy.misc import bytescale from scipy.spatial import ConvexHull from autocnet.cg import cg from autocnet.fileio.io_gdal import GeoDataset Loading Loading @@ -119,6 +116,18 @@ class Node(dict, MutableMapping): return self._isis_serial def coverage(self): """ Determines the area of keypoint coverage using the unprojected image, resulting in a rough estimation of the area being covered. Returns ------- coverage_area : float Area covered by the generated keypoints """ points = self.get_keypoint_coordinates() hull = cg.convex_hull(points) hull_area = hull.volume Loading autocnet/graph/tests/test_node.py +0 −2 Original line number Diff line number Diff line Loading @@ -7,8 +7,6 @@ import warnings import numpy as np import pandas as pd from autocnet.graph.network import CandidateGraph from autocnet.graph import node from autocnet.examples import get_path from autocnet.fileio.io_gdal import GeoDataset Loading Loading
autocnet/cg/cg.py +6 −5 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ import json import ogr import pandas as pd from autocnet.fileio import io_gdal from scipy.spatial import ConvexHull Loading Loading @@ -61,9 +60,9 @@ def convex_hull(points): Returns ------- hull_poly : ogr an ogr polygon that is built out of the convex_hull hull : 2-D convex hull Provides a convex hull that is used to determine coverage """ Loading @@ -73,6 +72,7 @@ def convex_hull(points): hull = ConvexHull(points) return hull def two_poly_overlap(poly1, poly2): """ Loading @@ -89,7 +89,8 @@ def two_poly_overlap(poly1, poly2): Returns ------- overlap_info : list The ratio convex hull volume / ideal_area Percentage of overlap between the two images and the area that is being overlapped """ a_o = poly2.Intersection(poly1).GetArea() Loading
autocnet/graph/edge.py +5 −2 Original line number Diff line number Diff line import warnings from collections import MutableMapping import json import ogr import numpy as np import pandas as pd Loading Loading @@ -422,6 +420,11 @@ class Edge(dict, MutableMapping): return matches, mask def overlap(self): """ Acts on an edge and returns the overlap area and percentage of overlap between the two images on the edge. Data is returned to the weight dictionary """ poly1 = self.source.geodata.footprint poly2 = self.destination.geodata.footprint Loading
autocnet/graph/node.py +12 −3 Original line number Diff line number Diff line from collections import MutableMapping import os import warnings import json import ogr import numpy as np import pandas as pd from scipy.misc import bytescale from scipy.spatial import ConvexHull from autocnet.cg import cg from autocnet.fileio.io_gdal import GeoDataset Loading Loading @@ -119,6 +116,18 @@ class Node(dict, MutableMapping): return self._isis_serial def coverage(self): """ Determines the area of keypoint coverage using the unprojected image, resulting in a rough estimation of the area being covered. Returns ------- coverage_area : float Area covered by the generated keypoints """ points = self.get_keypoint_coordinates() hull = cg.convex_hull(points) hull_area = hull.volume Loading
autocnet/graph/tests/test_node.py +0 −2 Original line number Diff line number Diff line Loading @@ -7,8 +7,6 @@ import warnings import numpy as np import pandas as pd from autocnet.graph.network import CandidateGraph from autocnet.graph import node from autocnet.examples import get_path from autocnet.fileio.io_gdal import GeoDataset Loading