Mercurial > hg > nsaunier > traffic-intelligence
comparison python/moving.py @ 523:ce4eaabacc26
modified internal implementation of user type for classifyUserTypeArea
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 18 Jun 2014 23:40:47 -0400 |
| parents | ce40a89bd6ae |
| children | 1dced8932b08 |
comparison
equal
deleted
inserted
replaced
| 522:ce40a89bd6ae | 523:ce4eaabacc26 |
|---|---|
| 916 if not hasattr(self, projectedPositions): | 916 if not hasattr(self, projectedPositions): |
| 917 if homography != None: | 917 if homography != None: |
| 918 self.projectedPositions = obj.positions.project(homography) | 918 self.projectedPositions = obj.positions.project(homography) |
| 919 else: | 919 else: |
| 920 self.projectedPositions = obj.positions | 920 self.projectedPositions = obj.positions |
| 921 possibleUserTypes = {} | 921 possibleUserTypes = {userType: 0 for userType in range(len(userTypenames))} |
| 922 for userTypename in userTypenames: | |
| 923 possibleUserTypes[userTypename] = 0 | |
| 924 for p in self.projectedPositions: | 922 for p in self.projectedPositions: |
| 925 for userTypename in areas: | 923 for userTypename in areas: |
| 926 if areas[userTypename][p.x, p.y] != 0: | 924 if areas[userTypename][p.x, p.y] != 0: |
| 927 possibleUserTypes[userTypename] += 1 | 925 possibleUserTypes[userType2Enum[userTypename]] += 1 |
| 928 # what to do: threshold for most common type? self.setUserType() | 926 # what to do: threshold for most common type? self.setUserType() |
| 929 return possibleUserTypes | 927 return possibleUserTypes |
| 930 | 928 |
| 931 @staticmethod | 929 @staticmethod |
| 932 def collisionCourseDotProduct(movingObject1, movingObject2, instant): | 930 def collisionCourseDotProduct(movingObject1, movingObject2, instant): |
