Receipts with faded ink, crumpled invoices, handwritten notes — standard OCR libraries often fail on such documents. We solve this with custom preprocessing and post-processing: we choose the stack (Vision, ML Kit, or Tesseract) for each specific task rather than using a one-size-fits-all solution. Get a free project assessment — contact us.
How to choose the right OCR tool?
Choosing between Vision, ML Kit, and Tesseract depends on your task and requirements for speed and accuracy. iOS Vision framework — VNRecognizeTextRequest — works on-device, supports 18+ languages including Cyrillic. The .accurate level takes 180–350 ms to process an A4 photo on an iPhone 12. ML Kit Text Recognition v2 is cross-platform, on-device, supports Cyrillic and CJK. On Android, use TextRecognition.getClient(TextRecognizerOptions.DEFAULT_OPTIONS). Tesseract via SwiftyTesseract / tess-two is for custom fonts, but 3–5 times slower. For example, ML Kit on Android is 1.5 times faster than Tesseract on the same device for printed text. We help you pick the optimal tool for your task — from simple scanning to table and form recognition.
Why preprocessing is critical?
40% of OCR success comes from input image quality. A typical pipeline:
- Grayscale — remove color noise
- Contrast correction via
CIColorControls(iOS) orColorMatrix(Android) - Binarization (Otsu threshold) — for uneven lighting
- Deskew — correct perspective and tilt
From our practice: for an invoice scanning app, preprocessing boosted accuracy from 78% to 94% in a warehouse setting. Perspective correction using VNDetectRectanglesRequest and CIPerspectiveCorrection was especially effective. Practical results:
| Condition | Without preprocessing | With preprocessing |
|---|---|---|
| Bright light | 70% | 92% |
| Tilted document | 65% | 89% |
| Crumpled paper | 55% | 84% |
How we implement OCR: a real case
We built OCR for a logistics client: recognizing invoice numbers with dot-matrix font on crumpled boxes. We chose ML Kit with custom preprocessing. Pipeline: grayscale → Otsu binarization → deskew → ML Kit. Post-processing: extract invoice number via regex with checksum. Accuracy on test set: 96%. Timeline: 5 business days.
func preprocessImage(_ image: UIImage) -> UIImage { guard let ciImage = CIImage(image: image) else { return image } let gray = ciImage.applyingFilter("CIPhotoEffectMono") let contrast = gray.applyingFilter("CIColorControls", parameters: [kCIInputContrastKey: 1.1]) // Otsu binarization not built-in, use custom kernel return UIImage(ciImage: contrast) } This pipeline is standard in every project. We guarantee results.
What does post-processing provide?
Recognized text is not always ready data. For extracting phone numbers, emails, dates, we use NSDataDetector (iOS) or Patterns (Android). For structured fields (INN, SNILS) — regex with checksum validation. Importantly, ML Kit returns TextBlock → TextLine → TextElement with coordinates. We group lines by Y to reconstruct the table structure. This reduces manual entry by 30–50%.
Tool comparison
| Parameter | Vision (iOS) | ML Kit (Android) | Tesseract |
|---|---|---|---|
| Speed | 150–350 ms | 200–400 ms | 600–1000 ms |
| Languages | 18+, Cyrillic | Latin, Cyrillic, CJK | Any with training |
| On-device | Yes | Yes | Yes |
| Custom model | No | No | Yes |
| Integration difficulty | Medium | Low | High |
How to recognize text in real time?
For real-time OCR, we reduce resolution to 720p and run recognition every 3-5 frames with result buffering. On Android, ML Kit in STREAM_MODE manages frequency automatically. On iOS — AVCaptureVideoDataOutput with VNRecognizeTextRequest. This gives a stable 15-20 fps without overheating. Order such a module — get integration consultancy.
How we work on an OCR module
- Analysis: study document types, shooting conditions, fonts.
- Tool selection and preprocessing pipeline design.
- Recognition and post-processing implementation.
- App integration (batch or real-time).
- Testing on a set of real data (at least 100 samples).
- Deployment and support.
What's included in OCR module development
- Requirements analysis and stack selection
- Preprocessing pipeline development for your conditions
- Recognition implementation (photo or real-time)
- Data post-processing (field extraction, validation)
- App integration (iOS/Android)
- Testing and refinement based on results
- Documentation and code review
- Our team's experience: over 5 years in mobile, 30+ OCR projects
Timelines and cost
Timelines: from 3 business days (photo OCR with preprocessing) to 2 weeks (real-time document scanner with correction). OCR implementation reduces manual entry costs by 30–50%. Cost is calculated individually — contact us for an estimate. We guarantee quality: you receive a ready module with at least 95% accuracy (on agreed document types). Order development or get a consultation.







