diff --git a/src/experiments/template_extraction/script.py b/src/experiments/template_extraction/script.py index 112e765..1a114c8 100644 --- a/src/experiments/template_extraction/script.py +++ b/src/experiments/template_extraction/script.py @@ -94,6 +94,7 @@ detector = cv2.aruco.ArucoDetector(dictionary, detector_params) images_converted = 0 images_skipped = 0 +names_skipped = [] ### IMAGE CONVERSIE ### for folder in os.listdir(input_directory): @@ -147,16 +148,12 @@ for folder in os.listdir(input_directory): if VERBOSE: print("IDs detected:\n", ids) - if ids is None: + if ids is None or len(ids) != 4: print("Skipping: ", filename) print("=============================================") + names_skipped.append(filename) images_skipped += 1 continue - if len(ids) != 4: - print("Skipping: ", filename) - print("=============================================") - images_skipped += 1 - continue if VERBOSE: print("%d markers gedetecteerd" %len(ids)) @@ -256,5 +253,12 @@ for folder in os.listdir(input_directory): if VERBOSE: print("%d van de %d succesvol" %(images_converted, (images_converted+images_skipped))) + +if images_skipped != 0: + print("") + with open(os.path.join(input_directory, "skipped.txt"), 'w') as file: + for name in names_skipped: + file.write(name) + file.write("\n") cv2.destroyAllWindows() \ No newline at end of file