点云数据详解——创建360度全景视图

本课程正在构建中,但将要教授的视图类型如下所示。

Image of panoramic lidar depth

Image of panoramic lidar height

Image of panoramic lidar reflectance

 

 

同时请参阅此博客文章此博客文章,了解本课程中将包含的大部分内容。 

使用Mayavi进行交互式3D可视化——Interactive 3D Visualization using Mayavi

关于

Mayavi是一个科学的可视化库,能够可视化点云数据。
获得Mayavi

正在建设....同时,如果您使用的是Ubuntu,可以查看这个要点,以便在机器上进行设置。

    TLDR; mayavi是安装非常痛苦。

可视化

正在建设....同时我已经将这个以下功能放在一起以可视化点云数据。 稍后将更详细地解释这一点。

# ==============================================================================
#                                                                     VIZ_MAYAVI
# ==============================================================================
def viz_mayavi(points, vals="distance"):
    x = points[:, 0]  # x position of point
    y = points[:, 1]  # y position of point
    z = points[:, 2]  # z position of point
    # r = lidar[:, 3]  # reflectance value of point
    d = np.sqrt(x ** 2 + y ** 2)  # Map Distance from sensor

    # Plot using mayavi -Much faster and smoother than matplotlib
    import mayavi.mlab

    if vals == "height":
        col = z
    else:
        col = d

    fig = mayavi.mlab.figure(bgcolor=(0, 0, 0), size=(640, 360))
    mayavi.mlab.points3d(x, y, z,
                         col,          # Values used for Color
                         mode="point",
                         colormap='spectral', # 'bone', 'copper', 'gnuplot'
                         # color=(0, 1, 0),   # Used a fixed (r,g,b) instead
                         figure=fig,
                         )
    mayavi.mlab.show()

使用Matplotlib进行交互式3D可视化——Interactive 3D Visualization using Matplotlib

注意:本课程仍在建设中......
介绍

Matplotlib具有易于设置的优点。几乎所有从事机器学习或数据科学工作的人都已经安装了这个。但是,有几个原因可以避免使用它在3D中以交互方式显示点云。

首先matplotlib非常慢。如果您想要实际可视化LIDAR扫描之类的所有点,它可能会使您的计算机崩溃。

其次,它只是没有产生非常好的点云可视化。例如,如果您正在处理LIDAR点云,则在使用matplotlib时,您不太可能识别场景中的任何内容。

Mayavi的缺点是安装起来非常棘手,但在可视化点云数据方面做得非常出色。如果可以的话,我会鼓励你尝试。
可视化。

注意:本课程仍在建设中......

为了防止matplotlib崩溃您的计算机,建议仅查看点云数据的子集。例如,如果您可视化LIDAR数据,那么您可能只想查看每25-100个点中的一个。下面是一些示例代码,可帮助您入门。

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

skip = 100   # Skip every n points

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
point_range = range(0, points.shape[0], skip) # skip points to prevent crash
ax.scatter(points[point_range, 0],   # x
           points[point_range, 1],   # y
           points[point_range, 2],   # z
           c=points[point_range, 2], # height data for color
           cmap='spectral',
           marker="x")
ax.axis('scaled')  # {equal, scaled}
plt.show()

 

 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值