Commit 92c74089 authored by Jay's avatar Jay Committed by jay
Browse files

Post review.

parent 74160bf6
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -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
@@ -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
@@ -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:
+2 −1
Original line number Diff line number Diff line
@@ -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