Skip to content

Commit 4760e6f

Browse files
Update fastmrz.py
1 parent 926b5aa commit 4760e6f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fastmrz/fastmrz.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ def _get_roi(self, output_data, image_path):
6060

6161
# Apply additional preprocessing to ROI before OCR
6262
roi_gray = cv2.cvtColor(roi_arr, cv2.COLOR_BGR2GRAY)
63-
roi_thresh = cv2.threshold(roi_gray, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)[1]
63+
roi_threshold = cv2.threshold(roi_gray, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)[1]
6464

6565
# Configure pytesseract parameters for better MRZ recognition
6666
custom_config = r'--oem 3 --psm 6'
67-
return pytesseract.image_to_string(roi_thresh, lang="mrz", config=custom_config)
67+
return pytesseract.image_to_string(roi_threshold, lang="mrz", config=custom_config)
6868

6969
def _cleanse_roi(self, mrz_text):
7070
input_list = mrz_text.replace(" ", "").split("\n")

0 commit comments

Comments
 (0)