Mercurial Hosting > traffic-intelligence
comparison python/moving.py @ 768:f8e0a8ea8402 dev
updated the bounding box code (the name so that it is general for ground truth and UT)
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Thu, 14 Jan 2016 11:44:39 -0500 |
parents | d6f0e0cab07d |
children | bd13937818a4 |
comparison
equal
deleted
inserted
replaced
767:04497166d8f0 | 768:f8e0a8ea8402 |
---|---|
1558 | 1558 |
1559 ################## | 1559 ################## |
1560 # Annotations | 1560 # Annotations |
1561 ################## | 1561 ################## |
1562 | 1562 |
1563 class BBAnnotation(MovingObject): | 1563 class BBMovingObject(MovingObject): |
1564 '''Class for a series of ground truth annotations using bounding boxes | 1564 '''Class for a moving object represented as a bounding box |
1565 Its center is the center of the containing shape | 1565 used for series of ground truth annotations using bounding boxes |
1566 and for the output of Urban Tracker http://www.jpjodoin.com/urbantracker/ | |
1566 | 1567 |
1567 By default in image space | 1568 By default in image space |
1569 | |
1570 Its center is the center of the box (generalize to other shapes?) | |
1571 (computed after projecting if homography available) | |
1568 ''' | 1572 ''' |
1569 | 1573 |
1570 def __init__(self, num = None, timeInterval = None, topLeftPositions = None, bottomRightPositions = None, userType = userType2Num['unknown']): | 1574 def __init__(self, num = None, timeInterval = None, topLeftPositions = None, bottomRightPositions = None, userType = userType2Num['unknown']): |
1571 super(BBAnnotation, self).__init__(num, timeInterval, userType = userType) | 1575 super(BBMovingObject, self).__init__(num, timeInterval, userType = userType) |
1572 self.topLeftPositions = topLeftPositions.getPositions() | 1576 self.topLeftPositions = topLeftPositions.getPositions() |
1573 self.bottomRightPositions = bottomRightPositions.getPositions() | 1577 self.bottomRightPositions = bottomRightPositions.getPositions() |
1574 | 1578 |
1575 def computeCentroidTrajectory(self, homography = None): | 1579 def computeCentroidTrajectory(self, homography = None): |
1576 self.positions = self.topLeftPositions.add(self.bottomRightPositions).multiply(0.5) | 1580 self.positions = self.topLeftPositions.add(self.bottomRightPositions).multiply(0.5) |
1593 | 1597 |
1594 Reference: | 1598 Reference: |
1595 Keni, Bernardin, and Stiefelhagen Rainer. "Evaluating multiple object tracking performance: the CLEAR MOT metrics." EURASIP Journal on Image and Video Processing 2008 (2008) | 1599 Keni, Bernardin, and Stiefelhagen Rainer. "Evaluating multiple object tracking performance: the CLEAR MOT metrics." EURASIP Journal on Image and Video Processing 2008 (2008) |
1596 | 1600 |
1597 objects and annotations are supposed to in the same space | 1601 objects and annotations are supposed to in the same space |
1598 current implementation is BBAnnotations (bounding boxes) | 1602 current implementation is BBMovingObject (bounding boxes) |
1599 mathingDistance is threshold on matching between annotation and object | 1603 mathingDistance is threshold on matching between annotation and object |
1600 | 1604 |
1601 TO: tracker output (objects) | 1605 TO: tracker output (objects) |
1602 GT: ground truth (annotations) | 1606 GT: ground truth (annotations) |
1603 | 1607 |