조현아

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):
if len(approx) < 12:
#cv2.putText(img, "Ellipse", (x, y), font, 1, color)
n_ellipse = n_ellipse + 1
if (area < cv2.contourArea(cnt)):
if (area <= cv2.contourArea(cnt)):
area = cv2.contourArea(cnt)
largest = "e"
else:
#cv2.putText(img, "Circle", (x, y), font, 1, color)
n_circle = n_circle + 1
if (area < cv2.contourArea(cnt)):
if (area <= cv2.contourArea(cnt)):
area = cv2.contourArea(cnt)
largest = "c"
print(n_ellipse, n_circle, filename)
#assert n_ellipse !=0 or n_circle !=0
assert n_ellipse !=0 or n_circle !=0
if (n_ellipse > n_circle) or (n_ellipse==n_circle and largest == "e"):
ellipase_path = os.path.join("./ellipse/", filename)
......@@ -53,9 +53,13 @@ for path, dirs, files in os.walk(load_path):
circle_path = os.path.join("./circle/", filename)
shutil.copy(os.path.join(path, filename), circle_path)
# exception, must not be exsited
elif n_circle == 0 and n_ellipse == 0:
shutil.copy(os.path.join(path, filename), os.path.join("./zero/", filename))
# exception, must not be exsited
else:
print(n_ellipse, n_circle, filename, '\n')
# cv2.imshow("shapes", img)
# cv2.imshow("Threshold", threshold)
......