-
Notifications
You must be signed in to change notification settings - Fork 0
/
visualizer_pcd.py
33 lines (25 loc) · 900 Bytes
/
visualizer_pcd.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
import os
import argparse
import open3d as o3d
from tqdm import tqdm
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--filedir', required=True)
parser.add_argument('--max_display')
args = parser.parse_args()
files = os.listdir(str(args.filedir))
files = sorted(files)
if args.max_display is None:
max_display = int(10)
else:
max_display = int(args.max_display)
if len(files) >= max_display:
files = files[:max_display]
pcds = []
for idx, file in tqdm(enumerate(files)):
filepath = os.path.join(str(args.filedir), file)
pcd = o3d.io.read_point_cloud(filepath)
pcd.estimate_normals()
pcd = pcd.translate((((idx % 5) * 0.3), ((idx // 5) * 0.35 * (-1)), 0))
pcds.append(pcd)
o3d.visualization.draw_geometries(pcds, mesh_show_back_face=True)