comparison trafficintelligence/moving.py @ 1212:af329f3330ba

work in progress on 3D safety analysis
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 02 May 2023 17:11:24 -0400
parents 1bad5f9b60de
children 3f2214125164
comparison
equal deleted inserted replaced
1211:a095d4fbb2ea 1212:af329f3330ba
1826 xj = array(fj.getXCoordinates()[inter.first-fj.getFirstInstant():int(fj.length())-(fj.getLastInstant()-inter.last)]) 1826 xj = array(fj.getXCoordinates()[inter.first-fj.getFirstInstant():int(fj.length())-(fj.getLastInstant()-inter.last)])
1827 yj = array(fj.getYCoordinates()[inter.first-fj.getFirstInstant():int(fj.length())-(fj.getLastInstant()-inter.last)]) 1827 yj = array(fj.getYCoordinates()[inter.first-fj.getFirstInstant():int(fj.length())-(fj.getLastInstant()-inter.last)])
1828 relativePositions[(i,j)] = Point(median(xj-xi), median(yj-yi)) 1828 relativePositions[(i,j)] = Point(median(xj-xi), median(yj-yi))
1829 relativePositions[(j,i)] = -relativePositions[(i,j)] 1829 relativePositions[(j,i)] = -relativePositions[(i,j)]
1830 1830
1831 def computeBoundingPolygon(self, t, shape = 'raw'): 1831 def getBoundingPolygon(self, t, shape = 'raw'):
1832 '''Returns a bounding box for the feature positions at instant 1832 '''Returns a bounding box for the feature positions at instant
1833 bounding box format is a list of points 1833 bounding box format is a list of points
1834 shape is the type of output shape: 1834 shape is the type of output shape:
1835 - raw means the list of feature positions 1835 - raw means the list of feature positions
1836 - rect means the bounding rectangle aligned with velocity''' 1836 - rect means the bounding rectangle aligned with velocity'''