Mercurial Hosting > traffic-intelligence
diff trafficintelligence/cvutils.py @ 1253:ef68d4ba7dae
added loading ego vehicle in kitti 2D format and method to plot outline
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 25 Mar 2024 17:05:20 -0400 |
parents | 371c718e57d7 |
children |
line wrap: on
line diff
--- a/trafficintelligence/cvutils.py Fri Mar 22 14:33:25 2024 -0400 +++ b/trafficintelligence/cvutils.py Mon Mar 25 17:05:20 2024 -0400 @@ -30,6 +30,7 @@ trackerExe = 'feature-based-tracking' #importaggdraw # agg on top of PIL (antialiased drawing) +colors = 'rgbcymk' cvRed = {'default': (0,0,255), 'colorblind': (0,114,178)} cvGreen = {'default': (0,255,0), @@ -534,7 +535,10 @@ def cartesian2Homogeneous(m): 'Transforms n x m matrix to n x (m+1) by adding last column of 1s' - homoM = ones((m.shape[0], m.shape[1]+1)) + if len(m.shape) == 2: + homoM = ones((m.shape[0], m.shape[1]+1)) + else: + homoM = ones((1, len(m)+1)) homoM[:,:-1] = m return homoM