Mercurial > hg > nsaunier > traffic-intelligence
comparison python/moving.py @ 368:2db4e76599a1
implemented subsequence extraction and rearranged arguments
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Mon, 15 Jul 2013 15:08:53 -0400 |
| parents | 619ae9a9a788 |
| children | 027e254f0b53 |
comparison
equal
deleted
inserted
replaced
| 367:d44eba0db517 | 368:2db4e76599a1 |
|---|---|
| 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 norm2LCSS(t1, t2, threshold): |
| 543 return utils.LCSS(t1, t2, threshold, Point.distanceNorm2) | 543 return utils.LCSS(t1, t2, lambda x,y: Point.distanceNorm2(x,y) <= threshold) |
| 544 | 544 |
| 545 @staticmethod | 545 @staticmethod |
| 546 def normMaxLCSS(t1, t2, threshold): | 546 def normMaxLCSS(t1, t2, threshold): |
| 547 return utils.LCSS(t1, t2, threshold, lambda p1, p2: (p1-p2).normMax()) | 547 return utils.LCSS(t1, t2, lambda p1, p2: (p1-p2).normMax() <= threshold) |
| 548 | 548 |
| 549 class CurvilinearTrajectory(Trajectory): | 549 class CurvilinearTrajectory(Trajectory): |
| 550 '''Sub class of trajectory for trajectories with curvilinear coordinates and lane assignements | 550 '''Sub class of trajectory for trajectories with curvilinear coordinates and lane assignements |
| 551 longitudinal coordinate is stored as first coordinate (exterior name S) | 551 longitudinal coordinate is stored as first coordinate (exterior name S) |
| 552 lateral coordiante is stored as second coordinate''' | 552 lateral coordiante is stored as second coordinate''' |
