-
Notifications
You must be signed in to change notification settings - Fork 0
/
appendixc.pyx
84 lines (41 loc) · 2.1 KB
/
appendixc.pyx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Import native Python modules
import comparison, os, shutil, sys, time
# Import our custom made Pyrex and Python extensions
import fpBnW01, fpWalk01
import ImageAnalyzer
# Add the path where the fingerprints are stored
imageDirectory = 'C:\\Python25\\Lib\\sitepackages\\Pyrex\\Distutils\\2002 fvc 110 by
8\\Processed\\'
textFileDirectory = 'C:\\Python25\\Lib\\sitepackages\\Pyrex\\Distutils\\2002 fvc 110 by
8\\textFiles\\'
os.sys.path.append(imageDirectory)
os.sys.path.append(textFileDirectory)
# Take care of some preloop needs
startTime = time.time()
iterations = 500000
startingScale = 0
endingScale = 30
increment = 0.5
# A text file will be created for each of the 880 outlined images
for iLoop in range(6,7):
for iLoop2 in range(5,6):
sName = str(iLoop) + '_' + str(iLoop2) + '.bmp'
image = ImageAnalyzer.ImageAnalyzer(imageDirectory, sName)
results = image.monochromeWalk(iterations, startingScale, endingScale, increment)
if (type(results) == type(1)):
print '\nprint was skipped\n'
else:
p1TextFile = open(textFileDirectory + str(iLoop) + '_' + str(iLoop2) +'.txt','w')
p1TextFile.write(str(iLoop) + '_' + str(iLoop2) + 'b.txt' + '\n')
p1TextFile.write('Created on ' + str(time.asctime()) + '\n')
p1TextFile.write('File created by Joseph M. Stoffa\n\n')
p1TextFile.write(' D(mm)\t Pbb\t Pww\t Pwb\n\t\t\t\n')
for iLoop3 in range(0, int(float(endingScale)/float(increment)) + 1):
scale = str('%.4f'%(results[iLoop3][0] * 0.08467))
p1TextFile.write(scale + '\t' + str(results[iLoop3][1]) + '\t')
p1TextFile.write(str(results[iLoop3][2]) + '\t' + str(results[iLoop3][3]) + '\n')
p1TextFile.close()
print 'Text file for ', sName, ' has been created'
totalTime = time.time()-startTime
print 'The total time taken was ', totalTime
print 'FIN'