updated template extraction

This commit is contained in:
Tom Selier 2023-09-28 17:22:21 +02:00
parent 0738cb6a52
commit ae3ee599e8

View File

@ -92,13 +92,16 @@ detector_params.adaptiveThreshWinSizeMax = 150 # Takes longer, but better chance
dictionary = cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_ARUCO_ORIGINAL)
detector = cv2.aruco.ArucoDetector(dictionary, detector_params)
images_converted = 0
images_skipped = 0
### IMAGE CONVERSIE ###
for folder in os.listdir(input_directory):
if folder.endswith('.py'):
print("Skipping", folder)
continue
if folder.endswith('.jpg'):
if folder.lower().endswith('.jpg'):
continue
if SAVE:
@ -147,10 +150,12 @@ for folder in os.listdir(input_directory):
if ids is None:
print("Skipping: ", filename)
print("=============================================")
images_skipped += 1
continue
if len(ids) != 4:
print("Skipping: ", filename)
print("=============================================")
images_skipped += 1
continue
if VERBOSE:
@ -246,5 +251,10 @@ for folder in os.listdir(input_directory):
cv2.waitKey(0)
if VERBOSE:
print("=============================================")
images_converted += 1
if VERBOSE:
print("%d van de %d succesvol"
%(images_converted, (images_converted+images_skipped)))
cv2.destroyAllWindows()