diff python/moving.py @ 936:56cc8a1f7082

removed all old versions of projection methods
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 14 Jul 2017 16:48:42 -0400
parents 0e63a918a1ca
children b67a784beb69
line wrap: on
line diff
--- a/python/moving.py	Fri Jul 14 16:30:57 2017 -0400
+++ b/python/moving.py	Fri Jul 14 16:48:42 2017 -0400
@@ -263,8 +263,8 @@
         def asShapely(self):
             return shapelyPoint(self.x, self.y)
 
-    def project(self, homography):
-        projected = cvutils.projectArray(homography, array([[self.x], [self.y]]))
+    def homographyProject(self, homography):
+        projected = cvutils.homographyProject(array([[self.x], [self.y]]), homography)
         return Point(projected[0], projected[1])
 
     def inPolygon(self, polygon):
@@ -1173,7 +1173,7 @@
         '''Returns new objects made of the positions in the mask
         mask is in the destination of the homography space'''
         if homography is not None:
-            self.projectedPositions = self.positions.project(homography)
+            self.projectedPositions = self.positions.homographyProject(homography)
         else:
             self.projectedPositions = self.positions
         def inMask(positions, i, mask):
@@ -1644,7 +1644,7 @@
         print('not implemented/tested yet')
         if not hasattr(self, projectedPositions):
             if homography is not None:
-                self.projectedPositions = obj.positions.project(homography)
+                self.projectedPositions = obj.positions.homographyProject(homography)
             else:
                 self.projectedPositions = obj.positions
         possibleUserTypes = {userType: 0 for userType in range(len(userTypenames))}
@@ -1716,7 +1716,7 @@
     def computeCentroidTrajectory(self, homography = None):
         self.positions = self.topLeftPositions.add(self.bottomRightPositions).multiply(0.5)
         if homography is not None:
-            self.positions = self.positions.project(homography)
+            self.positions = self.positions.homographyProject(homography)
 
     def matches(self, obj, instant, matchingDistance):
         '''Indicates if the annotation matches obj (MovingObject)