1 import matplotlib.pyplot as plt
2 from matplotlib import cm
11 X, Y, im_l, a, b, c, d, s, v1, k, hough, size = args
12 return [gridf.distance(im_l,
13 gridf.get_grid(a + X[y] * s * v1,
16 size) for y in range(2 * k)]
18 X, Y, im_l, a, b, c, d, s, v1, v2, k, hough, size = args
19 return [gridf.distance(im_l,
20 gridf.get_grid(a, b, c+ X[y] * s * v2,
23 size) for y in range(2 * k)]
25 def error_surface(im_l, a, b, c, d, hough, size, v1, v2):
31 for i in range(-k, k):
32 X.append(range(-k, k))
35 tasks = [(X[x], Y[x], im_l, a, b, c, d, s, v1, v2, k, hough, size) for x in xrange(0, 2 * k)]
37 pool = multiprocessing.Pool(None)
40 Z = pool.map(job2, tasks, 1)
41 print time.time() - start
43 s_file = open('surface' + str(k), 'w')
44 pickle.dump((X, Y, Z), s_file)
46 plt.imshow(Z, cmap=cm.jet, interpolation='bicubic',
47 origin='upper', extent=(-k, k, -k, k), aspect='equal')