Items with no label
3335 Discussions

i have a problem in pointscloud_visualization

tguan
New Contributor I
1,939 Views

from pyntcloud import PyntCloud

mesh= PyntCloud.from_file("points.ply")# 加载点云网格

 

mesh.plot(mesh=True, backend="threejs")# 可视化点云网格

 

# 随机采样将网格转换为点云

 

cloud = mesh.get_sample("mesh_random", n=100000, rgb=True, normals=True, as_PyntCloud=True)

# 请注意,我们传递了normals = True参数,所以现在我们的点云具有每个点的正常值。

 

# 引入pandas,因为PyntCloud.points是一个pandas.DataFrame,我们可以利用pandas的内置可视化选项

 

cloud.points[['nx','ny','nz']].plot(kind="hist", subplots=True)

# 将采样后得点云可视化

 

cloud.plot()

KeyError: "['nx' 'ny' 'nz'] not in index"

How to correct it?

0 Kudos
1 Solution
MartyG
Honored Contributor III
623 Views

Someone else who had a 'KeyError ... not in index' error in Pyntcloud used a "DataFrame" to define the points that the KeyError had problems with.

https://github.com/daavoo/pyntcloud/issues/155 Add colour to point? · Issue # 155 · daavoo/pyntcloud · GitHub

View solution in original post

1 Reply
MartyG
Honored Contributor III
624 Views

Someone else who had a 'KeyError ... not in index' error in Pyntcloud used a "DataFrame" to define the points that the KeyError had problems with.

https://github.com/daavoo/pyntcloud/issues/155 Add colour to point? · Issue # 155 · daavoo/pyntcloud · GitHub

Reply