Faiss commited on
Commit
886766a
1 Parent(s): 7204266

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -4,7 +4,7 @@ def process(image: str, lang: str = 'eng') -> str:
4
  try:
5
  img = cv2.imread(image)
6
  gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
7
- threshold_img = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)[1]
8
  result = pytesseract.image_to_string(threshold_img, lang=lang)
9
  os.remove(image)
10
  return result
 
4
  try:
5
  img = cv2.imread(image)
6
  gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
7
+ threshold_img = cv2.threshold(gray, 127, 255, cv2.THRESH_TOZERO)[1]
8
  result = pytesseract.image_to_string(threshold_img, lang=lang)
9
  os.remove(image)
10
  return result