comparison 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
comparison
equal deleted inserted replaced
332:a6ca86107f27 333:c9201f6b143a
435 print(optionValues) 435 print(optionValues)
436 sys.exit() 436 sys.exit()
437 437
438 return optionValues 438 return optionValues
439 439
440 440 class TrackingParameters:
441 def loadConfigFile(self, filename):
442 from ConfigParser import ConfigParser
443 from numpy import loadtxt
444
445 config = ConfigParser()
446 config.readfp(FakeSecHead(openCheck(filename)))
447 self.sectionHeader = config.sections()[0]
448 self.videoFilename = config.get(self.sectionHeader, 'video-filename')
449 self.databaseFilename = config.get(self.sectionHeader, 'database-filename')
450 self.homographyFilename = config.get(self.sectionHeader, 'homography-filename')
451 self.homography = loadtxt(self.homographyFilename)
452 self.firstFrameNum = config.getint(self.sectionHeader, 'frame1')
441 453
442 ######################### 454 #########################
443 # sqlite 455 # sqlite
444 ######################### 456 #########################
445 457