Skip to content

pyPointCloud is a lightweight Python library for loading PCD (Point Cloud Data) files directly into NumPy arrays. It is designed to support arbitrary data fields and data types, while keeping a simple and predictable data layout.

License

Notifications You must be signed in to change notification settings

ga58lar/pyPointCloud

Repository files navigation

pyPointCloud

PyPI

pypointcloud

pyPointCloud is a lightweight Python library for loading PCD (Point Cloud Data) files directly into NumPy arrays.
It is designed to support arbitrary data fields and data types, while keeping a simple and predictable data layout.


Installation

pip install pypointcloud

Overview

There are several Python libraries capable of loading PCD files, including:

  • open3d – Easy to use, but limited in supported data fields and types.
  • pyntcloud – Supports arbitrary fields, but is relatively slow.
  • pypcd4 – Very fast, supports arbitrary fields, and is well maintained.
    It loads PCDs into its own class and allows conversion to NumPy arrays.

General recommendation:
For most use cases, pypcd4 is the preferred solution due to its speed, simplicity, and maintenance status.

Why pyPointCloud?

pyPointCloud focuses on a slightly different design choice:

  • Loads x, y, z coordinates into a dedicated float32 NumPy array
  • Stores all other fields in a separate dictionary
  • Preserves original data types for non-coordinate fields

This contrasts with pypcd4, which uses its own class or combines all fields into a single float64 NumPy array.

Our approach can be beneficial when:

  • You want to preserve original data types
  • You only need fast access to XYZ coordinates
  • You want a minimal dependency, NumPy-first workflow

Benchmark

Depending on the exact use case and application goal, pyPointCloud can outperform other PCD loaders.
Note that this is a limited benchmark, and for most general-purpose scenarios, pypcd4 remains the recommended choice.

python3 benchmark/benchmark.py

Benchmarking PCD loaders with /dev_ws/benchmark/../example/ascii.pcd (100 iterations)
pyntcloud:    0.08244 seconds per cloud
pypcd4:       0.07953 seconds per cloud
pypointcloud: 0.01884 seconds per cloud

Benchmarking PCD loaders with /dev_ws/benchmark/../example/binary.pcd (100 iterations)
pyntcloud:    0.00345 seconds per cloud
pypcd4:       0.00184 seconds per cloud
pypointcloud: 0.00077 seconds per cloud

Benchmarking PCD loaders with /dev_ws/benchmark/../example/binary_compressed.pcd (100 iterations)
pyntcloud:    0.00307 seconds per cloud
pypcd4:       0.00122 seconds per cloud
pypointcloud: 0.00053 seconds per cloud

Example

example.py provides a reference implementation for the usage of this library.
It shows how to load clouds, to access data, to modifies data and to move the data to PyTorch.

License

This project uses the Apache-2.0 license.
This package uses lzf to decompress binary-compressed PCDs, certain parts of the application are subject to the terms specified in their license.

Related Work

Contact

Dominik Kulmer GitHub Linkedin ✉️

About

pyPointCloud is a lightweight Python library for loading PCD (Point Cloud Data) files directly into NumPy arrays. It is designed to support arbitrary data fields and data types, while keeping a simple and predictable data layout.

Resources

License

Stars

Watchers

Forks

Packages

No packages published