Read and write PCL .pcd files in python
Reason this release was yanked:
This release is broken on some python versions.
Project description
pypcd4
Description
pypcd4 is a modern reimagining of the original pypcd library, offering enhanced capabilities and performance for working with Point Cloud Data (PCD) files.
This library builds upon the foundation laid by the original pypcd while incorporating modern Python3 syntax and methodologies to provide a more efficient and user-friendly experience.
Install
You can install pypcd4 via pip,
pip install pypcd4
How to use
Import pypcd4
from pypcd4 import PointCloud
Read from .pcd file
pc: PointCloud = PointCloud.from_path("xyzi.pcd")
PointCloud -> NumPy array
array: np.ndarray = pc.numpy()
array.shape
# (1000, 4)
NumPy array -> PointCloud
# Depends on number of features of your array
# If PointXYZI,
pc = PointCloud.from_xyzi_points(array)
# If PointXYZL,
pc = PointCloud.from_xyzl_points(array, label_type=np.uint32)
Create custom conversion method
If you cannot find preferred point type in pre-defined conversion methods, you can create it easily like,
fields = ("x", "y", "z", "intensity", "new_field")
types = (np.float32, np.float32, np.float32, np.float32, np.float64)
pc = PointCloud.from_points(array, fields, types)
Save as .pcd file
pc.save("nice_point_cloud.pcd")
License
The library was rewritten and does not borrow any code from the original pypcd library. Since it was heavily inspired by the original author's work, we extend his original BSD 3-Clause License and include his Copyright notice.
TODO
- Support ROS message conversion
- Visualization
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pypcd4-0.1.dev6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c83ca546461d0573f20c6163633f24f0bce0e9e9b5484ff52b0af2466422a5e2 |
|
MD5 | 0366b138dfffb0b05de6e4383fd07491 |
|
BLAKE2b-256 | e20fe6fd1fa93039608b09b0a340142249f13722a2203bec1a07c017f43c8dbf |