Mercurial > hg > nsaunier > traffic-intelligence
comparison trafficintelligence/storage.py @ 1053:60cc87e824c4
Modifying storage.py [configloaders fixing bugs]
| author | Wendlasida |
|---|---|
| date | Thu, 05 Jul 2018 22:24:31 -0400 |
| parents | 1748c02f9ac3 |
| children | d13f9bfbf3ff |
comparison
equal
deleted
inserted
replaced
| 1052:1748c02f9ac3 | 1053:60cc87e824c4 |
|---|---|
| 1364 | 1364 |
| 1365 Note: framerate is already taken into account''' | 1365 Note: framerate is already taken into account''' |
| 1366 | 1366 |
| 1367 def loadTrackerConfig(self, filename = None): | 1367 def loadTrackerConfig(self, filename = None): |
| 1368 from configparser import ConfigParser | 1368 from configparser import ConfigParser |
| 1369 | |
| 1370 config = ConfigParser(strict=False) | |
| 1371 config['DEFAULT']['acceleration-bound'] = '3' | |
| 1372 config['DEFAULT']['min-velocity-cosine'] = '0.8' | |
| 1373 config['DEFAULT']['ndisplacements'] = '3' | |
| 1374 config['DEFAULT']['max-nfeatures'] = '1000' | |
| 1375 config['DEFAULT']['feature-quality'] = '0.0812219538558' | |
| 1376 config['DEFAULT']['min-feature-distanceklt'] = '3.54964337411' | |
| 1377 config['DEFAULT']['block-size'] = '7' | |
| 1378 config['DEFAULT']['use-harris-detector'] = 'false' | |
| 1379 config['DEFAULT']['k'] = '0.04' | |
| 1380 config['DEFAULT']['window-size'] = '6' | |
| 1381 config['DEFAULT']['pyramid-level'] = '5' | |
| 1382 config['DEFAULT']['min-tracking-error'] = '0.183328975142' | |
| 1383 config['DEFAULT']['max-number-iterations'] = '20' | |
| 1384 config['DEFAULT']['feature-flag'] = '0' | |
| 1385 config['DEFAULT']['min-feature-eig-threshold'] = '1e-4' | |
| 1386 config['DEFAULT']['min-feature-time'] = '15' | |
| 1387 config['DEFAULT']['min-feature-displacement'] = '0.05' | |
| 1388 config['DEFAULT']['tracker-reload-time'] = '10' | |
| 1389 | 1369 |
| 1390 self.sectionHeader = config.sections()[0] | 1370 config = ConfigParser({ 'acceleration-bound' : '3', |
| 1391 | 1371 'min-velocity-cosine' : '0.8', |
| 1372 'ndisplacements' : '3', | |
| 1373 'max-nfeatures' : '1000', | |
| 1374 'feature-quality' : '0.0812219538558', | |
| 1375 'min-feature-distanceklt' : '3.54964337411', | |
| 1376 'block-size' : '7', | |
| 1377 'use-harris-detector' : '0', | |
| 1378 'k' : '0.04', | |
| 1379 'window-size' : '6', | |
| 1380 'pyramid-level' : '5', | |
| 1381 'min-tracking-error' : '0.183328975142', | |
| 1382 'max-number-iterations' : '20', | |
| 1383 'feature-flag' : '0', | |
| 1384 'min-feature-eig-threshold' : '1e-4', | |
| 1385 'min-feature-time' : '15', | |
| 1386 'min-feature-displacement' : '0.05', | |
| 1387 'tracker-reload-time' : '10'}, strict=False) | |
| 1392 if filename is not None: | 1388 if filename is not None: |
| 1393 config.read_file(addSectionHeader(utils.openCheck(filename))) | 1389 config.read_file(addSectionHeader(utils.openCheck(filename))) |
| 1390 self.sectionHeader = config.sections()[0] | |
| 1391 else: | |
| 1392 self.sectionHeader = 'DEFAULT' | |
| 1393 | |
| 1394 | 1394 |
| 1395 #Tracker parameters | 1395 #Tracker parameters |
| 1396 self.accelerationBound = config.getint(self.sectionHeader, 'acceleration-bound') | 1396 self.accelerationBound = config.getint(self.sectionHeader, 'acceleration-bound') |
| 1397 self.minVelocityCosine = config.getfloat(self.sectionHeader, 'min-velocity-cosine') | 1397 self.minVelocityCosine = config.getfloat(self.sectionHeader, 'min-velocity-cosine') |
| 1398 self.ndisplacements = config.getfloat(self.sectionHeader, 'ndisplacements') | 1398 self.ndisplacements = config.getint(self.sectionHeader, 'ndisplacements') |
| 1399 self.maxNFeatures = config.getint(self.sectionHeader, 'max-nfeatures') | 1399 self.maxNFeatures = config.getint(self.sectionHeader, 'max-nfeatures') |
| 1400 self.minFeatureDistanceKLT = config.getfloat(self.sectionHeader, 'min-feature-distanceklt') | 1400 self.minFeatureDistanceKLT = config.getfloat(self.sectionHeader, 'min-feature-distanceklt') |
| 1401 self.featureQuality = config.getfloat(self.sectionHeader, 'feature-quality') | 1401 self.featureQuality = config.getfloat(self.sectionHeader, 'feature-quality') |
| 1402 self.blockSize = config.getint(self.sectionHeader, 'block-size') | 1402 self.blockSize = config.getint(self.sectionHeader, 'block-size') |
| 1403 self.useHarrisDetector = config.getboolean(self.sectionHeader, 'use-harris-detector') | 1403 self.useHarrisDetector = config.getboolean(self.sectionHeader, 'use-harris-detector') |
