Mercurial Hosting > traffic-intelligence
comparison python/moving.py @ 369:027e254f0b53
lcss subclass for indicators
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 15 Jul 2013 16:47:09 -0400 |
parents | 2db4e76599a1 |
children | 349eb1e09f45 |
comparison
equal
deleted
inserted
replaced
368:2db4e76599a1 | 369:027e254f0b53 |
---|---|
537 return traj | 537 return traj |
538 | 538 |
539 # version 2: use shapely polygon contains | 539 # version 2: use shapely polygon contains |
540 | 540 |
541 @staticmethod | 541 @staticmethod |
542 def norm2LCSS(t1, t2, threshold): | 542 def lcss(t1, t2, lcss): |
543 return utils.LCSS(t1, t2, lambda x,y: Point.distanceNorm2(x,y) <= threshold) | 543 return lcss.compute(t1, t2) |
544 | |
545 @staticmethod | |
546 def normMaxLCSS(t1, t2, threshold): | |
547 return utils.LCSS(t1, t2, lambda p1, p2: (p1-p2).normMax() <= threshold) | |
548 | 544 |
549 class CurvilinearTrajectory(Trajectory): | 545 class CurvilinearTrajectory(Trajectory): |
550 '''Sub class of trajectory for trajectories with curvilinear coordinates and lane assignements | 546 '''Sub class of trajectory for trajectories with curvilinear coordinates and lane assignements |
551 longitudinal coordinate is stored as first coordinate (exterior name S) | 547 longitudinal coordinate is stored as first coordinate (exterior name S) |
552 lateral coordiante is stored as second coordinate''' | 548 lateral coordiante is stored as second coordinate''' |