From 3a7addc733833ab6f7235ed5d4be1758f85ccd96 Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Wed, 17 Jul 2024 14:10:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=85=A8=E5=B1=80=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=9A=84ocr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- photo_mask/photo_mask.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/photo_mask/photo_mask.py b/photo_mask/photo_mask.py index 4ee4681..718d7f3 100644 --- a/photo_mask/photo_mask.py +++ b/photo_mask/photo_mask.py @@ -59,7 +59,7 @@ def find_box(content, layout, offset=0, length=None, improve=False, image_path=N captured_image, offset_x, offset_y = image_util.expand_to_a4_size(captured_image, True) cv2.imwrite(temp_file.name, captured_image) try: - layouts = util.get_ocr_layout(OCR, temp_file.name) + layouts = OCR.parse({"doc": temp_file.name})["layout"] except TypeError: # 如果是类型错误,大概率是没识别到文字 layouts = []