-
Notifications
You must be signed in to change notification settings - Fork 0
/
show_files.py
51 lines (36 loc) · 1.01 KB
/
show_files.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
entries = listdir('Kanten/')
image_counter = 0
print("Gefundene Bilder: ")
for file in entries:
if ".png" in file or ".jpg" in file:
print(file)
image_counter += 1
print()
print("Anzahl der gefundenen Bilder: {}".format(image_counter))
# print("Länge: {}".format(len(entries)))
oben_count = 0
unten_count = 0
rechts_count = 0
links_count = 0
for file in entries:
if "oben" in file:
oben_count += 1
if "rechts" in file:
rechts_count += 1
if "unten" in file:
unten_count += 1
if "links" in file:
links_count += 1
print()
print("Varianten oben: {}".format(oben_count))
print("Varianten rechts: {}".format(rechts_count))
print("Varianten unten: {}".format(unten_count))
print("Varianten links: {}".format(links_count))
print()
print("Varianten: {}".format(oben_count*rechts_count*unten_count*links_count))
img = []
for num, file in enumerate(entries):
if ".png" in file or ".jpg" in file:
print("Reading image: {}, No. {}".format(file, num))
path = "Kanten/" + file
img.append(cv2.imread(path, 0))