disegna.py
Go to the documentation of this file.
1 import os
2 import random
3 
4 import cv2
5 import matplotlib
6 import matplotlib.cm as cmx
7 import matplotlib.colors as colors
8 import matplotlib.patches as patches
9 import matplotlib.path as mplPath
10 import numpy as np
11 from descartes import PolygonPatch
12 from matplotlib import pyplot as plt
13 from random import randint
14 from PIL import Image
15 import rospy
16 
17 default_format = ".pdf"
18 normal_format = ".png"
19 
20 def setup_plot(size):
21  plt.clf()
22  plt.cla()
23  plt.close('all')
24  width = size[0]/100
25  height = size[1]/100
26  fig, ax = plt.subplots()
27  fig.set_size_inches(width, height)
28  ax = plt.Axes(fig, [0., 0., 1., 1.])
29  ax.axis('off')
30  fig.add_axes(ax)
31  return fig, ax
32 
33 
34 def draw_image(image, name, size, format=default_format, filepath='.'):
35  rospy.loginfo("[rose2] ", name)
36  fig, ax = setup_plot(size)
37  title = os.path.join(filepath, name)
38  ax.imshow(image)
39  plt.savefig(title + format)
40  plt.savefig(title + normal_format)
41 
42 
43 def draw_canny(image, name, format=default_format, filepath='.'):
44  rospy.loginfo("[rose2] {}".format(name))
45  fig, ax = setup_plot()
46  title = os.path.join(filepath, name)
47  ax.imshow(image, cmap='Greys')
48  plt.savefig(title + format)
49  plt.savefig(title + normal_format)
50 
51 
52 def draw_hough(image, walls, name, size, format=default_format, filepath='.'):
53  rospy.loginfo("[rose2] {}".format(name))
54  fig, ax = setup_plot(size)
55  title = os.path.join(filepath, name)
56  img = image.copy()
57  if len(img.shape) == 2:
58  img = cv2.cvtColor(img, cv2.COLOR_GRAY2RGB)
59  for x1, y1, x2, y2 in walls:
60  cv2.line(img, (x1, y1), (x2, y2), (randint(0, 255), randint(0, 255), randint(0, 255)), 3)
61  ax.imshow(img, cmap='Greys')
62  plt.savefig(title + format)
63  plt.savefig(title + normal_format)
64 
65 
66 def draw_walls(walls, name, size, format=default_format, filepath='.'):
67  rospy.loginfo("[rose2] {}".format(name))
68  fig, ax = setup_plot(size)
69  x_coordinates = []
70  y_coordinates = []
71  title = os.path.join(filepath, name)
72  img = np.zeros((size[1], size[0], 3), np.uint8)
73  img[:, :] = (255, 255, 255)
74  ax.imshow(img)
75  for wall in walls:
76  x1 = wall.x1
77  x2 = wall.x2
78  y1 = wall.y1
79  y2 = wall.y2
80  x_coordinates.extend((x1, x2))
81  y_coordinates.extend((y1, y2))
82  ax.plot(x_coordinates, y_coordinates, color=np.random.rand(3,), linewidth=1)
83  del x_coordinates[:]
84  del y_coordinates[:]
85  plt.savefig(title + format)
86  plt.savefig(title + normal_format)
87 
88 
89 def draw_contour(vertices, name, size, format=default_format, filepath='.'):
90  # draw the external contour of the metric map
91  rospy.loginfo("[rose2] {}".format(name))
92  fig, ax = setup_plot(size)
93  title = os.path.join(filepath, name)
94  img = np.zeros((size[1], size[0], 3), np.uint8)
95  img[:, :] = (255, 255, 255)
96  ax.imshow(img)
97  bbPath = mplPath.Path(vertices)
98  patch = patches.PathPatch(bbPath, facecolor='orange', lw=2)
99  ax.add_patch(patch)
100  # ax.set_xlim(x_min - 1, x_max + 1)
101  # ax.set_ylim(y_min - 1, y_max + 1)
102  plt.savefig(title + format)
103  plt.savefig(title + normal_format)
104 
105 
106 def draw_angular_clusters(angular_clusters, walls, name, size, format=default_format, filepath='.'):
107  rospy.loginfo("[rose2] {}".format(name))
108  x_coordinates = []
109  y_coordinates = []
110  fig, ax = setup_plot(size)
111  title = os.path.join(filepath, name)
112  img = np.zeros((size[1], size[0], 3), np.uint8)
113  img[:, :] = (255, 255, 255)
114  ax.imshow(img)
115  num_of_colors = len(set(angular_clusters))
116  cm = plt.get_cmap("nipy_spectral")
117  cNorm = colors.Normalize(vmin=0, vmax=num_of_colors)
118  scalar_map = cmx.ScalarMappable(norm=cNorm, cmap=cm)
119  for index, c in enumerate(np.random.permutation(list(set(angular_clusters)))):
120  for wall in walls:
121  if wall.angular_cluster == c:
122  x_coordinates.extend((wall.x1, wall.x2))
123  y_coordinates.extend((wall.y1, wall.y2))
124  ax.plot(x_coordinates, y_coordinates, color=colors.rgb2hex(scalar_map.to_rgba(index)), linewidth=1)
125  del x_coordinates[:]
126  del y_coordinates[:]
127  plt.savefig(title + format)
128  plt.savefig(title + normal_format)
129 
130 
131 def draw_representative_segments(representatives_segments, name, size, format=default_format, filepath='.'):
132  rospy.loginfo("[rose2] {}".format(name))
133  fig, ax = setup_plot(size)
134  x_coordinates = []
135  y_coordinates = []
136  title = os.path.join(filepath, name)
137  img = np.zeros((size[1], size[0], 3), np.uint8)
138  img[:, :] = (255, 255, 255)
139  ax.imshow(img)
140  for wall in representatives_segments:
141  x1 = wall.x1
142  x2 = wall.x2
143  y1 = wall.y1
144  y2 = wall.y2
145  x_coordinates.extend((x1, x2))
146  y_coordinates.extend((y1, y2))
147  ax.plot(x_coordinates, y_coordinates, color='k', linewidth=1)
148  del x_coordinates[:]
149  del y_coordinates[:]
150  plt.savefig(title + format)
151  plt.savefig(title + normal_format)
152 
153 
154 def draw_spatial_wall_clusters(wall_clusters, walls, name, size, format=default_format, filepath='.'):
155  rospy.loginfo("[rose2] {}".format(name))
156  x_coordinates = []
157  y_coordinates = []
158  fig, ax = setup_plot(size)
159  title = os.path.join(filepath, name)
160  img = np.zeros((size[1], size[0], 3), np.uint8)
161  img[:, :] = (255, 255, 255)
162  ax.imshow(img)
163  num_of_colors = len(set(wall_clusters))
164  cm = plt.get_cmap("nipy_spectral")
165  cNorm = colors.Normalize(vmin=0, vmax=num_of_colors)
166  scalar_map = cmx.ScalarMappable(norm=cNorm, cmap=cm)
167  for index, c in enumerate(np.random.permutation(list(set(wall_clusters)))):
168  for wall in walls:
169  if wall.wall_cluster == c:
170  x_coordinates.extend((wall.x1, wall.x2))
171  y_coordinates.extend((wall.y1, wall.y2))
172  ax.plot(x_coordinates, y_coordinates, color=colors.rgb2hex(scalar_map.to_rgba(index)), linewidth=1)
173  del x_coordinates[:]
174  del y_coordinates[:]
175  plt.savefig(title + format)
176  plt.savefig(title + normal_format)
177 
178 
179 def draw_spatial_clusters(spatial_clusters, walls, name, size, format=default_format, filepath='.'):
180  rospy.loginfo("[rose2] {}".format(name))
181  x_coordinates = []
182  y_coordinates = []
183  fig, ax = setup_plot(size)
184  title = os.path.join(filepath, name)
185  img = np.zeros((size[1], size[0], 3), np.uint8)
186  img[:, :] = (255, 255, 255)
187  ax.imshow(img)
188  num_of_colors = len(set(spatial_clusters))
189  cm = plt.get_cmap("nipy_spectral")
190  cNorm = colors.Normalize(vmin=0, vmax=num_of_colors)
191  scalar_map = cmx.ScalarMappable(norm=cNorm, cmap=cm)
192  for index, c in enumerate(np.random.permutation(list(set(spatial_clusters)))):
193  for wall in walls:
194  if wall.spatial_cluster == c:
195  x_coordinates.extend((wall.x1, wall.x2))
196  y_coordinates.extend((wall.y1, wall.y2))
197  ax.plot(x_coordinates, y_coordinates, color=colors.rgb2hex(scalar_map.to_rgba(index)),
198  linewidth=1)
199  del x_coordinates[:]
200  del y_coordinates[:]
201  plt.savefig(title + format)
202  plt.savefig(title + normal_format)
203 
204 
205 def draw_extended_lines(extended_segments, walls, name, size, format=default_format, filepath='.'):
206  rospy.loginfo("[rose2] {}".format(name))
207  x_coordinates = []
208  y_coordinates = []
209  fig, ax = setup_plot(size)
210  title = os.path.join(filepath, name)
211  img = np.zeros((size[1], size[0], 3), np.uint8)
212  img[:, :] = (255, 255, 255)
213  ax.imshow(img)
214  for wall in walls:
215  x_coordinates.append(wall.x1)
216  x_coordinates.append(wall.x2)
217  y_coordinates.append(wall.y1)
218  y_coordinates.append(wall.y2)
219  ax.plot(x_coordinates, y_coordinates, color='k', linewidth=1.5)
220  del x_coordinates[:]
221  del y_coordinates[:]
222  for segment in extended_segments:
223  x_coordinates.append(segment.x1)
224  x_coordinates.append(segment.x2)
225  y_coordinates.append(segment.y1)
226  y_coordinates.append(segment.y2)
227  ax.plot(x_coordinates, y_coordinates, color='r', linewidth=1)
228  del x_coordinates[:]
229  del y_coordinates[:]
230  plt.savefig(title + format)
231  plt.savefig(title + normal_format)
232 
233 
234 def draw_dbscan(labels, faces, polygon_faces, edges, contours, name, size, format=default_format, filepath='.'):
235  # draw faces based on cluster obtained by dbscan. faces of same cluster have same color.
236  rospy.loginfo("[rose2] {}".format(name))
237  fig, ax = setup_plot(size)
238  title = os.path.join(filepath, name)
239  img = np.zeros((size[1], size[0], 3), np.uint8)
240  img[:, :] = (255, 255, 255)
241  ax.imshow(img)
242  assigned_color = []
243  cmap = matplotlib.cm.get_cmap('Paired')
244  for label in set(labels):
245  rgba = cmap(random.random())
246  # convert in hexadecimal
247  col = matplotlib.colors.rgb2hex(rgba)
248  assigned_color.append(col)
249  for index, l in enumerate(labels):
250  if l == label:
251  f = faces[index]
252  f_poly = polygon_faces[index]
253  f_patch = PolygonPatch(f_poly, fc=col, ec='BLACK')
254  ax.add_patch(f_patch)
255  # ax.set_xlim(x_min, x_max)
256  # ax.set_ylim(y_min, y_max)
257  sum_x = 0
258  sum_y = 0
259  for b in f.borders:
260  sum_x += b.x1 + b.x2
261  sum_y += b.y1 + b.y2
262  x_text = sum_x/(2*len(f.borders))
263  y_text = sum_y/(2*len(f.borders))
264  ax.text(x_text, y_text, str(l), fontsize=8)
265  x_coordinates = []
266  y_coordinates = []
267  for edge in edges:
268  if edge.weight >= 0.1:
269  x_coordinates.append(edge.x1)
270  x_coordinates.append(edge.x2)
271  y_coordinates.append(edge.y1)
272  y_coordinates.append(edge.y2)
273  ax.plot(x_coordinates,y_coordinates, color='k', linewidth=4.0)
274  del x_coordinates[:]
275  del y_coordinates[:]
276  x_coordinates = []
277  y_coordinates = []
278  for c1 in contours:
279  x_coordinates.append(c1[0][0])
280  y_coordinates.append(c1[0][1])
281  ax.plot(x_coordinates, y_coordinates, color='0.8', linewidth=3.0)
282  del x_coordinates[:]
283  del y_coordinates[:]
284  plt.savefig(title + format)
285  plt.savefig(title + normal_format)
286  return assigned_color, fig, ax
287 
288 
289 def draw_edges(edges, walls, threshold, name, size, format=default_format, filepath='.'):
290  rospy.loginfo("[rose2] {}".format(name))
291  x_coordinates = []
292  y_coordinates = []
293  fig, ax = setup_plot(size)
294  title = os.path.join(filepath, name)
295  img = np.zeros((size[1], size[0], 3), np.uint8)
296  img[:, :] = (255, 255, 255)
297  ax.imshow(img)
298  for wall in walls:
299  x_coordinates.append(wall.x1)
300  x_coordinates.append(wall.x2)
301  y_coordinates.append(wall.y1)
302  y_coordinates.append(wall.y2)
303  ax.plot(x_coordinates, y_coordinates, color='k', linewidth=1.5)
304  del x_coordinates[:]
305  del y_coordinates[:]
306  for segment in edges:
307  color = (randint(0, 255)/255, randint(0, 255)/255, randint(0, 255)/255)
308  if segment.weight > threshold:
309  x_coordinates.append(segment.x1)
310  x_coordinates.append(segment.x2)
311  y_coordinates.append(segment.y1)
312  y_coordinates.append(segment.y2)
313  ax.plot(x_coordinates, y_coordinates, color=color, linewidth=3)
314  del x_coordinates[:]
315  del y_coordinates[:]
316  plt.savefig(title + format)
317  plt.savefig(title + normal_format)
318 
319 
320 def draw_cells(polygon_cells, polygons_out, partial_polygons, name, size, format=default_format, filepath='.',):
321  # draw the cells with different color based on classification of cells
322  rospy.loginfo("[rose2] {}".format(name))
323  fig, ax = setup_plot(size)
324  title = os.path.join(filepath, name)
325  img = np.zeros((size[1], size[0], 3), np.uint8)
326  img[:, :] = (255, 255, 255)
327  ax.imshow(img)
328  for index, s in enumerate(polygon_cells):
329  f_patch = PolygonPatch(s, fc='orange', ec='BLACK')
330  ax.add_patch(f_patch)
331  # ax.set_xlim(x_min, x_max)
332  # ax.set_ylim(y_min, y_max)
333  for index, s in enumerate(partial_polygons):
334  f_patch = PolygonPatch(s, fc='green', ec='BLACK')
335  ax.add_patch(f_patch)
336  # ax.set_xlim(x_min, x_max)
337  # ax.set_ylim(y_min, y_max)
338  for index, s in enumerate(polygons_out):
339  f_patch = PolygonPatch(s, fc='#FFFFFF', ec='BLACK')
340  ax.add_patch(f_patch)
341  # ax.set_xlim(x_min, x_max)
342  # ax.set_ylim(y_min, y_max)
343  plt.savefig(title + format)
344  plt.savefig(title + normal_format)
345  return fig, ax
346 
347 
348 def draw_rooms(rooms, colors, name, size, format=default_format, filepath='.'):
349  new_colors = []
350  for i, color in enumerate(colors):
351  # random_number = random.randint(0, 16777215)
352  # hex_number = str(hex(random_number))
353  # hex_number = '#' + hex_number[2:]
354  new_color = np.random.rand(3,)
355  # new_color = (random.random(), random.random(), random.random())
356  new_colors.append(new_color)
357  # draw the rooms layout
358  rospy.loginfo("[rose2] {}".format(name))
359  fig, ax = setup_plot(size)
360  title = os.path.join(filepath, name)
361  img = np.zeros((size[1], size[0], 3), np.uint8)
362  img[:, :] = (255, 255, 255)
363  ax.imshow(img)
364  patches = []
365  for index, s in enumerate(rooms):
366  f_patch = PolygonPatch(s, fc=new_colors[index], ec='none')
367  patches.append(f_patch)
368  ax.add_patch(f_patch)
369  # ax.set_xlim(x_min, x_max)
370  # ax.set_ylim(y_min, y_max)
371  plt.savefig(title + format)
372  plt.savefig(title + normal_format)
373  return fig, ax, patches
374 
375 
376 def draw_rooms_on_map(image, name, size, format=default_format, filepath='.'):
377  rospy.loginfo("[rose2] {}".format(name))
378  fig, ax = setup_plot(size)
379  title = os.path.join(filepath, name)
380  im = image.copy()
381  if len(im.shape) == 3:
382  image = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
383  th, image = cv2.threshold(image, 230, 255, cv2.THRESH_BINARY)
384  cv2.imwrite(filepath + '0_Map_tmp.png', image, [cv2.IMWRITE_PNG_COMPRESSION,1])
385  final_image = Image.open(filepath + '0_Map_tmp.png').convert('RGBA')
386  room_image = Image.open(filepath + '8b_rooms_th1.png')
387  pix_data_final = final_image.load()
388  pix_data_room = room_image.load()
389  for y in range(final_image.size[1]):
390  for x in range(final_image.size[0]):
391  if pix_data_final[x, y] == (255, 255, 255, 255):
392  pix_data_final[x, y] = pix_data_room[x, y]
393  final_image.save(title + normal_format)
394  #pdf_image = final_image.convert('RGB')
395  #pdf_image.save(title + format)
396  return title + normal_format
397 
398 
399 def draw_rooms_on_map_plus_lines(image, extended_segments, name, size, format=default_format, filepath='.'):
400  rospy.loginfo("[rose2] {}".format(name))
401  fig, ax = setup_plot(size)
402  title = os.path.join(filepath, name)
403  im = image.copy()
404  if len(image.shape) == 3:
405  image = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
406  th, image2 = cv2.threshold(image, 230, 255, cv2.THRESH_BINARY)
407  if len(image.shape) == 3:
408  image = cv2.cvtColor(image2, cv2.COLOR_GRAY2RGB)
409  for segment in extended_segments:
410  x1 = segment.x1
411  x2 = segment.x2
412  y1 = segment.y1
413  y2 = segment.y2
414  cv2.line(image, (int(x1), int(y1)), (int(x2), int(y2)), (0, 0, 255), 3)
415  cv2.imwrite(filepath + '0_Map_tmp_lines.png', image, [cv2.IMWRITE_PNG_COMPRESSION])
416  final_image = Image.open(filepath + '0_Map_tmp_lines.png').convert('RGBA')
417  room_image = Image.open(filepath + '8b_rooms_th1.png')
418  pix_data_final = final_image.load()
419  pix_data_room = room_image.load()
420  for y in range(final_image.size[1]):
421  for x in range(final_image.size[0]):
422  if pix_data_final[x, y] == (255, 255, 255, 255):
423  pix_data_final[x, y] = pix_data_room[x, y]
424  final_image.save(title + normal_format)
425  #pdf_image = final_image.convert('RGB')
426  #pdf_image.save(title + format)
427 
428 
429 def draw_rooms_on_map_prediction(image, name, size, format=default_format, filepath='.'):
430  rospy.loginfo("[rose2] {}".format(name))
431  fig, ax = setup_plot(size)
432  title = os.path.join(filepath, name)
433  im = image.copy()
434  im2 = image.copy()
435  if len(image.shape) == 3:
436  im = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
437  th, image = cv2.threshold(im, 230, 255, cv2.THRESH_BINARY)
438  th, image2 = cv2.threshold(im2, 150, 255, cv2.THRESH_BINARY)
439  cv2.imwrite(filepath + '0_Map_tmp.png', image, [cv2.IMWRITE_PNG_COMPRESSION,1])
440  cv2.imwrite(filepath + '0_Map_tmp2.png', image2, [cv2.IMWRITE_PNG_COMPRESSION,1])
441  threshold_image = Image.open(filepath + '0_Map_tmp.png').convert('RGBA')
442  th_image2 = Image.open(filepath + '0_Map_tmp2.png').convert('RGBA')
443  room_image = Image.open(filepath + '8b_rooms_th1.png').resize(size)
444  final_image = Image.open(filepath + '0_Map_tmp.png').resize(size).convert('RGBA')
445  pix_data_threshold = threshold_image.load()
446  pix_data_room = room_image.load()
447  pix_data_final = final_image.load()
448  pix_data_threshold2 = th_image2.load()
449  for y in range(threshold_image.size[1]):
450  for x in range(threshold_image.size[0]):
451  if pix_data_threshold[x, y] == (255, 255, 255, 255):
452  pix_data_final[x, y] = pix_data_room[x, y]
453  else:
454  if pix_data_room[x, y] != (255, 255, 255, 255) and pix_data_threshold2[x, y] == (255, 255, 255, 255):
455  pixel = pix_data_room[x, y]
456  pix_data_final[x, y] = (pixel[0], pixel[1], pixel[2], 125)
457  # pix_data_final[x, y] = pix_data_room[x, y]
458  final_image.save(title + normal_format)
459  #pdf_image = final_image.convert('RGB')
460  #pdf_image.save(title + format)
461 
462 
463 def draw_sides(edges, name, size, format=default_format, filepath='.'):
464  rospy.loginfo("[rose2] {}".format(name))
465  fig, ax = setup_plot(size)
466  x_coordinates = []
467  y_coordinates = []
468  title = os.path.join(filepath, name)
469  img = np.zeros((size[1], size[0], 3), np.uint8)
470  img[:, :] = (255, 255, 255)
471  ax.imshow(img)
472  for edge in edges:
473  if edge.weight >= 0.3:
474  x_coordinates.append(edge.x1)
475  x_coordinates.append(edge.x2)
476  y_coordinates.append(edge.y1)
477  y_coordinates.append(edge.y2)
478  ax.plot(x_coordinates, y_coordinates, color='k', linewidth=4.0)
479  del x_coordinates[:]
480  del y_coordinates[:]
481  plt.savefig(title + format)
482  plt.savefig(title + normal_format)
483 
484 
485 def draw_wall_segments_rooms(rooms, colori, spatial_clusters, wall_list, name, size, format=default_format, filepath='.'):
486  # draw walls, weighted segments and rooms
487  fig, ax = setup_plot(size)
488  title = os.path.join(filepath, name)
489  img = np.zeros((size[1], size[0], 3), np.uint8)
490  img[:, :] = (255, 255, 255)
491  ax.imshow(img)
492  x_coordinates = []
493  y_coordinates = []
494  num_of_colors = len(set(spatial_clusters))
495  cm = plt.get_cmap("nipy_spectral")
496  c_norm = colors.Normalize(vmin=0, vmax=num_of_colors)
497  scalar_map = cmx.ScalarMappable(norm=c_norm, cmap=cm)
498  for index, c in enumerate(np.random.permutation(list(set(spatial_clusters)))):
499  for wall in wall_list:
500  if wall.spatial_cluster == c:
501  x_coordinates.extend((wall.x1, wall.x2))
502  y_coordinates.extend((wall.y1, wall.y2))
503  ax.plot(x_coordinates, y_coordinates, color=colors.rgb2hex(scalar_map.to_rgba(index)), linewidth=2.0)
504  del x_coordinates[:]
505  del y_coordinates[:]
506  # rooms
507  for index, s in enumerate(rooms):
508  f_patch = PolygonPatch(s, fc=colori[index], ec='BLACK')
509  ax.add_patch(f_patch)
510  # ax.set_xlim(x_min, x_max)
511  # ax.set_ylim(y_min, y_max)
512  plt.savefig(title + format)
513  plt.savefig(title + normal_format)
disegna.draw_angular_clusters
def draw_angular_clusters(angular_clusters, walls, name, size, format=default_format, filepath='.')
Definition: disegna.py:106
disegna.draw_rooms_on_map
def draw_rooms_on_map(image, name, size, format=default_format, filepath='.')
Definition: disegna.py:376
disegna.draw_rooms
def draw_rooms(rooms, colors, name, size, format=default_format, filepath='.')
Definition: disegna.py:348
disegna.draw_wall_segments_rooms
def draw_wall_segments_rooms(rooms, colori, spatial_clusters, wall_list, name, size, format=default_format, filepath='.')
Definition: disegna.py:485
disegna.draw_contour
def draw_contour(vertices, name, size, format=default_format, filepath='.')
Definition: disegna.py:89
disegna.draw_dbscan
def draw_dbscan(labels, faces, polygon_faces, edges, contours, name, size, format=default_format, filepath='.')
Definition: disegna.py:234
disegna.draw_sides
def draw_sides(edges, name, size, format=default_format, filepath='.')
Definition: disegna.py:463
disegna.draw_rooms_on_map_prediction
def draw_rooms_on_map_prediction(image, name, size, format=default_format, filepath='.')
Definition: disegna.py:429
disegna.draw_representative_segments
def draw_representative_segments(representatives_segments, name, size, format=default_format, filepath='.')
Definition: disegna.py:131
disegna.draw_canny
def draw_canny(image, name, format=default_format, filepath='.')
Definition: disegna.py:43
disegna.draw_walls
def draw_walls(walls, name, size, format=default_format, filepath='.')
Definition: disegna.py:66
disegna.draw_image
def draw_image(image, name, size, format=default_format, filepath='.')
Definition: disegna.py:34
disegna.draw_hough
def draw_hough(image, walls, name, size, format=default_format, filepath='.')
Definition: disegna.py:52
disegna.draw_extended_lines
def draw_extended_lines(extended_segments, walls, name, size, format=default_format, filepath='.')
Definition: disegna.py:205
disegna.setup_plot
def setup_plot(size)
Definition: disegna.py:20
disegna.draw_cells
def draw_cells(polygon_cells, polygons_out, partial_polygons, name, size, format=default_format, filepath='.')
Definition: disegna.py:320
disegna.draw_edges
def draw_edges(edges, walls, threshold, name, size, format=default_format, filepath='.')
Definition: disegna.py:289
disegna.draw_rooms_on_map_plus_lines
def draw_rooms_on_map_plus_lines(image, extended_segments, name, size, format=default_format, filepath='.')
Definition: disegna.py:399
disegna.draw_spatial_clusters
def draw_spatial_clusters(spatial_clusters, walls, name, size, format=default_format, filepath='.')
Definition: disegna.py:179
disegna.draw_spatial_wall_clusters
def draw_spatial_wall_clusters(wall_clusters, walls, name, size, format=default_format, filepath='.')
Definition: disegna.py:154


rose2
Author(s): Gabriele Somaschini, Matteo Luperto
autogenerated on Wed Jun 28 2023 02:21:53