Lineage OS Glimpse OCR & QRCode (?) Proposal
Inspired by Apple OCR for photos.
Goals
- Users can “double click” to select text from an image.
Requirements
- Perform OCR accurately and quickly
- Provide Points & Bounding boxes
- Enable users to “hold click” to select text
Guidelines
- Not too many new dependencies
- Should not impact build process
- Careful with large dependencies
- No Google Services
UX
User double taps an image to possibly select text. If a model is not present, the user is prompted to install a model. If a model is present, OCR is performed on the image. If OCR is successful, the view enters “ocr select mode”, darkening out the image. Text sequence near where the user double tapped is highlighted. User can drag their finger across the screen to select more text. User can than press either the close button to exit select mode, or press the check mark button to confirm their selection which than copies the text to their keyboard.
UI
Libraries
Proprietary
Google ML Kit
https://developers.google.com/ml-kit/vision/text-recognition/v2/android
Capable of getting points, boxes, and more for rendering.
https://developers.google.com/android/reference/com/google/mlkit/vision/text/Text.TextBlock
Pros
- Google Services devices can just use MLKit
- Minimal app size increase.
Cons
- Google Services.
Open Source
Tesseract4Android
https://github.com/adaptech-cz/Tesseract4Android
Pros
- Android
- Not too large library size
- Performant (sub 1 second in emulator on single thread)
Cons
- Somewhat clunky codebase
- Developers are not active, only maintaining
- Have to download models separately
Aspire
https://asprise.com/royalty-free-library/java-ocr-source-code-examples-demos.html