Mercurial Hosting > traffic-intelligence
diff python/tests/moving.txt @ 345:fa64b2e3a64f
added simple classification based on speed
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 25 Jun 2013 23:43:32 -0400 |
parents | f2cf16ad798f |
children | 027e254f0b53 |
line wrap: on
line diff
--- a/python/tests/moving.txt Fri Jun 21 17:32:57 2013 -0400 +++ b/python/tests/moving.txt Tue Jun 25 23:43:32 2013 -0400 @@ -79,3 +79,14 @@ 3 >>> Trajectory.normMaxLCSS(t1, t1, 0.1) 3 + +>>> o1 = MovingObject(positions = Trajectory([[0]*3,[2]*3]), velocities = Trajectory([[0]*3,[1]*3])) +>>> o1.classifyUserTypeSpeed(0.5, np.median) +>>> userTypeNames[o1.getUserType()] +'car' +>>> o1.classifyUserTypeSpeed(0.5, np.mean) +>>> userTypeNames[o1.getUserType()] +'car' +>>> o1.classifyUserTypeSpeed(1.5, np.median) +>>> userTypeNames[o1.getUserType()] +'pedestrian'