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

# 读取kitti格式数据
data = np.fromfile('data.bin', dtype=np.float32).reshape(-1, 4)

# 可视化
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(data[:,0], data[:,1], data[:,2], c=data[:,3])
plt.show()