조현아

resolved unclassified target err

Showing 240 changed files with 8 additions and 4 deletions
...@@ -32,18 +32,18 @@ for path, dirs, files in os.walk(load_path): ...@@ -32,18 +32,18 @@ for path, dirs, files in os.walk(load_path):
32 if len(approx) < 12: 32 if len(approx) < 12:
33 #cv2.putText(img, "Ellipse", (x, y), font, 1, color) 33 #cv2.putText(img, "Ellipse", (x, y), font, 1, color)
34 n_ellipse = n_ellipse + 1 34 n_ellipse = n_ellipse + 1
35 - if (area < cv2.contourArea(cnt)): 35 + if (area <= cv2.contourArea(cnt)):
36 area = cv2.contourArea(cnt) 36 area = cv2.contourArea(cnt)
37 largest = "e" 37 largest = "e"
38 else: 38 else:
39 #cv2.putText(img, "Circle", (x, y), font, 1, color) 39 #cv2.putText(img, "Circle", (x, y), font, 1, color)
40 n_circle = n_circle + 1 40 n_circle = n_circle + 1
41 - if (area < cv2.contourArea(cnt)): 41 + if (area <= cv2.contourArea(cnt)):
42 area = cv2.contourArea(cnt) 42 area = cv2.contourArea(cnt)
43 largest = "c" 43 largest = "c"
44 44
45 - print(n_ellipse, n_circle, filename) 45 +
46 - #assert n_ellipse !=0 or n_circle !=0 46 + assert n_ellipse !=0 or n_circle !=0
47 47
48 if (n_ellipse > n_circle) or (n_ellipse==n_circle and largest == "e"): 48 if (n_ellipse > n_circle) or (n_ellipse==n_circle and largest == "e"):
49 ellipase_path = os.path.join("./ellipse/", filename) 49 ellipase_path = os.path.join("./ellipse/", filename)
...@@ -53,9 +53,13 @@ for path, dirs, files in os.walk(load_path): ...@@ -53,9 +53,13 @@ for path, dirs, files in os.walk(load_path):
53 circle_path = os.path.join("./circle/", filename) 53 circle_path = os.path.join("./circle/", filename)
54 shutil.copy(os.path.join(path, filename), circle_path) 54 shutil.copy(os.path.join(path, filename), circle_path)
55 55
56 + # exception, must not be exsited
56 elif n_circle == 0 and n_ellipse == 0: 57 elif n_circle == 0 and n_ellipse == 0:
57 shutil.copy(os.path.join(path, filename), os.path.join("./zero/", filename)) 58 shutil.copy(os.path.join(path, filename), os.path.join("./zero/", filename))
58 59
60 + # exception, must not be exsited
61 + else:
62 + print(n_ellipse, n_circle, filename, '\n')
59 63
60 # cv2.imshow("shapes", img) 64 # cv2.imshow("shapes", img)
61 # cv2.imshow("Threshold", threshold) 65 # cv2.imshow("Threshold", threshold)
......