Mercurial > hg > nsaunier > traffic-intelligence
comparison scripts/test-compute-object-position-from-features.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 | 1d90e9080cb2 |
| children | 933670761a57 |
comparison
equal
deleted
inserted
replaced
| 935:0e63a918a1ca | 936:56cc8a1f7082 |
|---|---|
| 39 raise Exception('not implemented') # compute from the features | 39 raise Exception('not implemented') # compute from the features |
| 40 | 40 |
| 41 yCoordinates = -np.ones((len(features),int(timeInterval.length()))) | 41 yCoordinates = -np.ones((len(features),int(timeInterval.length()))) |
| 42 for i,f in enumerate(features): | 42 for i,f in enumerate(features): |
| 43 traj = f.getPositions().asArray() | 43 traj = f.getPositions().asArray() |
| 44 imgTraj = cvutils.projectArray(homography, traj) | 44 imgTraj = cvutils.homographyProject(traj, homography) |
| 45 yCoordinates[i,f.getFirstInstant()-timeInterval.first:f.getLastInstant()+1-timeInterval.first] = imgTraj[1,:] | 45 yCoordinates[i,f.getFirstInstant()-timeInterval.first:f.getLastInstant()+1-timeInterval.first] = imgTraj[1,:] |
| 46 | 46 |
| 47 indices = np.argmax(yCoordinates,0) | 47 indices = np.argmax(yCoordinates,0) |
| 48 newTraj = moving.Trajectory() | 48 newTraj = moving.Trajectory() |
| 49 for j,idx in enumerate(indices): | 49 for j,idx in enumerate(indices): |
