def fix(wvd, movie, scale=2, signal_per_pixel=0, max_dist=60, max_angle=((20.0 * pi) / 180.0)):
    shape = movie[0].shape
    for (fid, wv) in list(wvd.items()):
        print(fid)
        table = CollisionTable(wv, shape, scale)
        r = set(resolution(table, wv))
        for (j, l) in choose_gaps(movie[fid], r, signal_per_pixel, max_dist, max_angle):
            e = reduce(Whisker_Seg.join, j)
            r.discard(j[0])
            r.discard(j[(- 1)])
            r.add(e)
        wvd[fid] = dict([p for p in enumerate(r)])
    return wvd
def fix(wvd, movie, scale=2, signal_per_pixel=0, max_dist=60, max_angle=((20.0 * pi) / 180.0)):
    shape = movie[0].shape
    for (fid, wv) in list(wvd.items()):
        print(fid)
        table = CollisionTable(wv, shape, scale)
        r = set(resolution(table, wv))
        for (j, l) in choose_gaps(movie[fid], r, signal_per_pixel, max_dist, max_angle):
            e = reduce(Whisker_Seg.join, j)
            r.discard(j[0])
            r.discard(j[(- 1)])
            r.add(e)
        wvd[fid] = dict([p for p in enumerate(r)])
    return wvd