diff python/moving.py @ 621:582508610572

merge and updated consistently that imageheight does not seem necessary anymore for plotting on world image
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 10 Dec 2014 15:29:57 -0500
parents dc2d0a0d7fe1 aee4cbac9e0e
children dc8490726d06
line wrap: on
line diff
--- a/python/moving.py	Wed Dec 10 15:27:08 2014 -0500
+++ b/python/moving.py	Wed Dec 10 15:29:57 2014 -0500
@@ -684,11 +684,10 @@
     def plotAt(self, lastCoordinate, options = '', withOrigin = False, timeStep = 1, **kwargs):
         Trajectory._plot(self.positions, options, withOrigin, lastCoordinate, timeStep, **kwargs)
 
-    def plotOnWorldImage(self, nPixelsPerUnitDistance, imageHeight, options = '', withOrigin = False, timeStep = 1, **kwargs):
-        from matplotlib.pylab import plot
+    def plotOnWorldImage(self, nPixelsPerUnitDistance, options = '', withOrigin = False, timeStep = 1, **kwargs):
         imgPositions = [[x*nPixelsPerUnitDistance for x in self.positions[0]],
-                        [-x*nPixelsPerUnitDistance+imageHeight for x in self.positions[1]]]
-        Trajectory._plot(imgPositions, options, withOrigin, timeStep, **kwargs)
+                        [x*nPixelsPerUnitDistance for x in self.positions[1]]]
+        Trajectory._plot(imgPositions, options, withOrigin, None, timeStep, **kwargs)
 
     def getXCoordinates(self):
         return self.positions[0]
@@ -1014,8 +1013,8 @@
         else:
             self.positions.plot(options, withOrigin, timeStep, **kwargs)
 
-    def plotOnWorldImage(self, nPixelsPerUnitDistance, imageHeight, options = '', withOrigin = False, timeStep = 1, **kwargs):
-        self.positions.plotOnWorldImage(nPixelsPerUnitDistance, imageHeight, options, withOrigin, timeStep, **kwargs)
+    def plotOnWorldImage(self, nPixelsPerUnitDistance, options = '', withOrigin = False, timeStep = 1, **kwargs):
+        self.positions.plotOnWorldImage(nPixelsPerUnitDistance, options, withOrigin, timeStep, **kwargs)
 
     def play(self, videoFilename, homography = None):
         cvutils.displayTrajectories(videoFilename, [self], homography, self.getFirstInstant(), self.getLastInstant())