def sampled(line,NUM_SAMPLES): pts = [] (start,end) = Vector2D.end_points(line) dist = Vector2D.pt_distance(start,end) for i in range(NUM_SAMPLES): pt = Vector2D.extrapolate(line, dist * i / float(NUM_SAMPLES)) pts.append(pt) return pts
def draw_seg(self,img,seg,color): (start,end) = Vector2D.end_points(seg) cv.Line(img,start,end,color,3)