Mercurial > hg > nsaunier > traffic-intelligence
comparison python/moving.py @ 589:5800a87f11ae
corrected one bug and changed attribute names
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Fri, 05 Dec 2014 15:14:44 -0500 |
| parents | c5406edbcf12 |
| children | 0fa73cbe9fdb |
comparison
equal
deleted
inserted
replaced
| 588:c5406edbcf12 | 589:5800a87f11ae |
|---|---|
| 1285 class BBAnnotation(MovingObject): | 1285 class BBAnnotation(MovingObject): |
| 1286 '''Class for : a series of ground truth annotations using bounding boxes | 1286 '''Class for : a series of ground truth annotations using bounding boxes |
| 1287 Its center is the center of the containing shape | 1287 Its center is the center of the containing shape |
| 1288 ''' | 1288 ''' |
| 1289 | 1289 |
| 1290 def __init__(self, num = None, timeInterval = None, topPositions = None, bottomPositions = None, userType = userType2Num['unknown']): | 1290 def __init__(self, num = None, timeInterval = None, topLeftPositions = None, bottomRightPositions = None, userType = userType2Num['unknown']): |
| 1291 super(BBAnnotation, self).__init__(num, timeInterval, Trajectory(), userType = userType) | 1291 super(BBAnnotation, self).__init__(num, timeInterval, Trajectory(), userType = userType) |
| 1292 self.topPositions = topPositions.getPositions() | 1292 self.topLeftPositions = topLeftPositions.getPositions() |
| 1293 self.bottomPositions = bottomPositions.getPositions() | 1293 self.bottomRightPositions = bottomRightPositions.getPositions() |
| 1294 for i in xrange(int(topPositions.length())): | 1294 for i in xrange(int(topLeftPositions.length())): |
| 1295 self.positions.addPosition((topPositions.getPositionAt(i) + bottomPositions.getPositionAt(i)).multiply(0.5)) | 1295 self.positions.addPosition((topLeftPositions.getPositionAt(i) + bottomRightPositions.getPositionAt(i)).multiply(0.5)) |
| 1296 | 1296 |
| 1297 | 1297 |
| 1298 def plotRoadUsers(objects, colors): | 1298 def plotRoadUsers(objects, colors): |
| 1299 '''Colors is a PlottingPropertyValues instance''' | 1299 '''Colors is a PlottingPropertyValues instance''' |
| 1300 from matplotlib.pyplot import figure, axis | 1300 from matplotlib.pyplot import figure, axis |
| 1301 figure() | 1301 figure() |
