-
Notifications
You must be signed in to change notification settings - Fork 1
/
3. Script.py
68 lines (57 loc) · 1.76 KB
/
3. Script.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#==============================================================================
#Comparing the read time of .pcd, .ply, .pts, .xyz
#==============================================================================
import open3d as o3d
import numpy as np
import time
i = 0
iteration = []
time_taken_pcd = []
while(i<=100):
i = i + 1
iteration.append(i)
start = time.perf_counter_ns()
point_cloud = o3d.io.read_point_cloud("Datasets/Output/output.pcd")
stop = time.perf_counter_ns()
t = stop-start
time_taken_pcd.append(t)
print(np.mean(time_taken_pcd),"Mean time for .pcd")
i = 0
time_taken_ply = []
while(i<=100):
i = i + 1
start = time.perf_counter_ns()
point_cloud = o3d.io.read_point_cloud("Datasets/Output/output.ply")
stop = time.perf_counter_ns()
t = stop-start
time_taken_ply.append(t)
print(np.mean(time_taken_ply),"Polygon file format =")
i = 0
time_taken_pts = []
while(i<=100):
i = i + 1
start = time.perf_counter_ns()
point_cloud = o3d.io.read_point_cloud("Datasets/Output/output.pts")
stop = time.perf_counter_ns()
t = stop-start
time_taken_pts.append(t)
print( np.mean(time_taken_pts),"Laser scan plain format")
i = 0
time_taken_xyz = []
while(i<=100):
i = i + 1
start = time.perf_counter_ns()
point_cloud = o3d.io.read_point_cloud("Datasets/Output/output.xyz")
stop = time.perf_counter_ns()
t = stop-start
time_taken_xyz.append(t)
print(np.mean(time_taken_xyz),"XYZ")
import matplotlib.pyplot as plt
plt.plot(iteration, time_taken_pcd)
plt.plot(iteration, time_taken_ply)
plt.plot(iteration, time_taken_pts, "r")
plt.plot(iteration, time_taken_xyz)
plt.title('the fastest format', size = 19)
plt.xlabel('Iteration', size = 19)
plt.ylabel('Time (nano seconds)', size = 19)
plt.show()