瀏覽代碼

feat(添加单元格二次OCR配置): 在多个银行对账单配置文件中添加second_pass_ocr选项,增强OCR处理能力,支持低分块过滤和整格兜底,提高文本识别的准确性和灵活性。

zhch158_admin 4 天之前
父節點
當前提交
815592687a

+ 8 - 0
ocr_tools/universal_doc_parser/config/bank_statement_glm_vl_local.yaml

@@ -180,6 +180,14 @@ table_recognition_wired:
     # 功能开关
     enable_ocr_compensation: true      # 启用OCR边缘补偿
 
+
+  # 单元格二次 OCR(det 分行 + 整格兜底 + 低分块过滤)
+  second_pass_ocr:
+    line_min_score: 0.8
+    drop_low_score_blocks: true
+    whole_cell_fallback: true
+    prefer_whole_on_tie: true
+
   # Debug 可视化配置
   debug_options:
     enabled: false              # 由命令行 --debug / --debug-table 统一控制

+ 8 - 0
ocr_tools/universal_doc_parser/config/bank_statement_paddle_vl_local.yaml

@@ -180,6 +180,14 @@ table_recognition_wired:
     # 功能开关
     enable_ocr_compensation: true      # 启用OCR边缘补偿
 
+
+  # 单元格二次 OCR(det 分行 + 整格兜底 + 低分块过滤)
+  second_pass_ocr:
+    line_min_score: 0.8
+    drop_low_score_blocks: true
+    whole_cell_fallback: true
+    prefer_whole_on_tie: true
+
   # Debug 可视化配置
   debug_options:
     enabled: false              # 由命令行 --debug / --debug-table 统一控制

+ 8 - 0
ocr_tools/universal_doc_parser/config/bank_statement_smart_router.yaml

@@ -148,6 +148,14 @@ table_recognition_wired:
   # 是否启用倾斜矫正
   enable_deskew: true
 
+
+  # 单元格二次 OCR(det 分行 + 整格兜底 + 低分块过滤)
+  second_pass_ocr:
+    line_min_score: 0.8
+    drop_low_score_blocks: true
+    whole_cell_fallback: true
+    prefer_whole_on_tie: true
+
   # Debug 可视化配置
   debug_options:
     enabled: true              # 由命令行 --debug / --debug-table 统一控制

+ 8 - 0
ocr_tools/universal_doc_parser/config/bank_statement_yusys_local.yaml

@@ -224,6 +224,14 @@ table_recognition_wired:
     # 功能开关
     enable_ocr_compensation: true      # 启用OCR边缘补偿
 
+  # 单元格二次 OCR(det 分行 + 整格兜底 + 低分块过滤)
+  second_pass_ocr:
+    line_min_score: 0.8              # 低于此分的分行从文本与计分中丢弃
+    drop_low_score_blocks: true
+    whole_cell_fallback: true        # 整格 det+rec + 条带扫描,与分行择优
+    prefer_whole_on_tie: true
+    strip_fallback_aspect_ratio: 1.8 # 高/宽>=该值且仅检出<=1行时滑动条带分行
+
   # Debug 可视化配置
   debug_options:
     enabled: false              # 由命令行 --debug / --debug-table 统一控制

+ 9 - 1
ocr_tools/universal_doc_parser/config/bank_statement_yusys_v3.yaml

@@ -19,7 +19,7 @@ preprocessor:
   # -------------------------------------------------------
   watermark_removal:
     enabled: true           # 是否启用水印去除
-    threshold: 160          # 灰度阈值(140-180):高于此值视为水印变白
+    threshold: 175          # 灰度阈值(140-180):高于此值视为水印变白
                             # 值越大保守(残留水印),值越小激进(损失浅色正文)
     morph_close_kernel: 0   # 形态学闭运算核大小(像素),默认的 morph_kernel 改为 0(非二值图像时形态学闭运算会适得其反)
 
@@ -106,6 +106,14 @@ table_recognition_wired:
     # 功能开关
     enable_ocr_compensation: true      # 启用OCR边缘补偿
 
+
+  # 单元格二次 OCR(det 分行 + 整格兜底 + 低分块过滤)
+  second_pass_ocr:
+    line_min_score: 0.8
+    drop_low_score_blocks: true
+    whole_cell_fallback: true
+    prefer_whole_on_tie: true
+
   # Debug 可视化配置(与 MinerUWiredTableRecognizer.DebugOptions 对齐)
   # 默认关闭。开启后将保存:表格线、连通域、逻辑网格结构、文本覆盖可视化。
   debug_options:

+ 8 - 0
ocr_tools/universal_doc_parser/config/bank_statement_yusys_v4.yaml

@@ -179,6 +179,14 @@ table_recognition_wired:
     # 功能开关
     enable_ocr_compensation: true      # 启用OCR边缘补偿
 
+
+  # 单元格二次 OCR(det 分行 + 整格兜底 + 低分块过滤)
+  second_pass_ocr:
+    line_min_score: 0.8
+    drop_low_score_blocks: true
+    whole_cell_fallback: true
+    prefer_whole_on_tie: true
+
   # Debug 可视化配置
   debug_options:
     enabled: false              # 由命令行 --debug / --debug-table 统一控制