Loading autocnet/matcher/matcher.py +9 −5 Original line number Diff line number Diff line Loading @@ -3,11 +3,11 @@ import numpy as np import pandas as pd from autocnet.graph.network import CandidateGraph FLANN_INDEX_KDTREE = 1 FLANN_INDEX_KDTREE = 1 # Algorithm to set centers, DEFAULT_FLANN_PARAMETERS = dict(algorithm=FLANN_INDEX_KDTREE, trees=3) class FlannMatcher(object): """ A wrapper to the OpenCV Flann based matcher class that adds Loading @@ -18,7 +18,8 @@ class FlannMatcher(object): Attributes ---------- image_indices : dict with key equal to the train image idx (returned by the DMatch object) with key equal to the train image index (returned by the DMatch object), e.g. an integer array index and value equal to the image identifier, e.g. the name image_index_counter : int Loading Loading @@ -66,11 +67,14 @@ class FlannMatcher(object): self_neighbor : bool If the query descriptor is also a member of the train descriptors, default True of the KDTree avoid self neighbor, default True. Returns ------- matched : dataframe containing matched points containing matched points with columns containg: matched image name, query index, train index, and descriptor distance """ idx = 0 if self_neighbor: Loading autocnet/matcher/tests/test_matcher.py +2 −1 Original line number Diff line number Diff line Loading @@ -62,5 +62,6 @@ class TestMatcher(unittest.TestCase): # Check that self neighbors are being omitted distance = matched['distance'] self.assertFalse(distance[distance == 0].any()) def tearDown(self): pass Loading
autocnet/matcher/matcher.py +9 −5 Original line number Diff line number Diff line Loading @@ -3,11 +3,11 @@ import numpy as np import pandas as pd from autocnet.graph.network import CandidateGraph FLANN_INDEX_KDTREE = 1 FLANN_INDEX_KDTREE = 1 # Algorithm to set centers, DEFAULT_FLANN_PARAMETERS = dict(algorithm=FLANN_INDEX_KDTREE, trees=3) class FlannMatcher(object): """ A wrapper to the OpenCV Flann based matcher class that adds Loading @@ -18,7 +18,8 @@ class FlannMatcher(object): Attributes ---------- image_indices : dict with key equal to the train image idx (returned by the DMatch object) with key equal to the train image index (returned by the DMatch object), e.g. an integer array index and value equal to the image identifier, e.g. the name image_index_counter : int Loading Loading @@ -66,11 +67,14 @@ class FlannMatcher(object): self_neighbor : bool If the query descriptor is also a member of the train descriptors, default True of the KDTree avoid self neighbor, default True. Returns ------- matched : dataframe containing matched points containing matched points with columns containg: matched image name, query index, train index, and descriptor distance """ idx = 0 if self_neighbor: Loading
autocnet/matcher/tests/test_matcher.py +2 −1 Original line number Diff line number Diff line Loading @@ -62,5 +62,6 @@ class TestMatcher(unittest.TestCase): # Check that self neighbors are being omitted distance = matched['distance'] self.assertFalse(distance[distance == 0].any()) def tearDown(self): pass