Mercurial > hg > nsaunier > traffic-intelligence
comparison scripts/compute-clearmot.py @ 998:933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Sun, 27 May 2018 23:22:48 -0400 |
| parents | 51d8406b2489 |
| children | cc5cb04b04b0 |
comparison
equal
deleted
inserted
replaced
| 997:4f3387a242a1 | 998:933670761a57 |
|---|---|
| 1 #! /usr/bin/env python | 1 #! /usr/bin/env python3 |
| 2 | 2 |
| 3 import sys, argparse | 3 import sys, argparse |
| 4 from numpy import loadtxt | 4 from numpy import loadtxt |
| 5 from numpy.linalg import inv | 5 from numpy.linalg import inv |
| 6 import moving, storage, cvutils | 6 import moving, storage, cvutils |
| 69 print 'Number of false alarms.frames: {}'.format(fpt) | 69 print 'Number of false alarms.frames: {}'.format(fpt) |
| 70 | 70 |
| 71 def shiftMatches(matches, offset): | 71 def shiftMatches(matches, offset): |
| 72 shifted = {} | 72 shifted = {} |
| 73 for k in matches: | 73 for k in matches: |
| 74 shifted[k] = {t+offset:v for t, v in matches[k].iteritems()} | 74 shifted[k] = {t+offset:v for t, v in matches[k].items()} |
| 75 return shifted | 75 return shifted |
| 76 | 76 |
| 77 if args.display: | 77 if args.display: |
| 78 if args.undistort and args.intrinsicCameraMatrixFilename is not None: | 78 if args.undistort and args.intrinsicCameraMatrixFilename is not None: |
| 79 intrinsicCameraMatrix = loadtxt(args.intrinsicCameraMatrixFilename) | 79 intrinsicCameraMatrix = loadtxt(args.intrinsicCameraMatrixFilename) |
