Mercurial Hosting > traffic-intelligence
comparison python/cvutils.py @ 528:5585ebd8ad61
corrected bugs for trajectory display for new code versions
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 25 Jun 2014 16:52:34 -0400 |
parents | fd9641cbd24b |
children | bd1ad468e928 |
comparison
equal
deleted
inserted
replaced
527:37830a831818 | 528:5585ebd8ad61 |
---|---|
249 obj.projectedPositions = obj.positions | 249 obj.projectedPositions = obj.positions |
250 cvPlot(img, obj.projectedPositions, cvRed, frameNum-obj.getFirstInstant()) | 250 cvPlot(img, obj.projectedPositions, cvRed, frameNum-obj.getFirstInstant()) |
251 if frameNum in boundingBoxes.keys(): | 251 if frameNum in boundingBoxes.keys(): |
252 for rect in boundingBoxes[frameNum]: | 252 for rect in boundingBoxes[frameNum]: |
253 cv2.rectangle(img, rect[0].asint().astuple(), rect[1].asint().astuple(), cvRed) | 253 cv2.rectangle(img, rect[0].asint().astuple(), rect[1].asint().astuple(), cvRed) |
254 elif obj.features != None: | 254 elif len(obj.features) != 0: |
255 imgcrop, yCropMin, yCropMax, xCropMin, xCropMax = imageBox(img, obj, frameNum, homography, width, height) | 255 imgcrop, yCropMin, yCropMax, xCropMin, xCropMax = imageBox(img, obj, frameNum, homography, width, height) |
256 cv2.rectangle(img, (xCropMin, yCropMin), (xCropMax, yCropMax), cvBlue, 1) | 256 cv2.rectangle(img, (xCropMin, yCropMin), (xCropMax, yCropMax), cvBlue, 1) |
257 objDescription = '{} '.format(obj.num) | 257 objDescription = '{} '.format(obj.num) |
258 if userTypeNames[obj.userType] != 'unknown': | 258 if userTypeNames[obj.userType] != 'unknown': |
259 objDescription += userTypeNames[obj.userType][0].upper() | 259 objDescription += userTypeNames[obj.userType][0].upper() |