Skip to content

Repository files navigation

Android Open Lens OCR Text Scanner

Screenshots

Main Screen
Text Selection Overlay
Extracted Text View
Margin Rulers for Columns
Open Image from Browser
Zoom Feature

Project Description

Android Open Lens OCR Text Scanner is an open-source Android application that allows users to scan text from images using Optical Character Recognition (OCR). The app leverages modern Android development practices and open-source libraries to provide a fast, accurate, and user-friendly text scanning experience.

Features

  • Capture images using the device camera or select from the gallery
  • Extract text from images using OCR technology
  • Copy, share, or save extracted text
  • Simple and intuitive user interface
  • Support for multiple languages (if applicable)
  • History of scanned texts

Getting Started

Prerequisites

  • Android Studio (latest stable version recommended)
  • Android device or emulator running Android 6.0 (Marshmallow) or higher
  • Java 8+ or Kotlin support

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/Android-Open-Lens-OCR-Text-Scanner.git
    cd Android-Open-Lens-OCR-Text-Scanner
  2. Open the project in Android Studio:

    • Select Open an existing project and choose this folder.
  3. Install dependencies:

    • Android Studio will automatically sync and download dependencies via Gradle.
  4. Run the app:

    • Connect your Android device or start an emulator.
    • Click the 'Run' button in Android Studio.

Project Overview for New Contributors

This project follows a modular Android architecture for maintainability and scalability.

Major Folders & Files

  • app/: Main Android application module containing source code.
    • src/main/java/: Contains all Java/Kotlin source files.
      • activities/: UI screens and logic.
      • fragments/: Reusable UI components.
      • ocr/: OCR processing logic and helpers.
      • utils/: Utility classes and helpers.
    • src/main/res/: App resources (layouts, drawables, strings, etc.).
    • src/main/AndroidManifest.xml: App manifest file.
  • screenshots/: Contains screenshots for documentation and PRs.
  • build.gradle: Project and module build configuration files.
  • README.md: Project documentation.

Architecture

  • Frontend/UI: Built with Android native components (Activities, Fragments, XML layouts).
  • OCR Engine: Integrates open-source OCR libraries (e.g., Tesseract or ML Kit) for text extraction.
  • Data Storage: Uses local storage (e.g., Room database or SharedPreferences) for saving scan history.
  • No separate backend: All processing is done on-device for privacy and speed.

Component Interaction

  • The UI layer (Activities/Fragments) interacts with the OCR logic to process images.
  • Extracted text is displayed to the user and can be saved or shared.
  • Data storage components manage scan history and user preferences.

Getting Started for Developers

  1. Fork and clone the repository.
  2. Open in Android Studio and let Gradle sync dependencies.
  3. Familiarize yourself with the folder structure and main components.
  4. Run the app on an emulator or device to see it in action.
  5. Check the issues tab for open tasks or feature requests.

Roadmap

  • Add support for more OCR languages
  • Improve UI/UX with Material Design
  • Add cloud backup for scan history
  • Implement dark mode
  • Add unit and UI tests

Contributing

We welcome contributions from everyone! Please read the guidelines below before submitting a pull request.

Contributing Guidelines

  • Every pull request (PR) must include relevant app screenshots showing the changes made.
  • Add these screenshots to the screenshots/ folder in the repository.
  • Update the Screenshots section in the README to include the new screenshots with appropriate captions or context.
  • Ensure screenshots are clearly labeled (e.g., feature-login.png, fix-navbar-bug.png) and correspond to the PR functionality.
  • Follow standard Android development best practices and ensure your code passes lint and builds successfully.

Open sourced alternative for Google Lens

Grab & extract text from an image using smart text selection cursors overlaid on the image.

OCR App recognizes text in any Latin-based language.

To recognize the text in an image, OCR App uses Google firebase ML Kit's On-device text recognition APIs https://firebase.google.com/docs/ml-kit/recognize-text

Options:

  1. Zoom the image.
  2. Alter the extracted text before copying if needed.
  3. Also works on a 2 column text layout using the left & right margin rulers.
  4. Open an image from Internet browser directly without downloading to device.

Contribution

  • GNU AFFERO GENERAL PUBLIC LICENSE
  • Copyright and license notices must be preserved.
  • When a modified version is used to provide a service over a network, the complete source code of the modified version must be made available.

About

Open sourced alternative for Google Lens

Resources

Stars

14 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages