From cbe19ea6066a600cbd0b5110db5d43f8252d14a8 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 13 六月 2024 11:23:53 +0800
Subject: [PATCH] L撤成交进度相关改进

---
 ocr/ocr_util.py |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/ocr/ocr_util.py b/ocr/ocr_util.py
index 3658e9f..9150175 100644
--- a/ocr/ocr_util.py
+++ b/ocr/ocr_util.py
@@ -1,7 +1,6 @@
 import re
 import time
 
-import cv2
 import easyocr
 from cnocr import CnOcr
 
@@ -9,11 +8,16 @@
 # 鍥惧儚璇嗗埆绫�
 class OcrUtil:
     __ocr = CnOcr()
-    reader = easyocr.Reader(['en'], gpu=False)
+    reader = easyocr.Reader(['ch_sim', 'en'], gpu=False)
 
     @classmethod
     def ocr(cls, mat):
         res = cls.__ocr.ocr(mat)
+        return res
+
+    @classmethod
+    def easy_ocr(cls, mat):
+        res = cls.reader.readtext(mat, detail=1)
         return res
 
     # 杩斿洖(璇嗗埆鍐呭,浣嶇疆淇℃伅)
@@ -48,5 +52,4 @@
 
 
 if __name__ == "__main__":
-    result = OcrUtil.ocr_num("D:/test1.png", "000977")
-    print(result)
+    print(re.match("棣�..娉�", "棣栫増鍏虫敞"))

--
Gitblit v1.8.0