Commit d206ac29 authored by Jay's avatar Jay Committed by jay
Browse files

Fixes for tests

parent f217180d
Loading
Loading
Loading
Loading
+24 −24
Original line number Diff line number Diff line
{"autocnet/examples/Apollo15/AS15-M-0297_SML.png"
 : ["autocnet/examples/Apollo15/AS15-M-0298_SML.png",
    "autocnet/examples/Apollo15/AS15-M-0300_SML.png",
    "autocnet/examples/Apollo15/AS15-M-0299_SML.png",
    "autocnet/examples/Apollo15/AS15-M-0296_SML.png"],
 "autocnet/examples/Apollo15/AS15-M-0300_SML.png"
 : ["autocnet/examples/Apollo15/AS15-M-0298_SML.png",
    "autocnet/examples/Apollo15/AS15-M-0297_SML.png",
    "autocnet/examples/Apollo15/AS15-M-0299_SML.png"],
 "autocnet/examples/Apollo15/AS15-M-0299_SML.png"
 : ["autocnet/examples/Apollo15/AS15-M-0298_SML.png",
    "autocnet/examples/Apollo15/AS15-M-0297_SML.png",
    "autocnet/examples/Apollo15/AS15-M-0300_SML.png",
    "autocnet/examples/Apollo15/AS15-M-0296_SML.png"],
 "autocnet/examples/Apollo15/AS15-M-0295_SML.png"
{"AS15-M-0297_SML.png"
 : ["AS15-M-0298_SML.png",
    "AS15-M-0300_SML.png",
    "AS15-M-0299_SML.png",
    "AS15-M-0296_SML.png"],
 "AS15-M-0300_SML.png"
 : ["AS15-M-0298_SML.png",
    "AS15-M-0297_SML.png",
    "AS15-M-0299_SML.png"],
 "AS15-M-0299_SML.png"
 : ["AS15-M-0298_SML.png",
    "AS15-M-0297_SML.png",
    "AS15-M-0300_SML.png",
    "AS15-M-0296_SML.png"],
 "AS15-M-0295_SML.png"
 : [], 
 "autocnet/examples/Apollo15/AS15-M-0296_SML.png"
 : ["autocnet/examples/Apollo15/AS15-M-0298_SML.png",
    "autocnet/examples/Apollo15/AS15-M-0297_SML.png",
    "autocnet/examples/Apollo15/AS15-M-0299_SML.png"],
 "autocnet/examples/Apollo15/AS15-M-0298_SML.png"
 : ["autocnet/examples/Apollo15/AS15-M-0297_SML.png",
    "autocnet/examples/Apollo15/AS15-M-0300_SML.png",
    "autocnet/examples/Apollo15/AS15-M-0299_SML.png",
    "autocnet/examples/Apollo15/AS15-M-0296_SML.png"]}
 "AS15-M-0296_SML.png"
 : ["AS15-M-0298_SML.png",
    "AS15-M-0297_SML.png",
    "AS15-M-0299_SML.png"],
 "AS15-M-0298_SML.png"
 : ["AS15-M-0297_SML.png",
    "AS15-M-0300_SML.png",
    "AS15-M-0299_SML.png",
    "AS15-M-0296_SML.png"]}
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ class Edge(dict, MutableMapping):
        if not hasattr(self, '_masks'):
            if hasattr(self, 'matches'):
                self._masks = pd.DataFrame(True, columns=['symmetry', 'ratio'],
                                       index=index)
                                       index=self.matches.index)
            else:
                self._masks = pd.DataFrame()
        # If the mask is coming form another object that tracks
+9 −4
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ class TestCandidateGraph(unittest.TestCase):
        basepath = get_path('Apollo15')
        cls.graph = network.CandidateGraph.from_adjacency(get_path('three_image_adjacency.json'),
                                                          basepath=basepath)
        cls.disconnected_graph = network.CandidateGraph.from_adjacency(get_path('adjacency.json'))

    def test_get_name(self):
        node_number = self.graph.node_name_map['AS15-M-0297_SML.png']
@@ -37,13 +38,17 @@ class TestCandidateGraph(unittest.TestCase):
            pass

    def test_island_nodes(self):
        self.assertEqual(len(self.graph.island_nodes()), 1)
        self.assertEqual(len(self.disconnected_graph.island_nodes()), 1)

    def test_connected_subgraphs(self):
        subgraph_list = self.graph.connected_subgraphs()
        subgraph_list = self.disconnected_graph.connected_subgraphs()
        self.assertEqual(len(subgraph_list), 2)
        island = self.graph.island_nodes()[0]
        self.assertTrue(island in subgraph_list[1])
        islands = self.disconnected_graph.island_nodes()
        self.assertTrue(islands[0] in subgraph_list[1])

        subgraph_list = self.graph.connected_subgraphs()
        self.assertEqual(len(subgraph_list), 1)


    def test_save_load(self):
        self.graph.save('test_save.cg')

autocnet/matcher/homography.py

deleted100644 → 0
+0 −8
Original line number Diff line number Diff line
import numpy as np
import pandas as pd

from autocnet.utils.utils import make_homogeneous



+5 −3
Original line number Diff line number Diff line
import os
import numpy as np
import unittest

import sys
sys.path.insert(0, os.path.abspath('..'))

import numpy as np
import numpy.testing
import pandas as pd

from .. import transformations

@@ -28,8 +29,9 @@ class TestHomography(unittest.TestCase):
        # normalize hom. coordinates
        tp /= tp[-1,:np.newaxis]
        H = transformations.Homography(static_H,
                                  fp,
                                  tp.T[:,:2])
                                  pd.DataFrame(fp, columns=['x', 'y']),
                                  pd.DataFrame(tp.T[:,:2], columns=['x', 'y']),
                                  mask=pd.Series(True, index=np.arange(fp.shape[0])))
        self.assertAlmostEqual(H.determinant, 0.6249999, 5)
        self.assertAlmostEqual(H.condition, 7.19064438, 5)
        error = H.error
Loading