.idea/sonarIssues.xml | ●●●●● patch | view | raw | blame | history | |
aoi_ocr/Ocr.py | ●●●●● patch | view | raw | blame | history | |
aoi_ocr/__pycache__/Ocr.cpython-36.pyc | patch | view | raw | blame | history | |
aoi_ocr/__pycache__/__init__.cpython-36.pyc | patch | view | raw | blame | history | |
aoi_ocr/__pycache__/sid_process.cpython-36.pyc | patch | view | raw | blame | history |
.idea/sonarIssues.xml
@@ -28,6 +28,16 @@ <set /> </value> </entry> <entry key="$PROJECT_DIR$/../../django/sizif-web/aoi/exam/models.py"> <value> <set /> </value> </entry> <entry key="$PROJECT_DIR$/../../django/sizif-web/aoi/exam/templates/exam/postprocess.html"> <value> <set /> </value> </entry> <entry key="$PROJECT_DIR$/../../django/sizif-web/aoi/exam/views.py"> <value> <set /> @@ -49,6 +59,11 @@ </value> </entry> <entry key="$PROJECT_DIR$/../../django/sizif-web/aoi/scan.py"> <value> <set /> </value> </entry> <entry key="$PROJECT_DIR$/../../django/sizif-web/aoi/scan/models.py"> <value> <set /> </value> @@ -103,6 +118,11 @@ <set /> </value> </entry> <entry key="$PROJECT_DIR$/aoi_ocr/Ocr.py"> <value> <set /> </value> </entry> <entry key="$PROJECT_DIR$/aoi_ocr/sid_process.py"> <value> <set /> aoi_ocr/Ocr.py
@@ -2,7 +2,7 @@ from .sid_process import getSID import cv2 import numpy as np import os import pkg_resources markerfile = '/template.png' # always use slash @@ -11,8 +11,9 @@ class Paper: def __init__(self, filename=None, sid_classifier=None, settings=None): def __init__(self, filename=None, sid_classifier=None, settings=None, output_path="/tmp"): self.filename = filename self.output_path=output_path self.invalid = None self.QRData = None self.settings = {"answer_threshold": 0.25} if settings is None else settings @@ -260,7 +261,7 @@ if self.QRDecode[0].type == "EAN13": return { "exam_id": int(qrdata[0:7]), "page_no": int(qrdata[7]), "page_no": int(qrdata[7])+1, "paper_id": int(qrdata[-5:-1]), "faculty_id": None, "sid": None, @@ -269,7 +270,7 @@ data = qrdata.split(",") retval = { "exam_id": int(data[1]), "page_no": int(data[3]), "page_no": int(data[3])+1, "paper_id": int(data[2]), "faculty_id": int(data[0]), } @@ -280,7 +281,7 @@ def get_paper_ocr_data(self): data = self.get_code_data() data["qr"] = self.QRData data["qr"] = bytes.decode(self.QRData, 'utf8') data["errors"] = self.errors data["warnings"] = self.warnings data["up_position"] = ( @@ -294,6 +295,9 @@ data["ans_matrix"] = ( (np.array(self.answerMatrix) > self.settings["answer_threshold"]) * 1 ).tolist() if data["sid"] is None and data["page_no"] == 0: if data["sid"] is None and data["page_no"] == 1: data["sid"] = self.get_enhanced_sid() output_filename=os.path.join(self.output_path, '.'.join(self.filename.split('/')[-1].split('.')[:-1])+".png") cv2.imwrite(output_filename, self.img) data['output_filename']=output_filename return data aoi_ocr/__pycache__/Ocr.cpython-36.pycBinary files differ
aoi_ocr/__pycache__/__init__.cpython-36.pycBinary files differ
aoi_ocr/__pycache__/sid_process.cpython-36.pycBinary files differ