Mercurial Hosting > traffic-intelligence
comparison python/cvutils.py @ 204:966c2cd2bd9f
added code to load object trajectories (average of features)
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 06 Mar 2012 18:44:03 -0500 |
parents | e2f31813ade6 |
children | 51acf43e421a |
comparison
equal
deleted
inserted
replaced
203:e2f31813ade6 | 204:966c2cd2bd9f |
---|---|
131 if obj.existsAtInstant(frameNum): | 131 if obj.existsAtInstant(frameNum): |
132 #obj.getTimeInterval() | 132 #obj.getTimeInterval() |
133 if homography != None and obj.getFirstInstant() == frameNum: | 133 if homography != None and obj.getFirstInstant() == frameNum: |
134 obj.projectedPositions = obj.positions.project(homography) | 134 obj.projectedPositions = obj.positions.project(homography) |
135 draw(img, obj.projectedPositions, cvRed, frameNum-obj.getFirstInstant()) | 135 draw(img, obj.projectedPositions, cvRed, frameNum-obj.getFirstInstant()) |
136 cv2.putText(img, '{0}'.format(obj.num), obj.projectedPositions[frameNum-obj.getFirstInstant()].astuple(), cv2.FONT_HERSHEY_PLAIN, 1, cvRed) | |
136 cv2.imshow('frame', img) | 137 cv2.imshow('frame', img) |
137 key = cv2.waitKey(50) | 138 key = cv2.waitKey(50) |
138 frameNum += 1 | 139 frameNum += 1 |
139 | 140 |
140 def printCvMat(cvmat, out = stdout): | 141 def printCvMat(cvmat, out = stdout): |