Document Layout Finds Reading Order
Layout analysis labels titles, columns, tables, and figures, then orders them the way a person would actually read.
Why Does This Exist?
OCR without layout reads across columns. A two-column paper becomes word salad because lines interleave in the wrong order and tables shatter into stray cells.
Layout comes first. It maps regions for optical character recognition, reuses box ideas from text detection, and sequences crops for text recognition.
Think of It Like This
A librarian shelving a mixed donation
A librarian sorts novels, atlases, and photo albums before cataloging pages, then reads each shelf top to bottom.
It fails on magazines with text wrapped around figures. Rigid shelves cut articles that flow around images, just as boxes cut wrapped paragraphs.
How It Actually Works
Detect blocks with labels in title, text, table, figure, list, where sets how the block is read. Order by column then vertical position: sort into columns by center, then sort each column by . A page with 5 blocks at 0.83 means 83 percent of predicted areas match truth tightly.
Worked example
Blocks: title , left text , right text , table , figure . Reading order is title, left text, table, right text, figure when columns group left before right. Naive top-to-bottom mixing would read left and right lines alternately and wreck every sentence.
Watch Out For
Reading tables as plain paragraphs
Tables need cell structure, not line order. The symptom is numbers strung into sentences. Route table blocks to a table parser instead of the paragraph reader.
The Quick Version
- Layout labels blocks then orders them by column and height.
- Fixture page holds 5 blocks at 0.83 with correct two-column order.
- OCR runs after layout, not before, to avoid mixed lines.
- Tables and figures need special readers beyond paragraphs.
- Wrapped text around figures still breaks rigid boxes.