基于three.js的轻量级web点云可视化工具
point-viz-test的Python项目详细描述
简介
point_viz是一个在浏览器中工作的轻量级、开箱即用的点云可视化工具,它构建在Three.js 并且有python api。支持边界框(bbox)可视化,这里有一个example。 点即不需要互联网连接才能工作(当然,安装需要)。 它已经在chrome和safari上用python 2和3进行了测试。
用法
要安装point-viz,只需运行:pip install point_viz
,仅此而已。下面是它的python api示例:
# Import package.
from point_viz import PointvizConverter
# Initialize and setup output directory.
Converter = PointvizConverter(home)
# Pass data and create html files.
Converter.compile(task_name, coors, default_rgb, intensity, bbox_params, bbox_color)
变量解释
表示可选。
home:必须给出放置输出HTML文件的目录。
{STR 1 } $taskyNox,输出HTML文件的名称(如果名称已经存在,则可以重写;默认值为“默认值”)。
coors*:2-d浮点数组,点云中每个点的x、y和z坐标。
default\u r g b*:2-d float/int数组与coors
长度相同,每个点的r、g和b颜色。
如果没有提供,rgb将根据intensity
(如果给定)或
点坐标(当intensity
也丢失时)。
intensity*:1-d浮点数组的长度与每个点的强度coors
相同。只有当
default_rgb
未给出。
bbox_params*:2-d list,每个bbox的几何参数。每一行的属性排列如下:
Attribute # | Description |
---|---|
0 | Length (float, dimension along x-axis) |
1 | Height (float, dimension along y-axis) |
2 | Width (float, dimension along z-axis) |
3 | X coordinate of bbox centroid (float) |
4 | Y coordinate of bbox centroid (float) |
5 | Z coordinate of bbox centroid (float) |
6 | Horizontal rotation regarding the +x-axis in radians (float) |
7* | Color of the bbox (string, optional; X11 color name is supported, default is "Magenta") |
8* | Label text of the bbox (string, optional) |
bbox_color*:boolean,默认为True
。如果给定标签文本时缺少bbox的颜色,则
bbox_color
必须显式设置为False
。