Mercurial Hosting > traffic-intelligence
diff python/moving.py @ 785:3aa6102ccc12 dev
addressed issues with ground truth annotations shifted in time
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Thu, 03 Mar 2016 17:01:30 -0500 |
parents | 7c38250ddfc7 |
children | 21f10332c72b |
line wrap: on
line diff
--- a/python/moving.py Thu Mar 03 14:31:13 2016 -0500 +++ b/python/moving.py Thu Mar 03 17:01:30 2016 -0500 @@ -61,6 +61,10 @@ '''Indicates if the temporal interval of self is comprised in interval2''' return (self.first >= interval2.first) and (self.last <= interval2.last) + def shift(self, offset): + self.first += offset + self.last += offset + @classmethod def union(cls, interval1, interval2): '''Smallest interval comprising self and interval2''' @@ -174,6 +178,9 @@ def commonTimeInterval(self, obj2): return TimeInterval.intersection(self.getTimeInterval(), obj2.getTimeInterval()) + def shiftTimeInterval(self, offset): + self.timeInterval.shift(offset) + class Point(object): def __init__(self, x, y): self.x = x