python显示点云

matplotlib

显示时拖动起来太卡

参考:https://blog.csdn.net/guduruyu/article/details/78050268

点属性设置参考:https://www.cnblogs.com/sunshinewang/p/6853813.html

#!/usr/bin/python
# -*- coding: UTF-8 -*-

from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
import pcl

filename = './1542614507.194016000'
p = pcl.load(filename + '.pcd')

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

x = []
y = []
z = []
for i in range(p.size):
	x.append(p[i][0])
	y.append(p[i][1])
	z.append(p[i][2])

ax.scatter(x, y, z, c='k', marker='.', s=0.1)


plt.show()

这是效果图:

python显示点云_第1张图片

相比之下用pcl_viewer显示出来的图像效果要好很多

python显示点云_第2张图片

 

 

你可能感兴趣的:(python显示点云)