git.ucc.asn.au
/
matches
/
honours.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Automatic commit. Wed Sep 5 00:00:03 WST 2012
[matches/honours.git]
/
research
/
TCS
/
pressure
/
process_digits.py
diff --git
a/research/TCS/pressure/process_digits.py
b/research/TCS/pressure/process_digits.py
index
d58bcb9
..
f9728a3
100755
(executable)
--- a/
research/TCS/pressure/process_digits.py
+++ b/
research/TCS/pressure/process_digits.py
@@
-134,8
+134,10
@@
def PickDigit(pix, r):
img.show()
#return 0
img.show()
#return 0
-
- return d[filled]
+ if filled in d:
+ return d[filled]
+ else:
+ return None
def Process(fileName):
results = []
def Process(fileName):
results = []
@@
-160,7
+162,11
@@
def Process(fileName):
#test.show()
for r in rect:
#test.show()
for r in rect:
- results.append(PickDigit(pix, r))
+ digit = PickDigit(pix, r)
+ if digit != None:
+ results.append(digit)
+ else:
+ return None
return results
def PixToList(pix, bounds):
return results
def PixToList(pix, bounds):
@@
-187,9
+193,11
@@
if __name__ == "__main__":
#sys.exit(0)
r = Process(sys.argv[1])
#sys.exit(0)
r = Process(sys.argv[1])
+ if r == None:
+ print("?")
+ sys.exit(1)
+
print(str(r[0]) + "." + str(r[1]) + str(r[2]) + "e-" + str(r[3]))
print(str(r[0]) + "." + str(r[1]) + str(r[2]) + "e-" + str(r[3]))
-
-
sys.exit(0)
sys.exit(0)
UCC
git Repository :: git.ucc.asn.au