|
|
@@ -418,22 +418,11 @@ class MinerUWiredTableRecognizer:
|
|
|
output_path=out_path
|
|
|
)
|
|
|
|
|
|
- # Step 7: 组装 cells 输出,使用 original_bbox 计算原始坐标
|
|
|
+ # Step 7: 直接使用已更新的 bbox”
|
|
|
cells = []
|
|
|
for idx, cell in enumerate(merged_cells):
|
|
|
- # 如果单元格匹配到了 OCR boxes,使用 original_bbox 计算原始坐标
|
|
|
- matched_boxes = matched_boxes_list[idx] if idx < len(matched_boxes_list) else []
|
|
|
- if matched_boxes:
|
|
|
- # 使用匹配到的 OCR boxes 的 original_bbox 构建单元格的原始坐标
|
|
|
- original_bbox = TextFiller.merge_boxes_original_bbox(matched_boxes)
|
|
|
- cell_bbox = original_bbox
|
|
|
- else:
|
|
|
- # 如果没有匹配到 OCR box,保留当前的 deskewed 坐标
|
|
|
- # (这种情况应该很少,因为大多数单元格都会有文本)
|
|
|
- cell_bbox = cell["bbox"]
|
|
|
-
|
|
|
cells.append({
|
|
|
- "bbox": cell_bbox,
|
|
|
+ "bbox": cell["bbox"],
|
|
|
"row": cell.get("row", 0),
|
|
|
"col": cell.get("col", 0),
|
|
|
"rowspan": cell.get("rowspan", 1),
|