Skip to main content

A small example package

Project description

PointCloud-PyUsage

提供点云处理的Python实现,本仓库正在进行大幅度地迭代,暂不建议使用

安装

安装依赖

  • ROS1 / ROS2(如需要用到ROS的相关插件)
  • Open3D(如果Python版本为3.10,需自行安装Open3D@ref
# pip 版本需要大于等于20.3
$ pip3 install -U pip
$ pip3 install --user --pre https://storage.googleapis.com/open3d-releases-master/python-wheels/open3d-0.16.0-cp310-cp310-manylinux_2_27_x86_64.whl"
  • 构建工具
$ pip3 install -U build

构建安装和安装包

$ git clone https://github.com/Natsu-Akatsuki/PointCloud-PyUsage --depth=1
$ cd PointCloud-PyUsage
# (推荐)非开发模式
$ bash install.sh

# 开发模式
$ pip3 install -e .

Note

非虚拟环境下,使用开发模式可能出现its build backend is missing the 'build_editable' hook的报错,则可能是系统级别的setuptools的版本覆盖了高版本的setuptools。通过如下命令行可查询当前的版本python3 -c "import setuptools; print(setuptools.__version__)"

程序

包名 作用
io 导入和导出点云文件
visualization 点云可视化
ros-utils 动态调参,ROS消息类型和numpy类型的相互转换

IO

  • 支持npypcdbin点云文件的读取
  • 目前支持读取的字段包括xyzxyzi
# >>> import usage >>>
from pointcloud_utils.io import load_pointcloud

# low-level API
pointcloud = load_npy("../data/pointcloud.npy")
pointcloud = load_txt("../data/pointcloud.txt")
pointcloud = load_pcd("../data/pointcloud_ascii.pcd")
# high-level API(支持npy, pcd, bin文件)
pointcloud = load_pointcloud("pointcloud_utils/data/pointcloud.pcd")

# >>> export usage >>>
save_pointcloud(pointcloud, "pointcloud.pcd")

Visualization

  • 可视化激光点云
  • 基于强度实现点云伪彩色增强
from pointcloud_utils.io import load_pointcloud
from pointcloud_utils.visualization import o3d_viewer_from_pointcloud
pointcloud = load_pointcloud("pointcloud_utils/data/pointcloud_ascii.pcd")
with print_durations(unit='ms'):
  o3d_viewer_from_pointcloud(pointcloud)

命令行

可视化点云

  • 基于Open3D的点云可视化,支持npypcdbin点云文件的可视化
  • 目前支持的字段包括xyzxyzi
  • 强度字段使用伪彩色增强
$ o3d_viewer <pointcloud_file>
# 如遇到KITTI数据集这种将强度进行过归一化的则需要加上-n选项
$ o3d_viewer -n <pointcloud_file>

TODO

  • 用开发模式安装的包无法被Pycharm智能识别而不能实现补全(不论是否处于虚拟环境)
  • 使用github来构建安装包

规范

  • 遵从pep660setuptools至少需要v64.0才支持单个toml下的develop模式)(@ref

参考资料

仓库 参考
ros_numpy ROS1 点云数据和numpy数据相互转换
ros2_numpy ROS1 点云数据和numpy数据相互转换
ddynamic_reconfigure_python ROS1 动态调参
OpenPCDet 神经网络算子和标定
pykitti KITTI数据集读取
livox_mapping 基于强度值的伪彩色

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

ampcl-0.0.1-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file ampcl-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: ampcl-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 35.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for ampcl-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ae92d22ff5c0f4d14423e922ffaec49f284bcc85f1e262e9372508eec7c259b7
MD5 ceb756640cd6a1de6623c3363712d5b4
BLAKE2b-256 1f7ad7a071b77fb3c0695e7d086b39ce87c43fd04175010214350394193d373e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page