Mercurial Hosting > traffic-intelligence
changeset 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 |
files | python/moving.py python/run-tests.sh python/storage.py tracking.cfg |
diffstat | 4 files changed, 10 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/python/moving.py Fri Dec 05 00:54:38 2014 -0500 +++ b/python/moving.py Fri Dec 05 15:14:44 2014 -0500 @@ -1287,13 +1287,13 @@ Its center is the center of the containing shape ''' - def __init__(self, num = None, timeInterval = None, topPositions = None, bottomPositions = None, userType = userType2Num['unknown']): + def __init__(self, num = None, timeInterval = None, topLeftPositions = None, bottomRightPositions = None, userType = userType2Num['unknown']): super(BBAnnotation, self).__init__(num, timeInterval, Trajectory(), userType = userType) - self.topPositions = topPositions.getPositions() - self.bottomPositions = bottomPositions.getPositions() - for i in xrange(int(topPositions.length())): - self.positions.addPosition((topPositions.getPositionAt(i) + bottomPositions.getPositionAt(i)).multiply(0.5)) - + self.topLeftPositions = topLeftPositions.getPositions() + self.bottomRightPositions = bottomRightPositions.getPositions() + for i in xrange(int(topLeftPositions.length())): + self.positions.addPosition((topLeftPositions.getPositionAt(i) + bottomRightPositions.getPositionAt(i)).multiply(0.5)) + def plotRoadUsers(objects, colors): '''Colors is a PlottingPropertyValues instance'''
--- a/python/run-tests.sh Fri Dec 05 00:54:38 2014 -0500 +++ b/python/run-tests.sh Fri Dec 05 15:14:44 2014 -0500 @@ -4,4 +4,3 @@ do python $f done -rm nonexistent
--- a/python/storage.py Fri Dec 05 00:54:38 2014 -0500 +++ b/python/storage.py Fri Dec 05 15:14:44 2014 -0500 @@ -286,7 +286,7 @@ corner = 'top_left' elif trajectoryType == 'bbbottom': corner = 'bottom_right' - queryStatement = 'SELECT object_id, frame_number, x_'+corner+', y_'+corner+' FROM '+tableName+' '+trajectoryIdQuery+'ORDER BY object_id, frame_number' + queryStatement = 'SELECT object_id, frame_number, x_'+corner+', y_'+corner+' FROM '+tableName+' '+idQuery+'ORDER BY object_id, frame_number' cursor.execute(queryStatement) logging.debug(queryStatement) else: @@ -375,7 +375,7 @@ connection.close() return objects -def loadGroundTruthFromSqlite(filename, gtType, gtNumbers = None): +def loadGroundTruthFromSqlite(filename, gtType = 'bb', gtNumbers = None): 'Loads bounding box annotations (ground truth) from an SQLite ' connection = sqlite3.connect(filename) gt = []
--- a/tracking.cfg Fri Dec 05 00:54:38 2014 -0500 +++ b/tracking.cfg Fri Dec 05 15:14:44 2014 -0500 @@ -62,9 +62,9 @@ # number of frames to compute velocities #nframes-velocity = 5 # maximum number of iterations to stop feature tracking -max-number-iterations = 30 +max-number-iterations = 20 # minimum error to reach to stop feature tracking -min-tracking-error = 0.01 +min-tracking-error = 0.3 # minimum eigen value of a 2x2 normal matrix of optical flow equations min-feature-eig-threshold = 1e-4 # minimum length of a feature (number of frames) to consider a feature for grouping