- n = vector.normal()
- l2 = g_line(point.t(), (point + n).t())
- return V(*intersection(l2, g_line(*line)))
-
-def error_surface(lines, a, b, c, d, hough, size, v1):
- import matplotlib.pyplot as plt
- from matplotlib import cm
- import time
- import pickle
- X = []
- Y = []
- Z = []
- s = 0.001
- k = 5
- for i in range(-k, k):
- X.append(range(-k, k))
- Y.append(2*k*[i])
-
- start = time.clock()
- for x in range(0, 2*k):
- try:
- Z.append([distance(lines, get_grid(a + X[x][y] * s * v1, b + Y[x][y] * s * v1,
- c, d, hough, size),
- size) for y in range(0, 2* k)])
- except Exception:
- Z.append(Z[-1])
- o = ((time.clock() - start) * (2 * k - (x + 1))) / (60 * (x + 1))
- print x + 1, "{0} h {1:2.2f} m".format(int(o) / 60, o % 60)
- s_file = open('surface' + str(k), 'w')
- pickle.dump((X, Y, Z), s_file)
- s_file.close()
- plt.imshow(Z, cmap=cm.gnuplot2, interpolation='bicubic',
- origin='upper', extent=(-k, k, -k, k), aspect='equal')
- plt.colorbar()
-
- plt.show()
-
-def find(lines, size, l1, l2, bounds, hough, do_something):
+ return V(*intersection(g_line(point, point + vector.normal), g_line(*line)))
+
+def job_br1(args):
+ X, Y, im_l, a, b, c, d, s, v1, v2, k, hough, size = args
+ return [(distance(im_l,
+ get_grid(a + X[y] * s * v1,
+ b + Y[y] * s * v1,
+ c, d, hough, size),
+ size), a + X[y] * s * v1, b + Y[y] * s * v1) for y in range(2 *k)]
+
+def job_br2(args):
+ X, Y, im_l, a, b, c, d, s, v1, v2, k, hough, size = args
+ return [(distance(im_l,
+ get_grid(a, b, c + X[y] * s * v2,
+ d + Y[y] * s * v2,
+ hough, size),
+ size), c + X[y] * s * v2, d + Y[y] * s * v2) for y in range(2 *k)]
+
+def find(lines, size, l1, l2, bounds, hough, do_something, im_h):