Exemple #1
0
    def test_write_ply_with_colors(self):
        n = 100  # number of colors in original cloud, which we will thin to n/2
        cloud_input = PointCloud(np.zeros((3, n)), np.zeros((3, n), np.uint8))

        # Write test signal into write_ply
        folder_path = parutil.get_file_path('sumo/threedee/test_data')
        file_path = os.path.join(folder_path, 'example_write.ply')
        cloud_input.write_ply(file_path)
Exemple #2
0
    def test_write_ply_with_colors(self):
        n = 100  # number of colors in original cloud
        cloud_input = PointCloud(np.zeros((3, n)), np.zeros((3, n), np.uint8))

        # Write test signal into a file
        temp_dir = tempfile.mkdtemp()

        file_path = os.path.join(temp_dir, 'example_write.ply')
        cloud_input.write_ply(file_path)

        # TODO: The current PointCloud class does not actually read
        # colors.  Add implementation.
        # cloud_output = PointCloud.load_ply(file_path)
        # self.assertTrue(isinstance(cloud_output, PointCloud))
        # self.assertTrue(cloud_output.colored())
        # self.assertEqual(cloud_output.colors().shape, [3, n])
        os.remove(file_path)