Development of the ocr part of AOI
Samo Penic
2018-11-16 e2fa6a35a6548a5acfd000af56ea333df8149b27
commit | author | age
e555c0 1 from Ocr import Paper
02e0f7 2 from sklearn.externals import joblib
e555c0 3
e2fa6a 4 from glob import glob
762a5e 5
5cb7c1 6 settings = {"sid_mask": "61xx0xxx", "answer_treshold": 0.25}
0436f6 7 classifier = joblib.load("filename.joblib")
e555c0 8
0436f6 9 #p = Paper(filename="testpage300dpi_scan1.png")
ac766e 10 #p=Paper(filename='sizif111.tif', sid_classifier=classifier, settings=settings)
e2fa6a 11 #p=Paper(filename='processed_scans/20141016095134535_0006.tif', sid_classifier=classifier, settings=settings)
SP 12 #p=Paper(filename='processed_scans/20151111080408825_0001.tif', sid_classifier=classifier, settings=settings)
13 p=Paper(filename='processed_scans/20151028145444607_0028.tif', sid_classifier=classifier, settings=settings)
02e0f7 14
0436f6 15 # print(p.QRData)
SP 16 # print(p.errors)
e555c0 17
0436f6 18 # print(p.getSkewAngle())
SP 19 # print(p.locateUpMarkers())
20 # print(p.locateRightMarkers())
21 # print(p.answerMatrix)
22 # p.get_enhanced_sid()
23
24
25 print(p.get_paper_ocr_data())
e2fa6a 26 exit(0)
SP 27 filelist = glob("processed_scans/*.tif")
28 for f in filelist:
29     print(f,Paper(filename=f, sid_classifier=classifier, settings=settings).get_paper_ocr_data())
30