[Python] How to handle OCR when scanned PDF pages contain portions of previous/next pages due...

Discussão em 'Python' iniciado por Stack, Junho 2, 2025.

  1. Stack

    Stack Membro Participativo

    I am processing a large batch of scanned book PDFs using an OCR pipeline (MinerU, PaddleOCR, etc.). Some of these PDFs have a scanning issue: a portion of the previous (or next) page appears on the current page. This is likely due to book gutter, bad alignment, or page split during scanning.

    Example:

    The scanned PDF page visually contains part of the previous page along the gutter or edge. As a result, the OCR output (Markdown or text) also includes this duplicated or misplaced text.

    enter image description here

    Adjusting OCR and layout models. Changing PDF parsing methods. Manual review confirms the issue is present in the original PDF scan, not just the OCR output. Questions:

    Is there any automated way to preprocess such PDFs to remove or crop out the unwanted portions before OCR? Are there recommended tools or scripts for batch processing such PDFs to fix this issue? Any best practices for handling book gutter or split-page artifacts in scanned PDFs before OCR? Any advice or workflow suggestions would be appreciated!

    Continue reading...

Compartilhe esta Página