Use calibrated confidence to find the words a person should look at, on a grainy, tilted copy of the receipt.
A word’s Confidence is the calibrated probability that the word is exactly right, fitted per script on held-out data, so one threshold means the same thing on every page. receipt-photo.jpg is the sample receipt turned 3°, scaled down, blurred, given grain and saved as a low-quality JPEG:
using OneImage; using OneOcr; OcrEngine engine = OcrEngine.LoadBundled(); OcrPage page = Image.Load("receipt-photo.jpg").Ocr(engine); Console.WriteLine($"straightened {page.SkewDegrees:F1}°, {page.Words.Count} words"); foreach (OcrLine line in page.Blocks.SelectMany(b => b.Lines)) Console.WriteLine($"{line.Words.Min(w => w.Confidence),5:P0} {line.Text}"); IEnumerable<OcrWord> check = page.Words.Where(w => w.Confidence < 0.9f); Console.WriteLine($"Below 90%: {string.Join(" ", check.Select(w => $"\"{w.Text}\" {w.Confidence:P0}"))}");
straightened -3.0°, 48 words 4% 1 3% e 3% 3 99% Corner Market 95% 1402 Oak Street 99% 78704 Austin 95% +1 512 555 0142 98% Date: 24/10/2026 13% : Time: 14:32 98% Coffee beans 96% 2x Oat milk 100% Bagels 3% 15 98% 12.99 98% 8.98 99% 5.25 10% g Subtotal 27.22 7% U2 Tax 8.25 % 2.07 98% TOTAL $ 29.29 65% d**** 4821 98% Paid by Card 100% Thank you! 3% 9N Below 90%: "1" 4% "e" 3% "3" 3% ":" 13% "15" 3% "g" 10% "U2" 7% "d****" 65% "9N" 3%
- The reader straightened the 3° tilt, and every word of the receipt’s own text scores 90% or more with one exception: the payment line came back as two lines, and
****was misread asd****, at 65%. - The grain was read as a few short “words” (
1,e,15,9Nand others). Each scores 13% or less, so the threshold separates them from the receipt’s text. RawConfidenceis the uncalibrated mean of the characters’ best probabilities; useConfidencefor thresholds. Lines and blocks average their words’.- Coming from Tesseract? Its
confis a 0–100 score; divide an existing threshold by 100 as a starting point, then look at the words just below it (Moving from Tesseract).