|
@@ -471,7 +471,7 @@ class TextFiller:
|
|
|
need_reocr_indices: 需要二次 OCR 的单元格索引列表(OCR 误合并检测结果)
|
|
need_reocr_indices: 需要二次 OCR 的单元格索引列表(OCR 误合并检测结果)
|
|
|
pdf_type: str, # 'ocr' 或 'txt'
|
|
pdf_type: str, # 'ocr' 或 'txt'
|
|
|
force_all: 是否强制对所有单元格进行 OCR (Default: False)
|
|
force_all: 是否强制对所有单元格进行 OCR (Default: False)
|
|
|
- output_dir: 输出目录,如果提供则保存单元格OCR图片到 {output_dir}/tablecell_ocr/ 目录
|
|
|
|
|
|
|
+ output_dir: 单元格 OCR 调试目录(通常为 debug/table_recognition_wired/tablecell_ocr/)
|
|
|
"""
|
|
"""
|
|
|
try:
|
|
try:
|
|
|
if not self.ocr_engine:
|
|
if not self.ocr_engine:
|
|
@@ -485,10 +485,9 @@ class TextFiller:
|
|
|
if need_reocr_indices is None:
|
|
if need_reocr_indices is None:
|
|
|
need_reocr_indices = []
|
|
need_reocr_indices = []
|
|
|
|
|
|
|
|
- # 如果提供了输出目录,创建 tablecell_ocr 子目录
|
|
|
|
|
cell_ocr_dir = None
|
|
cell_ocr_dir = None
|
|
|
if output_dir:
|
|
if output_dir:
|
|
|
- cell_ocr_dir = os.path.join(output_dir, "tablecell_ocr")
|
|
|
|
|
|
|
+ cell_ocr_dir = output_dir
|
|
|
os.makedirs(cell_ocr_dir, exist_ok=True)
|
|
os.makedirs(cell_ocr_dir, exist_ok=True)
|
|
|
|
|
|
|
|
h_img, w_img = table_image.shape[:2]
|
|
h_img, w_img = table_image.shape[:2]
|