A simple tool for visualizing point cloud sequences
Project description
PCViewer
PCViewer是一个简单易用的点云数据可视化工具,支持动态点云序列的实时渲染和交互式查看。
安装
pip install pcviewer
支持Python 3.7及以上版本。如果你使用conda环境,建议先创建新的环境:
conda create -n pcviewer python=3.9
conda activate pcviewer
pip install pcviewer
使用示例
只需将需要可视化的点云数据传入start_servers函数即可启动可视化服务器,然后在浏览器中访问http://localhost:8080来交互式查看点云数据。
import numpy as np
from PCViewer import start_servers
# 创建示例点云数据
n_frames = 30
n_points = 1000
# 生成旋转的立方体点云
point_clouds = []
colors = []
for i in range(n_frames):
angle = i * 2 * np.pi / n_frames
points = np.random.rand(n_points, 3) * 2 - 1
rotation = np.array([
[np.cos(angle), -np.sin(angle), 0],
[np.sin(angle), np.cos(angle), 0],
[0, 0, 1]
])
points = points @ rotation.T
color = np.zeros((n_points, 3))
color[:, 0] = points[:, 0] / 2 + 0.5
color[:, 1] = points[:, 1] / 2 + 0.5
color[:, 2] = points[:, 2] / 2 + 0.5
point_clouds.append(points)
colors.append(color)
# 启动可视化服务器
start_servers(np.array(point_clouds), np.array(colors))
参数说明
start_servers(point_clouds, colors=None, show_axes=True, show_rings=True)
point_clouds: numpy数组或torch张量,形状为(n_frames, n_points, 3),表示点云序列数据colors: numpy数组,形状为(n_frames, n_points, 3),表示点云颜色,可选参数。各颜色通道值范围为[0, 1],使用RGB格式show_axes: 布尔值,是否显示坐标轴,默认为Trueshow_rings: 布尔值,是否显示辅助环,默认为True
运行效果
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
pcviewer-0.1.2.tar.gz
(170.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pcviewer-0.1.2-py3-none-any.whl
(173.6 kB
view details)
File details
Details for the file pcviewer-0.1.2.tar.gz.
File metadata
- Download URL: pcviewer-0.1.2.tar.gz
- Upload date:
- Size: 170.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f7fd4091b24db470795030c0b99626a2c7078f4c89f0a62570bd5d7d61e115e
|
|
| MD5 |
632a1a659c4973479e56b3fe3d2eac0d
|
|
| BLAKE2b-256 |
ab897992bfd1804f6b4fae80a1d67bdb9e3834cc7afe872622e87c67d557734f
|
File details
Details for the file pcviewer-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pcviewer-0.1.2-py3-none-any.whl
- Upload date:
- Size: 173.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13412754ccb0ba713bc3810b869ce0f0af716060374bea0f0aa646e8d0c49a0a
|
|
| MD5 |
7d5e37637386fa42f0f5871df76b2111
|
|
| BLAKE2b-256 |
f30684dbec88f6e23ec1299024299c02e2e392eaa25baa3122575068f0b13ca3
|