Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #2

Merged
merged 22 commits into from
Apr 29, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
write associated measurements to file
  • Loading branch information
cfo committed Apr 16, 2014
commit 5fc8ef36a3d0fa70e38e6373113ea492592cf9bd
20 changes: 11 additions & 9 deletions svo_analysis/src/svo_analysis/tum_benchmark_tools/associate.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def associate(first_list, second_list,offset,max_difference):
''')
parser.add_argument('first_file', help='first text file (format: timestamp data)')
parser.add_argument('second_file', help='second text file (format: timestamp data)')
parser.add_argument('--first_only', help='only output associated lines from first file', action='store_true')
parser.add_argument('--offset', help='time offset added to the timestamps of the second file (default: 0.0)',default=0.0)
parser.add_argument('--max_difference', help='maximally allowed time difference for matching entries (default: 0.02)',default=0.02)
args = parser.parse_args()
Expand All @@ -117,12 +116,15 @@ def associate(first_list, second_list,offset,max_difference):
second_list = read_file_list(args.second_file)

matches = associate(first_list, second_list,float(args.offset),float(args.max_difference))

if args.first_only:
for a,b in matches:
print("%f %s"%(a," ".join(first_list[a])))
else:
for a,b in matches:
print("%f %s %f %s"%(a," ".join(first_list[a]),b-float(args.offset)," ".join(second_list[b])))


filename = 'groundtruth_matched.txt'
associates_file = open(filename, 'w')
for a,b in matches:
img = first_list[a]
pos = second_list[b]
associates_file.write('%.6f %s %s %s %s %s %s %s %s\n' %
(a, img[0],
pos[0], pos[1], pos[2],
pos[3], pos[4], pos[5], pos[6]))
print('Wrote matches to file: ' + filename)