Mercurial > hg > nsaunier > traffic-intelligence
diff trafficintelligence/cvutils.py @ 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 | b358bed29ab4 |
| children | d71a4d174b1a |
line wrap: on
line diff
--- 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)
