Mercurial > hg > nsaunier > traffic-intelligence
comparison python/moving.py @ 933:8ac7f61c6e4f
major rework of homography calibration, no in ideal points if correcting for distortion
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Fri, 14 Jul 2017 02:11:21 -0400 |
| parents | be28a3538dc9 |
| children | 0e63a918a1ca |
comparison
equal
deleted
inserted
replaced
| 932:66f382852e61 | 933:8ac7f61c6e4f |
|---|---|
| 740 plot(positions[0][:lastCoordinate:timeStep], positions[1][:lastCoordinate:timeStep], options, **kwargs) | 740 plot(positions[0][:lastCoordinate:timeStep], positions[1][:lastCoordinate:timeStep], options, **kwargs) |
| 741 if withOrigin: | 741 if withOrigin: |
| 742 plot([positions[0][0]], [positions[1][0]], 'ro', **kwargs) | 742 plot([positions[0][0]], [positions[1][0]], 'ro', **kwargs) |
| 743 if objNum is not None: | 743 if objNum is not None: |
| 744 text(positions[0][0], positions[1][0], '{}'.format(objNum)) | 744 text(positions[0][0], positions[1][0], '{}'.format(objNum)) |
| 745 | 745 |
| 746 def project(self, homography): | 746 def homographyProject(self, homography): |
| 747 return Trajectory(cvutils.projectTrajectory(homography, self.positions).tolist()) | 747 return Trajectory(cvutils.homographyProject(array(self.positions), homography).tolist()) |
| 748 | |
| 749 def newCameraProject(self, newCameraMatrix): | |
| 750 return Trajectory(cvutils.newCameraProject(array(self.positions), newCameraMatrix).tolist()) | |
| 748 | 751 |
| 749 def plot(self, options = '', withOrigin = False, timeStep = 1, objNum = None, **kwargs): | 752 def plot(self, options = '', withOrigin = False, timeStep = 1, objNum = None, **kwargs): |
| 750 Trajectory._plot(self.positions, options, withOrigin, None, timeStep, objNum, **kwargs) | 753 Trajectory._plot(self.positions, options, withOrigin, None, timeStep, objNum, **kwargs) |
| 751 | 754 |
| 752 def plotAt(self, lastCoordinate, options = '', withOrigin = False, timeStep = 1, objNum = None, **kwargs): | 755 def plotAt(self, lastCoordinate, options = '', withOrigin = False, timeStep = 1, objNum = None, **kwargs): |
