Mercurial Hosting > traffic-intelligence
comparison python/cvutils.py @ 946:e5970606066f
bug fix on list filtering (cannot remove while iterating) and motion prediction keeping the same features
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 21 Jul 2017 11:25:20 -0400 |
parents | 56cc8a1f7082 |
children | 053484e08947 |
comparison
equal
deleted
inserted
replaced
945:05d4302bf67e | 946:e5970606066f |
---|---|
342 objDescription += moving.userTypeNames[obj.userType][0].upper() | 342 objDescription += moving.userTypeNames[obj.userType][0].upper() |
343 if len(annotations) > 0: # if we loaded annotations, but there is no match | 343 if len(annotations) > 0: # if we loaded annotations, but there is no match |
344 if frameNum not in toMatches[obj.getNum()]: | 344 if frameNum not in toMatches[obj.getNum()]: |
345 objDescription += " FA" | 345 objDescription += " FA" |
346 cv2.putText(img, objDescription, obj.projectedPositions[frameNum-obj.getFirstInstant()].asint().astuple(), cv2.FONT_HERSHEY_PLAIN, 1, cvColors[colorType][obj.getNum()]) | 346 cv2.putText(img, objDescription, obj.projectedPositions[frameNum-obj.getFirstInstant()].asint().astuple(), cv2.FONT_HERSHEY_PLAIN, 1, cvColors[colorType][obj.getNum()]) |
347 if obj.getLastInstant() == frameNum: | 347 objects[:] = [obj for obj in objects if obj.getLastInstant() != frameNum] |
348 objects.remove(obj) | |
349 # plot object bounding boxes | 348 # plot object bounding boxes |
350 if frameNum in boundingBoxes.keys(): | 349 if frameNum in boundingBoxes.keys(): |
351 for rect in boundingBoxes[frameNum]: | 350 for rect in boundingBoxes[frameNum]: |
352 cv2.rectangle(img, rect[0].asint().astuple(), rect[1].asint().astuple(), cvColors[colorType][obj.getNum()]) | 351 cv2.rectangle(img, rect[0].asint().astuple(), rect[1].asint().astuple(), cvColors[colorType][obj.getNum()]) |
353 # plot ground truth | 352 # plot ground truth |