From ae3ee599e8932df6fdb1d054ad61bf8554b34de0 Mon Sep 17 00:00:00 2001 From: Tom Selier Date: Thu, 28 Sep 2023 17:22:21 +0200 Subject: [PATCH] updated template extraction --- src/experiments/template_extraction/script.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/experiments/template_extraction/script.py b/src/experiments/template_extraction/script.py index 50d8424..112e765 100644 --- a/src/experiments/template_extraction/script.py +++ b/src/experiments/template_extraction/script.py @@ -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() \ No newline at end of file