Exemplo n.º 1
0
    def test_convert_to_homogenous_coordinates_on_empty_input(self):
        """Tests conversion to homogenous coordinates on empty input."""

        non_homogenous_coordinates = np.array([])
        computed = feature_utils.convert_to_homogenous_coordinates(non_homogenous_coordinates)

        self.assertIsNone(computed)
Exemplo n.º 2
0
    def test_convert_to_homogenous_coordinates_on_none_input(self):
        """Tests conversion to homogenous coordinates on None input."""

        non_homogenous_coordinates = None
        computed = feature_utils.convert_to_homogenous_coordinates(non_homogenous_coordinates)

        self.assertIsNone(computed)
Exemplo n.º 3
0
    def test_convert_to_homogenous_coordinates_on_valid_input(self):
        """Tests conversion to homogenous coordinates on valid input."""

        non_homogenous_coordinates = np.random.rand(10, 2)
        computed = feature_utils.convert_to_homogenous_coordinates(non_homogenous_coordinates)

        np.testing.assert_allclose(computed[:, :2], non_homogenous_coordinates)
        np.testing.assert_allclose(computed[:, 2], 1)