MichaelGrupp / evo

Python package for the evaluation of odometry and SLAM
https://michaelgrupp.github.io/evo/
GNU General Public License v3.0
3.34k stars 745 forks source link

Merge results not giving average of statistics #583

Closed ArttuLinden closed 11 months ago

ArttuLinden commented 11 months ago

Hi,

I want to merge multiple results together but the statistics are not an average of each result but different. I am confident the root cause is in line 115-118 in core/result.py

merged_result.stats = { key: ((merged_result.stats[key] + result.stats[key]) / 2) for key in merged_result.stats }

example with some of my results: (0.067716037 + 0.186864859 + 0.068158952 + 0.065110102) / 4 = 0.096962488 how the software calculates it: (0.0677 + 0.1868) / 2 = 0.127290448 (0.12729 + 0.068158952) / 2 = 0.097724476 (0.0977244 + 0.06511012) / 2 = 0.081417288

As you can see the answer is different. Could you confirm my findings?

MichaelGrupp commented 11 months ago

Yes, this was indeed really wrong... :smile: Should be fixed now: https://github.com/MichaelGrupp/evo/commit/6b0bce8d9390f928da2e9e81651cd4e1a75efe82

I'll make a release with it soon. Thanks for reporting!