5 from rose_v2_repo
import runMe
8 types = [
'/2_Hough.png',
'/4_Contour.png',
'/7b_DBSCAN_th1.png',
'/8b_rooms_th1.png',
'/8b_rooms_th1_on_map.png',
'/8b_rooms_th1_on_map_prediction.png',
'/8b_rooms_th1_on_map_th1.png',
'/Extended_Lines/7a_extended_lines_th1.png']
9 names = [
'Hough_collage.png',
'Contour_collage.png',
'dbscan_collage.png',
'rooms_collage.png',
'segmentation_collage.png',
'segmentation_prediction_collage.png',
'segmentation_lines_collage.png',
'extended_lines_collage.png']
14 width = cols * img.width + 10 * cols
15 height = rows * img.height + 10 * rows
16 thumbnail_width = width//cols
17 thumbnail_height = height//rows
18 size = thumbnail_width, thumbnail_height
19 new_im = Image.new(
'RGB', (width, height),
'white')
21 for im
in listofimages:
27 for col
in range(cols):
28 for row
in range(rows):
29 new_im.paste(ims[i], (x, y))
31 y += thumbnail_height + 10
32 x += thumbnail_width + 10
35 new_im.save(output_path + name)
40 print(
'What kind of image do you want to use?\n1 Hough\n2 contour\n3 dbscan\n4 rooms\n5 '
41 'rooms on map\n6 rooms prediction\n7 rooms and lines\n8 extended lines\n')
43 val = int(
input(
'insert the number of action selected\n'))
45 return '/2_Hough.png',
'Hough_collage.png'
47 return '/4_Contour.png',
'Contour_collage.png'
49 return '/7b_DBSCAN_th1.png',
'dbscan_collage.png'
51 return '/8b_rooms_th1.png',
'rooms_collage.png'
53 return '/8b_rooms_th1_on_map.png',
'segmentation_collage.png'
55 return '/8b_rooms_th1_on_map_prediction.png',
'segmentation_prediction_collage.png'
57 return '/8b_rooms_th1_on_map_th1.png',
'segmentation_lines_collage.png'
59 return '/Extended_Lines/7a_extended_lines_th1.png',
'extended_lines_collage.png'
61 print(
'invalid input')
65 input_folder =
'../data/OUTPUT/'
66 output_folder =
'../data/OUTPUT/collage/'
67 if not os.path.exists(output_folder):
68 os.mkdir(output_folder)
69 sim = runMe.check_int(input_folder)
70 input_folder = input_folder + sim +
'/'
71 output_folder = output_folder + sim +
'/'
72 if not os.path.exists(output_folder):
73 os.mkdir(output_folder)
75 list_run = os.listdir(input_folder)
77 cols = int(math.sqrt(count))
78 rows = int(math.sqrt(count))
79 print(cols, rows, count)
81 map_name =
'/' + os.listdir(input_folder + map)[0]
83 if skip_choice
is True:
88 image = Image.open(input_folder + run + map_name + type)
89 list_image.append(image)
94 image = Image.open(input_folder + run + map_name + type)
95 list_image.append(image)
99 if __name__ ==
'__main__':