Mercurial Hosting > traffic-intelligence
diff python/utils.py @ 333:c9201f6b143a
moved the config parser to utils
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 14 Jun 2013 10:25:00 -0400 |
parents | a6ca86107f27 |
children | 14a2405f54f8 |
line wrap: on
line diff
--- a/python/utils.py Fri Jun 14 09:53:32 2013 -0400 +++ b/python/utils.py Fri Jun 14 10:25:00 2013 -0400 @@ -437,7 +437,19 @@ return optionValues - +class TrackingParameters: + def loadConfigFile(self, filename): + from ConfigParser import ConfigParser + from numpy import loadtxt + + config = ConfigParser() + config.readfp(FakeSecHead(openCheck(filename))) + self.sectionHeader = config.sections()[0] + self.videoFilename = config.get(self.sectionHeader, 'video-filename') + self.databaseFilename = config.get(self.sectionHeader, 'database-filename') + self.homographyFilename = config.get(self.sectionHeader, 'homography-filename') + self.homography = loadtxt(self.homographyFilename) + self.firstFrameNum = config.getint(self.sectionHeader, 'frame1') ######################### # sqlite