Exemplo n.º 1
0
    def locateInFeatures(self, features):
        """
        """
        start = time.time()
        
        matches = matchup.find_matches(features, self.features)
        matches_graph = matchup.group_matches(matches, features, self.features)
        needles = matchup.find_needles(matches, matches_graph, features, self.features)
        
        print >> sys.stderr, 'Found', len(needles), 'needles',
        print >> sys.stderr, 'in %.2f sec.' % (time.time() - start)
        
        assert len(needles) == 1, 'Got %d needle matches instead of 1' % len(needles)
        fs1, fs2, transform = needles[0]
        
        print >> sys.stderr, (self.anchor.x, self.anchor.y),

        x, y = transform(self.anchor.x, self.anchor.y)
        print >> sys.stderr, '->', '(%.2f, %.2f)' % (x, y),

        self.anchor = Point(x, y)
Exemplo n.º 2
0
 def markersInFeatures(self, features):
     """
     """
     start = time.time()
     
     matches = matchup.find_matches(features, self.features)
     matches_graph = matchup.group_matches(matches, features, self.features)
     needles = matchup.find_needles(matches, matches_graph, features, self.features)
     
     print >> sys.stderr, 'Found', len(needles), 'needles',
     print >> sys.stderr, 'in %.2f sec.' % (time.time() - start)
     
     for (fs1, fs2, transform) in needles:
         marker = copy.deepcopy(self)
 
         print >> sys.stderr, (marker.anchor.x, marker.anchor.y),
 
         x, y = transform(marker.anchor.x, marker.anchor.y)
         print >> sys.stderr, '->', '(%.2f, %.2f)' % (x, y),
 
         marker.anchor = Point(x, y)
         
         yield marker