update photo count and remove break

This commit is contained in:
Hendrik Schutter 2023-07-25 20:46:24 +02:00
parent 237aa6cc18
commit c5f990d065

View File

@ -8,7 +8,7 @@ import sys
import os
import subprocess
number_of_photos_in_scan = 3
number_of_photos_in_scan = 4
crop_height = 2.0 # offset in percent
crop_width = 2.0 # offset in percent
@ -54,7 +54,7 @@ def auto_crop_scan(src_path, output_dir):
if img_gray is None:
raise Exception("unable to convert image to grayscale")
# apply thresholding on the gray image to create a binary image
# apply threshold on the gray image to create a binary image
ret, thresh = cv2.threshold(img_gray, 127, 255, 0)
# find the contours
@ -103,7 +103,6 @@ def auto_crop_scan(src_path, output_dir):
cv2.imwrite(export_file_path, img_crop)
index = index + 1
break
else:
raise Exception("unable to find all photos in scan")