def __len__(self):
return 2
+ def to_tuple(self):
+ return (self.x, self.y)
+
class Line:
def __init__(self, (a, b, c)):
self.a, self.b, self.c = (a, b, c)
c2 = [p for p in d2.points if p in c1.l1.points][0]
c3 = [p for p in d1.points if p in c2.l2.points][0]
c4 = [p for p in d2.points if p in c3.l1.points][0]
- yield [c1, c2, c3, c4]
+ yield map(lambda p: p.to_tuple(), [c1, c2, c3, c4])
def dst(p, l):
(x, y), (a, b, c) = p, ransac.points_to_line(*l)
s = min(map(lambda l: dst(p, l), lines))
s = min(s, 2)
score += s
- print score
return score