Loading autocnet/graph/network.py +6 −10 Original line number Diff line number Diff line Loading @@ -121,19 +121,15 @@ class CandidateGraph(nx.Graph): destination_keypoints = [] for i, row in edge['matches'].iterrows(): source_matched_to = row['matched_to_x'] source_idx = row['trainIdx_x'] src_keypoint = [self.node[source_matched_to]['keypoints'][source_idx].pt[0], self.node[source_matched_to]['keypoints'][source_idx].pt[1]] destination_matched_to = row['matched_to_y'] destination_idx = row['trainIdx_y'] dest_keypoint = [self.node[destination_matched_to]['keypoints'][destination_idx].pt[0], self.node[destination_matched_to]['keypoints'][destination_idx].pt[1]] source_idx = row['source_idx'] src_keypoint = [self.node[source_key]['keypoints'][int(source_idx)].pt[0], self.node[source_key]['keypoints'][int(source_idx)].pt[1]] destination_idx = row['destination_idx'] dest_keypoint = [self.node[destination_key]['keypoints'][int(destination_idx)].pt[0], self.node[destination_key]['keypoints'][int(destination_idx)].pt[1]] source_keypoints.append(src_keypoint) destination_keypoints.append(dest_keypoint) return cv2.findHomography(np.array(source_keypoints), np.array(destination_keypoints), outlier_algorithm, 5.0) else: Loading autocnet/matcher/tests/test_feature_extractor.py +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ class TestFeatureExtractor(unittest.TestCase): def test_extract_features(self): features = feature_extractor.extract_features(self.data_array, self.parameters) self.assertEquals(len(features), 2) self.assertEqual(len(features[0]), 10) # OpenCV +1 to self.assertEqual(len(features[0]), 11) # OpenCV +1 to self.assertIsInstance(features[0][0], type(cv2.KeyPoint())) self.assertIsInstance(features[1][0], np.ndarray) functional_tests/test_two_image.py +1 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ class TestTwoImageMatching(unittest.TestCase): cg.add_matches(matches) # Step: Compute Homography transformation_matrix, mask = cg.compute_homography('AS15-M-0297_SML.png', 'AS15-M-0298_SML.png') transformation_matrix, mask = cg.compute_homography(0, 1) self.assertEquals(len(transformation_matrix), 3) #TODO: write better test #self.assertEquals(len(mask), 19) Loading Loading
autocnet/graph/network.py +6 −10 Original line number Diff line number Diff line Loading @@ -121,19 +121,15 @@ class CandidateGraph(nx.Graph): destination_keypoints = [] for i, row in edge['matches'].iterrows(): source_matched_to = row['matched_to_x'] source_idx = row['trainIdx_x'] src_keypoint = [self.node[source_matched_to]['keypoints'][source_idx].pt[0], self.node[source_matched_to]['keypoints'][source_idx].pt[1]] destination_matched_to = row['matched_to_y'] destination_idx = row['trainIdx_y'] dest_keypoint = [self.node[destination_matched_to]['keypoints'][destination_idx].pt[0], self.node[destination_matched_to]['keypoints'][destination_idx].pt[1]] source_idx = row['source_idx'] src_keypoint = [self.node[source_key]['keypoints'][int(source_idx)].pt[0], self.node[source_key]['keypoints'][int(source_idx)].pt[1]] destination_idx = row['destination_idx'] dest_keypoint = [self.node[destination_key]['keypoints'][int(destination_idx)].pt[0], self.node[destination_key]['keypoints'][int(destination_idx)].pt[1]] source_keypoints.append(src_keypoint) destination_keypoints.append(dest_keypoint) return cv2.findHomography(np.array(source_keypoints), np.array(destination_keypoints), outlier_algorithm, 5.0) else: Loading
autocnet/matcher/tests/test_feature_extractor.py +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ class TestFeatureExtractor(unittest.TestCase): def test_extract_features(self): features = feature_extractor.extract_features(self.data_array, self.parameters) self.assertEquals(len(features), 2) self.assertEqual(len(features[0]), 10) # OpenCV +1 to self.assertEqual(len(features[0]), 11) # OpenCV +1 to self.assertIsInstance(features[0][0], type(cv2.KeyPoint())) self.assertIsInstance(features[1][0], np.ndarray)
functional_tests/test_two_image.py +1 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ class TestTwoImageMatching(unittest.TestCase): cg.add_matches(matches) # Step: Compute Homography transformation_matrix, mask = cg.compute_homography('AS15-M-0297_SML.png', 'AS15-M-0298_SML.png') transformation_matrix, mask = cg.compute_homography(0, 1) self.assertEquals(len(transformation_matrix), 3) #TODO: write better test #self.assertEquals(len(mask), 19) Loading