Mercurial Hosting > traffic-intelligence
diff python/utils.py @ 561:ee45c6eb6d49
added Mohamed Gomaa Mohamed function to smooth object trajectories
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 15 Jul 2014 16:42:04 -0400 |
parents | 3622a5653ee9 |
children | 0057c04f94d5 |
line wrap: on
line diff
--- a/python/utils.py Tue Jul 15 13:59:03 2014 -0400 +++ b/python/utils.py Tue Jul 15 16:42:04 2014 -0400 @@ -209,7 +209,7 @@ return median([y for observedx, y in zip(X,Y) if abs(x-observedx)<halfwidth]) def argmaxDict(d): - return max(d.iterkeys(), key=(lambda key: d[key])) + return max(d, key=d.get) def framesToTime(nFrames, frameRate, initialTime = time()): '''returns a datetime.time for the time in hour, minutes and seconds