Skip to main content

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: 布尔值,是否显示坐标轴,默认为True
  • show_rings: 布尔值,是否显示辅助环,默认为True

运行效果

PCViewer Demo

Project details


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.1.tar.gz (170.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pcviewer-0.1.1-py3-none-any.whl (172.7 kB view details)

Uploaded Python 3

File details

Details for the file pcviewer-0.1.1.tar.gz.

File metadata

  • Download URL: pcviewer-0.1.1.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

Hashes for pcviewer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 59c57b973c827d851f5a1caa4623ca36cea9471b99ea2e53152e3d2d5a63a12f
MD5 776ce4b5e87451f2f0af5b34c938dc9b
BLAKE2b-256 e7ca93f10dfecb9f3eafa7818ef4a6017d4bcfc335f01fa0a027de5d4acc005f

See more details on using hashes here.

File details

Details for the file pcviewer-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pcviewer-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 172.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.5

File hashes

Hashes for pcviewer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b6f0ba48f3a6a6134fa9da902350cd69d6a10fbccfa37f3699efd78d5f6b0ad
MD5 f298cfee7f9e227ee936c31529a60256
BLAKE2b-256 1befc6d322df61efa05b460beb9b4dc1f70d6069009be85891b813d22dd86eac

See more details on using hashes here.

Supported by

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