Mercurial > hg > nsaunier > traffic-intelligence
comparison python/utils.py @ 421:4fce27946c60
first example of video metadata using sqlalchemy
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 09 Oct 2013 23:25:51 -0400 |
| parents | a9e275b4ecb7 |
| children | f738fa1b69f0 |
comparison
equal
deleted
inserted
replaced
| 420:def795d1120f | 421:4fce27946c60 |
|---|---|
| 8 __metaclass__ = type | 8 __metaclass__ = type |
| 9 | 9 |
| 10 commentChar = '#' | 10 commentChar = '#' |
| 11 | 11 |
| 12 delimiterChar = '%'; | 12 delimiterChar = '%'; |
| 13 | |
| 14 datetimeFormat = "%Y-%m-%d %H:%M:%S" | |
| 13 | 15 |
| 14 ######################### | 16 ######################### |
| 15 # Enumerations | 17 # Enumerations |
| 16 ######################### | 18 ######################### |
| 17 | 19 |
| 544 self.databaseFilename = config.get(sectionName, 'data-filename') | 546 self.databaseFilename = config.get(sectionName, 'data-filename') |
| 545 self.homographyFilename = config.get(sectionName, 'homography-filename') | 547 self.homographyFilename = config.get(sectionName, 'homography-filename') |
| 546 self.calibrationFilename = config.get(sectionName, 'calibration-filename') | 548 self.calibrationFilename = config.get(sectionName, 'calibration-filename') |
| 547 self.videoFilename = config.get(sectionName, 'video-filename') | 549 self.videoFilename = config.get(sectionName, 'video-filename') |
| 548 self.frameRate = config.getfloat(sectionName, 'framerate') | 550 self.frameRate = config.getfloat(sectionName, 'framerate') |
| 549 self.date = datetime.strptime(config.get(sectionName, 'date'), "%Y-%m-%d %H:%M:%S") # 2011-06-22 11:00:39 | 551 self.date = datetime.strptime(config.get(sectionName, 'date'), datetimeFormat) # 2011-06-22 11:00:39 |
| 550 self.translation = literal_eval(config.get(sectionName, 'translation')) # = [0.0, 0.0] | 552 self.translation = literal_eval(config.get(sectionName, 'translation')) # = [0.0, 0.0] |
| 551 self.rotation = config.getfloat(sectionName, 'rotation') | 553 self.rotation = config.getfloat(sectionName, 'rotation') |
| 552 self.duration = config.getint(sectionName, 'duration') | 554 self.duration = config.getint(sectionName, 'duration') |
| 553 except NoOptionError as e: | 555 except NoOptionError as e: |
| 554 print(e) | 556 print(e) |
