Mercurial Hosting > traffic-intelligence
diff python/cvutils.py @ 223:c31722fcc9de
minor modifications for integer drawing in OpenCV
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 26 Jun 2012 03:29:57 -0400 |
parents | b5772df11b37 |
children | 37a434fb848e |
line wrap: on
line diff
--- a/python/cvutils.py Tue Jun 26 02:08:01 2012 -0400 +++ b/python/cvutils.py Tue Jun 26 03:29:57 2012 -0400 @@ -90,7 +90,7 @@ if lastCoordinate != None and lastCoordinate >=0: last = min(positions.length()-1, lastCoordinate) for i in range(0, last-1): - cv2.line(img, positions[i].astuple(), positions[i+1].astuple(), color) + cv2.line(img, positions[i].asint().astuple(), positions[i+1].asint().astuple(), color) def playVideo(filename): '''Plays the video''' @@ -142,7 +142,7 @@ else: obj.projectedPositions = obj.positions draw(img, obj.projectedPositions, cvRed, frameNum-obj.getFirstInstant()) - cv2.putText(img, '{0}'.format(obj.num), obj.projectedPositions[frameNum-obj.getFirstInstant()].astuple(), cv2.FONT_HERSHEY_PLAIN, 1, cvRed) + cv2.putText(img, '{0}'.format(obj.num), obj.projectedPositions[frameNum-obj.getFirstInstant()].asint().astuple(), cv2.FONT_HERSHEY_PLAIN, 1, cvRed) cv2.imshow('frame', img) key = cv2.waitKey(50) frameNum += 1