forked from suk05112/ORBSLAM2_with_PCL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakeData.py
32 lines (22 loc) · 950 Bytes
/
makeData.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
with open('/home/skennetho/ORBSLAM2_with_PCL/dataset/rgbd_hall_6f/association.txt', 'r') as association:
ac = association.readlines()
#rgb_timestamp filename depth_timestamp filename
with open('mid.txt', 'r') as _mid:
mid = _mid.readlines()
def makeYoloResultTextfile(mid):
i=0
save_list = []
for ac_line in ac:
# print(ac_line)
for j in range(i, len(mid), 2):
print("mid = ", mid[j].split(' ')[0], ' ac=', ac_line.split(' ')[1].split('/')[1])
if mid[j].split(' ')[0] == ac_line.split(' ')[1].split('/')[1]: #파일의 타임스탬프 value가 same한지 확인
save_list.append(mid[j].split(' ')[0] + ' ' + ac_line.split(' ')[0] + "\n")
save_list.append(mid[j+1])
i += 2
break
file = open('mid_pose.txt', 'w')
for save in save_list:
file.write(save)
file.close()
makeYoloResultTextfile(mid)