Commits

Nicolas Saunier committed ce4eaab

modified internal implementation of user type for classifyUserTypeArea

  • Participants
  • Parent commits ce40a89

Comments (0)

Files changed (1)

                 self.projectedPositions = obj.positions.project(homography)
             else:
                 self.projectedPositions = obj.positions
-        possibleUserTypes = {}
-        for userTypename in userTypenames:
-            possibleUserTypes[userTypename] = 0
+        possibleUserTypes = {userType: 0 for userType in range(len(userTypenames))}
         for p in self.projectedPositions:
             for userTypename in areas:
                 if areas[userTypename][p.x, p.y] != 0:
-                    possibleUserTypes[userTypename] += 1
+                    possibleUserTypes[userType2Enum[userTypename]] += 1
         # what to do: threshold for most common type? self.setUserType()
         return possibleUserTypes