Mercurial > hg > nsaunier > traffic-intelligence
comparison python/storage.py @ 203:e2f31813ade6
added code to display trajectories on videa
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Tue, 06 Mar 2012 18:10:19 -0500 |
| parents | 319a04ba9033 |
| children | 966c2cd2bd9f |
comparison
equal
deleted
inserted
replaced
| 202:b0b964ba9489 | 203:e2f31813ade6 |
|---|---|
| 45 if obj: | 45 if obj: |
| 46 objects.append(obj) | 46 objects.append(obj) |
| 47 | 47 |
| 48 connection.close() | 48 connection.close() |
| 49 return objects | 49 return objects |
| 50 | |
| 51 def loadObjectsFromSqlite(filename, objectNumbers = -1): | |
| 52 '''Loads objects as averages of feature trajectories | |
| 53 TODO: load features as well, other ways of averaging trajectories | |
| 54 need to provide table name(s) ?''' | |
| 55 # elect frame_number, avg(x_coordinate), avg(y_coordinate) from positions where trajectory_id in (select trajectory_id from objects_features where object_id=12) group by frame_number; | |
| 56 | |
| 57 | |
| 58 | |
| 50 | 59 |
| 51 def loadTrajectoriesFromNgsimFile(filename, nObjects = -1, sequenceNum = -1): | 60 def loadTrajectoriesFromNgsimFile(filename, nObjects = -1, sequenceNum = -1): |
| 52 '''Reads data from the trajectory data provided by NGSIM project | 61 '''Reads data from the trajectory data provided by NGSIM project |
| 53 and returns the list of Feature objects''' | 62 and returns the list of Feature objects''' |
| 54 objects = [] | 63 objects = [] |
