소스 검색

feat: 更新表格处理逻辑,添加对裁剪后图像旋转尺寸的支持

zhch158_admin 3 일 전
부모
커밋
457131c794
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      ocr_tools/universal_doc_parser/core/element_processors.py

+ 2 - 1
ocr_tools/universal_doc_parser/core/element_processors.py

@@ -491,7 +491,8 @@ class ElementProcessors:
         if table_html and ocr_boxes and self.table_cell_matcher:
             try:
                 # table_bbox 参数是相对于裁剪后图像的,OCR 框已经是相对于裁剪后图像的
-                # 使用裁剪后图像的实际尺寸
+                # 使用裁剪后图像的实际尺寸(旋转后的尺寸)
+                orig_table_h, orig_table_w = cropped_table.shape[:2]
                 enhanced_html, cells, _, skew_angle = self.table_cell_matcher.enhance_table_html_with_bbox(
                     html=table_html,
                     paddle_text_boxes=ocr_boxes,