How to OCR a Crooked Scan Without Rescanning
By Schema LawPublished Updated
To OCR a crooked scan, upload the file as it is and read the result before you do anything else. Many tools straighten a tilted page on their own. If lines come back merged, cut short or out of order, rotate the page image level in a PDF or image editor and run it again.
Rescanning is the last resort, and often it is not available at all: the paper belongs to the other side, to a records office, or to a file that was shredded years ago. Most crooked pages can be converted without it. What matters is knowing how much tilt you have, what kind, and what damage to look for.
Does a skewed page break OCR?
A skewed page does not always break OCR, but skew is one of the few scan faults that can ruin a clean, sharp page. Recognition starts by finding lines of text. On a tilted page those lines are harder to separate, and when line-finding fails, every later step works on the wrong pieces.
The documentation for the open-source engine Tesseract puts it directly: the quality of its line segmentation "reduces significantly if a page is too skewed, which severely impacts the quality of the OCR". Other engines are built differently and tolerate more, but the reasoning applies widely.
Some arithmetic shows how little tilt it takes. Suppose a page has text lines 6.5 inches wide, single-spaced in 12-point type, so each line sits about a fifth of an inch below the last.
| Tilt | Drop from one end of a line to the other | In line spacings |
|---|---|---|
| 0.5 degrees | about 0.06 inch | about a quarter of a line |
| 1 degree | about 0.11 inch | about half a line |
| 2 degrees | about 0.23 inch | more than one full line |
| 5 degrees | about 0.57 inch | nearly three lines |
At 2 degrees, the right end of each line sits lower than the left end of the line beneath it. Software that looks for horizontal bands of white between lines finds none. A person barely notices a 2-degree tilt. To a method that assumes level lines, the page has no lines at all.
Pleading paper shows the damage in a specific place. A complaint on numbered lines can pick up the line above when the page leans, and a cross-claim or a joinder paragraph in the margin may land on the wrong number. You also check the venue line in the caption, because a tilt shaves the left edge where that line starts.
How much that matters depends on the page:
- Single-spaced and dense text is hit hardest, because the white bands between lines are thinnest.
- Tables lose their rows. Cells from one row slide into the band of the next.
- Line-numbered pleading paper and transcripts can pair each number with the wrong line of text.
- Double-spaced text in one column survives the most tilt.
How is skew corrected before recognition?
Skew is corrected by a step called deskewing. Software estimates the angle of the text lines, then rotates the page image by that angle in the opposite direction so the lines run level. Recognition then works on the straightened image. Many OCR tools do this without asking, and some leave it to you.
There are a few common ways to estimate the angle. One tries a range of small rotations and keeps the one where the dark pixels gather into the sharpest horizontal bands. Another finds straight features, such as the baselines of words or ruled lines, and measures their slope. Model-based readers may skip the separate step and learn to follow tilted lines directly. You do not choose among these methods, but knowing they exist explains the ways deskewing fails.
Where automatic deskew goes wrong:
- Too little text. A page with a caption and three lines gives the estimate little to work with.
- Competing straight lines. A table grid, a letterhead rule or the black edge of the scan can be measured instead of the text.
- Mixed angles. A receipt taped crooked onto a straight sheet has two correct angles. Fixing one tilts the other.
- Large angles. Many deskew routines search only a few degrees either way. A page fed at 15 degrees may be left alone.
- Pages that are not tilted but turned. A sideways page is an orientation problem, a different detection step from skew.
Three things deskewing changes that you should know about:
- Rotating an image re-draws every pixel, which softens the letters slightly. One rotation is harmless. Repeated rounds of rotate, save, rotate again add blur each time.
- Rotation pushes the corners of the page outside the frame. If the tool crops back to the original size, text near a corner can be cut off: a Bates number, a page number, a footer.
- The straightened image may exist only inside the OCR tool. The file you keep can still show the crooked page. That is usually what you want for a record, since the scan stays as it was received.
Do not assume any particular product deskews. Schema Law's searchable PDF export is built on the file you uploaded, so a tilted page still looks tilted there. That tells you nothing about how the page will read. Test it.
Running OCR on a crooked scan as it is
Running OCR on a crooked scan as it is should be your first move, because it costs a minute and often works. Convert the file untouched, compare a few lines with the image, and only then decide whether the page needs straightening by hand.
- Keep the original file unaltered. Work on a copy if you expect to rotate or crop anything.
- Upload the crooked page as it is. In Schema Law, sign in and drop the PDF, PNG or JPEG onto the upload area. Files can be up to 20 MB.
- Open the parsed page beside the scan. Read the first three lines, the last three lines and one line from the middle against the image.
- Check the edges. Look for the page number, any Bates number and the last word of the longest lines. Edges suffer first on a tilted page.
- If the text is right, export and move on. Choose Word, plain text or searchable PDF as the task requires.
- If the text is damaged, straighten the image yourself. Most PDF editors and image viewers have a "straighten" or "rotate by angle" control. Line up a text baseline or the page edge with a guide, apply the rotation once, and save as a new file. Do not crop tighter than the original page.
- Upload the straightened copy and compare again. Keep the version that reads better, and note in the file which one you used.
A test on your own pages is the only reliable guide, and it is cheap. Schema Law's free plan covers one document a day of up to three pages, with the same export formats as every other plan, so you can put your most tilted page through it before deciding on a method for the set. Larger files need a paid plan, and the pricing page sets out the page limits.
Two cautions when straightening by hand. First, a document feeder that pulled one page crooked probably pulled others, each at a different angle, so a single rotation applied to the whole file will fix some pages and tilt others. Second, straightening a copy for OCR does not change what you received. If the scan is a production or a filing, the crooked file is the record and the straightened one is a working aid.
When the crooked page is the least of its problems, with faint text, speckle or cut-off margins as well, use the triage in the post on OCR for a low quality PDF to decide what is worth converting at all.
Rotated, upside-down and sideways pages
Rotated, upside-down and sideways pages are an orientation problem, separate from skew. Skew is a few degrees of tilt. Orientation is a quarter or half turn. Recognition tools detect it in a distinct step, and a page that step gets wrong comes back as nonsense or as nothing.
Tesseract's documentation, for example, lists orientation and script detection as its own page segmentation mode, apart from the default mode. Whether a given product runs that kind of detection on every page is something to find out by testing, not to assume.
The cases you will meet in a legal file:
- Landscape exhibits in a portrait set. Spreadsheets, charts and wide tables are often scanned sideways so they fit the feeder. Rotate these pages 90 degrees in a PDF editor before upload if the output is poor. A quarter turn, unlike a small-angle rotation, does not blur the image.
- Upside-down pages. A sheet fed bottom first in a stack. Easy to miss when you scroll quickly, and easy to fix with a 180-degree turn.
- Every second page upside down. This is the signature of double-sided originals that were flipped the wrong way for a second pass. Check even-numbered pages across the whole file.
- Sideways text on an upright page. A vertical Bates number or exhibit label in the margin, or column headers turned 90 degrees in a table. The body reads normally and the turned text is skipped or garbled. Read these by eye.
- Mixed orientation on one page. Two receipts on one sheet, one of them turned. Split it into two images if both matter.
One trap: a PDF can store a rotation instruction for display without the underlying image being turned. The page looks upright in your viewer while the picture inside is sideways. Tools differ in whether they honor that instruction. If a page that looks fine on screen converts to garbage, print it to a new PDF so the rotation is applied to the image itself, then try again.
Orientation errors are also a reading-order hazard on pages with columns. The post on whether OCR can handle two column documents explains how reading order is decided.
Curved pages from bound volumes
Curved pages from bound volumes cannot be fixed by rotation, because the tilt changes across the page. Near the spine the paper bends away from the glass, so lines of text curve, letters narrow and a shadow falls into the gutter. Each line has many angles, and no single correction suits them all.
You meet this with deed books, court minute books, corporate minute books, bound transcripts, old reporters and any record a clerk copied by pressing a volume onto a flatbed.
What the curve does to recognition:
- The last few characters of each line beside the spine are squeezed and darkened. Words there are misread or dropped.
- Curved lines get split in two, or two lines merge where the curve brings them close.
- The gutter shadow can be read as a thick vertical bar or a column of stray characters.
- On a two-page spread, software may read straight across both pages as if they were one wide line.
What helps, if you control the capture:
- Capture one page per image, not the whole spread.
- Press the volume flat as far as its binding safely allows, or let the facing page hang off the edge of the scanner so the page you want lies flat.
- Leave the gutter in the frame. Cropping it out tends to cut the ends of lines.
- If you are photographing the book, hold the camera directly above the page. The post on how to OCR a photo of a document covers capture with a phone.
If all you have is someone else's curved copy, convert it and then read the spine-side edge of every page against the image. That strip is where the errors will be. For a page you must quote, type the affected words yourself.
Some scanning apps and book scanners offer page flattening, often called dewarping. It can help a lot. It also redraws the image more aggressively than a rotation does, so compare the flattened result with the original for missing or doubled lines.
Signs that the skew damaged the output
Signs that skew damaged the output appear as line-level faults: lines that end early, lines fused together, text in the wrong order and missing material at the page edges. Individual letters may look fine. That is the difference from the scattered wrong characters a blurry or faint scan produces.
Use this as a checklist against the page image:
- Line count. Count the lines in one paragraph on the image and in the output. Fewer lines in the output means some merged or vanished.
- Sentences that jump. A sentence that changes subject halfway, then resumes two lines later, is two lines interleaved.
- Short lines. A line that stops before the right margin on a justified page has lost its end.
- The first and last characters of lines. A missing first letter down the left edge, or missing final words down the right, means the tilt pushed text outside the area the software read.
- Corners. Look for the page number, footer, Bates number and any exhibit label. If one is absent from the output, check whether it is absent from the image the tool worked on.
- Table rows. A row holding values from two different rows, or a total that no longer sits with its label, means row bands were crossed.
- Line numbers. On pleading paper or a transcript, see that line 14 on the image is still line 14 in the text.
- Whole blocks missing. A paragraph beside a letterhead or a stamp that never appears in the output may have been classed as a picture.
If you find line-level faults, straightening the page and running it again is usually worth the two minutes. If you find only scattered wrong letters, skew is probably not the cause, and the guide to why OCR output is full of errors will get you to the real one faster.
Whichever it is, check the names, dates and amounts against the image before the text goes into anything you sign. The outline of how Schema Law takes a file from upload to export shows where that comparison fits, and your own test page is the evidence.