Mercurial Hosting > traffic-intelligence
changeset 1158:7eb972942f22
solving bug to pass kwargs for plotting
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 05 Jan 2021 10:45:39 -0500 |
parents | 173b7926734e |
children | e1e7acef8eab |
files | scripts/compute-clearmot.py trafficintelligence/cvutils.py |
diffstat | 2 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/compute-clearmot.py Wed Oct 21 10:38:30 2020 -0400 +++ b/scripts/compute-clearmot.py Tue Jan 05 10:45:39 2021 -0500 @@ -48,7 +48,7 @@ mask = mask[:,:,0] for obj in objects: maskObjects += obj.getObjectsInMask(mask, invHomography, 10) # TODO add option to keep object if at least one feature in mask - objects = maskObjects + objects = maskObjects annotations = storage.loadBBMovingObjectsFromSqlite(args.groundTruthDatabaseFilename) for a in annotations:
--- a/trafficintelligence/cvutils.py Wed Oct 21 10:38:30 2020 -0400 +++ b/trafficintelligence/cvutils.py Tue Jan 05 10:45:39 2021 -0500 @@ -312,7 +312,7 @@ else: run(cmd) - def displayTrajectories(videoFilename, objects, boundingBoxes = {}, homography = None, firstFrameNum = 0, lastFrameNumArg = None, printFrames = True, rescale = 1., nFramesStep = 1, saveAllImages = False, nZerosFilenameArg = None, undistort = False, intrinsicCameraMatrix = None, distortionCoefficients = None, undistortedImageMultiplication = 1., annotations = [], gtMatches = {}, toMatches = {}, colorBlind = False): + def displayTrajectories(videoFilename, objects, boundingBoxes = {}, homography = None, firstFrameNum = 0, lastFrameNumArg = None, printFrames = True, rescale = 1., nFramesStep = 1, saveAllImages = False, nZerosFilenameArg = None, undistort = False, intrinsicCameraMatrix = None, distortionCoefficients = None, undistortedImageMultiplication = 1., annotations = [], gtMatches = {}, toMatches = {}, colorBlind = False, **kwargs): '''Displays the objects overlaid frame by frame over the video ''' if colorBlind: colorType = 'colorblind' @@ -359,7 +359,7 @@ obj.projectedPositions = obj.getPositions().homographyProject(homography) if undistort: obj.projectedPositions = obj.projectedPositions.newCameraProject(newCameraMatrix) - cvPlot(img, obj.projectedPositions, cvColors[colorType][obj.getNum()], frameNum-obj.getFirstInstant()) + cvPlot(img, obj.projectedPositions, cvColors[colorType][obj.getNum()], frameNum-obj.getFirstInstant(), **kwargs) if frameNum not in boundingBoxes and obj.hasFeatures(): yCropMin, yCropMax, xCropMin, xCropMax = imageBoxSize(obj, frameNum, homography, width, height) cv2.rectangle(img, (xCropMin, yCropMin), (xCropMax, yCropMax), cvBlue[colorType], 1)