Browse Source

First try with a scan

Thomas Chef 7 years ago
parent
commit
10e9b83d21

+ 1 - 0
.gitignore

@@ -1,6 +1,7 @@
 *~
 *.user
 *.o
+TestProject/input
 TestProject/temp
 TestProject/output
 PageNormalizer/build-Mac/PageNormalizer

+ 10 - 10
TestProject/build.py

@@ -17,18 +17,18 @@ ipath = './input'
 opath = './output'
 tpath = './temp'
 settingsFile = tpath + '/' + 'settings.txt'
-image_pre_name = 'img_'         # The part of the filename before the numerical part
-image_post_name = '.jpg'        # Part of the filename after the numerical part
+image_pre_name = 'IMG_'         # The part of the filename before the numerical part
+image_post_name = '.JPG'        # Part of the filename after the numerical part
 numberNumericalsInName=4        # Number of numericals in file name-index. For example 4 in 0304 and 1234
 
 # Dynamic Input arguments. These very for every book that is scanned and for every scan
-refImg = 100                    # The image used as reference image
-coverImage = 238.               # Image used for cover (Will be placed 1st)
-firstLeftHandPage = 237         # The first image covering the left pages
-cropX1 = 250                    # Crop coordinates of all the images
-cropY1 = 38
-cropX2 = 3673
-cropY2 = 2685
+refImg =   3                    # The image used as reference image
+coverImage = 12               # Image used for cover (Will be placed 1st)
+firstLeftHandPage = 8         # The first image covering the left pages
+cropX1 = 333                    # Crop coordinates of all the images
+cropY1 = 30
+cropX2 = 3342
+cropY2 = 2380
 
 #--------------------------------------------------------------------------------------------------------
 import os
@@ -57,7 +57,7 @@ file.close()
 # Loop through all images in the input folder and put them into two lists, one for right pages and one for left
 pics = sorted([os.path.join(ipath, pic)
                for pic in os.listdir(ipath)
-               if pic.endswith('.jpg') and os.path.isfile(os.path.join(ipath, pic))])
+               if pic.endswith(image_post_name) and os.path.isfile(os.path.join(ipath, pic))])
 
 rHandSides = []
 lHandSides = []

BIN
TestProject/input/img_0100.jpg


BIN
TestProject/input/img_0234.jpg


BIN
TestProject/input/img_0235.jpg


BIN
TestProject/input/img_0236.jpg


BIN
TestProject/input/img_0237.jpg


BIN
TestProject/input/img_0238.jpg


BIN
TestProject/input/img_0239.jpg


BIN
TestProject/input/img_0240.jpg