forked from isl-org/Open3D-PointNet2-Semantic3D
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kitti_visualize.py
40 lines (33 loc) · 1007 Bytes
/
kitti_visualize.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import pykitti
import open3d
import time
import argparse
if __name__ == "__main__":
# Parser
parser = argparse.ArgumentParser()
parser.add_argument(
"--kitti_root", default="", help="Checkpoint file", required=True
)
flags = parser.parse_args()
basedir = flags.kitti_root
date = "2011_09_26"
drive = "0001"
pcd = open3d.PointCloud()
vis = open3d.Visualizer()
vis.create_window()
vis.add_geometry(pcd)
render_option = vis.get_render_option()
render_option.point_size = 0.01
data = pykitti.raw(basedir, date, drive)
to_reset_view_point = True
for points_with_intensity in data.velo:
points = points_with_intensity[:, :3]
pcd.points = open3d.Vector3dVector(points)
vis.update_geometry()
if to_reset_view_point:
vis.reset_view_point(True)
to_reset_view_point = False
vis.poll_events()
vis.update_renderer()
time.sleep(0.2)
vis.destroy_window()