{
  "id": 21017344,
  "title": "Table OCR to Excel: wrapped cells had no cheap fix, 11 of 34 still wrong on an unruled sample",
  "url": "https://urgent.news/2026/11/21/table-ocr-to-excel-wrapped-cells-had-no-cheap-fix-11-of-34-still",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-21T08:07:22.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/shu_jing_915fa287b22539ad/table-ocr-to-excel-wrapped-cells-had-no-cheap-fix-11-of-34-still-wrong-on-an-unruled-sample-3l3g"
  },
  "original_language": "en",
  "account": "A client sent a screenshot of a table for conversion into an Excel spreadsheet. The OCR recognized the characters correctly, but the columns did not break properly. When rebuilding the grid using box coordinates, 4 of 34 cells were incorrect when the table had ruling lines and 11 of 34 cells were incorrect when the table did not have ruling lines.\n\nThe sample was a fictional work-order table with 7 rows and 5 columns, consisting of 34 non-empty cells. Six cells contained two lines of text. The table was provided in two versions: one with ruling lines and one without.\n\nThe recognition process was performed using ImgIng (https://imging.ai/) with the default tier and desktop browser on an Apple-silicon Mac. The results were exported as TXT and JSON files containing the coordinates of each text box.\n\nA script was used to compare the exported text with the ground truth, considering a cell to be wrong if it was not in its original row and column. The plain export placed every row into two cells instead of five, resulting in 34 out of 34 cells being misplaced for both versions. However, the text and row count were accurate.\n\nThe JSON file contained 40 boxes for 34 cells, with the extra six representing the second lines of the wrapped cells. There was no indication in the boxes that they represented the lower half of the cell above. The script grouped boxes into rows based on the center y-coordinate, with a tolerance of 0.5 times the box height. It projected the boxes onto the x-axis to find column gaps, which were at least 0.2 times the box height wide in at least 80% of the rows.\n\nThe wrap rule then applied one rule: if a row's first column was empty, it was folded into the row above. This rule left 4 of 34 cells incorrect on the ruled image, and all four were wrapped cells whose second lines were reversed. On the unruled image, the rule joined the second line of one row to the first line of the next row, resulting in 11 of 34 cells being incorrect.\n\nNo cause for the issue was traced, and it was concluded that a top-down fold does not hold for this sample. Ruling lines were crucial in recovering all 34 cells correctly. An alternative approach, which ignored text positions, binarized the image, extracted horizontal and vertical lines, treated each white region as a cell, and dropped every text box into the cell holding its center. This method detected 35 cells for the ruled table, restored all six wrapped cells as two lines each, and left 0 of 34 cells incorrect. For the unruled version, there was nothing to cut along, so the 11 cells remained incorrect.\n\nFor a one-person shop, the cost would be approximately one cell in three, which is relatively low. If the image contains ruling lines, it is recommended to cut along them. If there are no ruling lines, sending a message to the sender requesting an export with gridlines or the original file may be a more cost-effective solution than attempting to fine-tune the thresholds.",
  "summary": "Picture a freelance request: the client has a work-order table, but what arrives is a screenshot, and the job is to get it into a spreadsheet. OCR reads the characters fine and the columns break. On a self-made 7 × 5 sample with six two-line cells, rebuilding the grid from box coordinates left 4 of 34 cells wrong when the table had ruling lines and 11 of 34 when it did not. Cutting along the…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}