Mercurial Hosting > traffic-intelligence
comparison python/cvutils.py @ 266:aba9711b3149
small modificatons and reorganization
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 27 Jul 2012 10:29:24 -0400 |
parents | 571ba5ed22e2 |
children | 9d88a4d97473 |
comparison
equal
deleted
inserted
replaced
265:7a3bf04cf016 | 266:aba9711b3149 |
---|---|
154 else: | 154 else: |
155 obj.projectedPositions = obj.positions | 155 obj.projectedPositions = obj.positions |
156 draw(img, obj.projectedPositions, cvRed, frameNum-obj.getFirstInstant()) | 156 draw(img, obj.projectedPositions, cvRed, frameNum-obj.getFirstInstant()) |
157 cv2.putText(img, '{0}'.format(obj.num), obj.projectedPositions[frameNum-obj.getFirstInstant()].asint().astuple(), cv2.FONT_HERSHEY_PLAIN, 1, cvRed) | 157 cv2.putText(img, '{0}'.format(obj.num), obj.projectedPositions[frameNum-obj.getFirstInstant()].asint().astuple(), cv2.FONT_HERSHEY_PLAIN, 1, cvRed) |
158 cv2.imshow('frame', img) | 158 cv2.imshow('frame', img) |
159 key = cv2.waitKey(50) | 159 key = cv2.waitKey() |
160 if key == 115: | |
161 cv2.imwrite('image.png', img) | |
160 frameNum += 1 | 162 frameNum += 1 |
161 | 163 |
162 def printCvMat(cvmat, out = stdout): | 164 def printCvMat(cvmat, out = stdout): |
163 '''Prints the cvmat to out''' | 165 '''Prints the cvmat to out''' |
164 for i in xrange(cvmat.rows): | 166 for i in xrange(cvmat.rows): |