From 6171054cca1b1120afad2d70a50b6efc0441a831 Mon Sep 17 00:00:00 2001 From: Tomas Musil Date: Sat, 5 Jul 2014 07:17:01 +0200 Subject: [PATCH] remove unused code --- src/gridf3.py | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) diff --git a/src/gridf3.py b/src/gridf3.py index f5e6edb..0697b92 100644 --- a/src/gridf3.py +++ b/src/gridf3.py @@ -210,52 +210,3 @@ def find(lines, size, l1, l2, bounds, hough, show_all, do_something, logger): return grid, grid_lines -def test(): - import pickle - import matplotlib.pyplot as pyplot - - lines = pickle.load(open('lines.pickle')) - - size = (520, 390) - new_lines1 = map(lambda l: Line.from_ad(l, size), lines[0]) - new_lines2 = map(lambda l: Line.from_ad(l, size), lines[1]) - for l1 in new_lines1: - for l2 in new_lines2: - p = Point(intersection(l1, l2)) - p.l1 = l1 - p.l2 = l2 - l1.points.append(p) - l2.points.append(p) - - points = [l.points for l in new_lines1] - - line1, cons = ransac.estimate(points, 2, 800, Diagonal_model) - points2 = map(lambda l: [(p if not p in cons else None) for p in l], points) - line2, cons2 = ransac.estimate(points2, 2, 800, Diagonal_model) - center = intersection(line1, line2) - data = sum(points, []) - diag1 = Line(line1) - diag1.points = ransac.filter_near(data, diag1, 2) - diag2 = Line(line2) - diag2.points = ransac.filter_near(data, diag2, 2) - - plot_line_g(diag1, 520) - plot_line_g(diag2, 520) - pyplot.scatter(*zip(*sum(points, []))) - pyplot.scatter([center[0]], [center[1]], color='r') - pyplot.xlim(0, 520) - pyplot.ylim(0, 390) - pyplot.show() - - grids = map(manual.lines, list(gen_corners(diag1, diag2))) - plot_grid = lambda g: map(lambda l: pyplot.plot(*zip(*l), color='g'), sum(g, [])) - map(plot_grid, grids) - pyplot.show() - - sc, grid = min(map(lambda g: (score(sum(g, []), data), g), grids)) - - map(lambda l: pyplot.plot(*zip(*l), color='g'), sum(grid, [])) - pyplot.scatter(*zip(*sum(points, []))) - pyplot.xlim(0, 520) - pyplot.ylim(0, 390) - pyplot.show() -- 2.4.2