Mercurial Hosting > traffic-intelligence
comparison python/moving.py @ 620:aee4cbac9e0e
corrected bug to plot trajectories on world image (the norm on image coordinates seems to have changed in matplotlib)
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 09 Dec 2014 17:27:14 -0500 |
parents | 17b02c8054d0 |
children | 582508610572 |
comparison
equal
deleted
inserted
replaced
595:17b02c8054d0 | 620:aee4cbac9e0e |
---|---|
682 Trajectory._plot(self.positions, options, withOrigin, None, timeStep, **kwargs) | 682 Trajectory._plot(self.positions, options, withOrigin, None, timeStep, **kwargs) |
683 | 683 |
684 def plotAt(self, lastCoordinate, options = '', withOrigin = False, timeStep = 1, **kwargs): | 684 def plotAt(self, lastCoordinate, options = '', withOrigin = False, timeStep = 1, **kwargs): |
685 Trajectory._plot(self.positions, options, withOrigin, lastCoordinate, timeStep, **kwargs) | 685 Trajectory._plot(self.positions, options, withOrigin, lastCoordinate, timeStep, **kwargs) |
686 | 686 |
687 def plotOnWorldImage(self, nPixelsPerUnitDistance, imageHeight, options = '', withOrigin = False, timeStep = 1, **kwargs): | 687 def plotOnWorldImage(self, nPixelsPerUnitDistance, options = '', withOrigin = False, timeStep = 1, **kwargs): |
688 from matplotlib.pylab import plot | |
689 imgPositions = [[x*nPixelsPerUnitDistance for x in self.positions[0]], | 688 imgPositions = [[x*nPixelsPerUnitDistance for x in self.positions[0]], |
690 [-x*nPixelsPerUnitDistance+imageHeight for x in self.positions[1]]] | 689 [x*nPixelsPerUnitDistance for x in self.positions[1]]] |
691 Trajectory._plot(imgPositions, options, withOrigin, timeStep, **kwargs) | 690 Trajectory._plot(imgPositions, options, withOrigin, None, timeStep, **kwargs) |
692 | 691 |
693 def getXCoordinates(self): | 692 def getXCoordinates(self): |
694 return self.positions[0] | 693 return self.positions[0] |
695 | 694 |
696 def getYCoordinates(self): | 695 def getYCoordinates(self): |