Переглянути джерело

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

zhch158_admin 3 днів тому
батько
коміт
457131c794

+ 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,