Skip to content

majedco03/ocr_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arabic Letter Recognition (OCR Arabi)

An advanced application built with the Flutter framework specifically designed to recognize individual Arabic letters. The app utilizes a custom OCR engine based on image processing algorithms and template matching, with full audio pronunciation support for each letter in Modern Standard Arabic but it will recognize only our custom font!

🚀 Key Features

  • Custom OCR Engine: The recognition system was built from scratch to accommodate the unique nature of Arabic script, specifically the "AlDajani-AlZamil" font.
  • Smart Image Processing: A pipeline of processors including Grayscale, Binarization, Noise Removal, and Scaling to ensure recognition accuracy even in challenging lighting conditions.
  • Intelligent Classification (Object Counting): Letters are classified based on the number of connected components (e.g., the letter "ث" consists of 4 objects: the base and 3 dots), which accelerates searching and improves accuracy.
  • Educational Experience: Once a letter is recognized, the app plays an audio clip of its pronunciation to assist children and language learners.
  • Modern UI: A fully RTL (Right-to-Left) supported interface with a clean and visually appealing color palette.

🛠️ How It Works

The captured letter goes through a rapid technical journey:

  1. Capture: Photographed via a dedicated camera interface with a guide frame to help position the letter correctly.
  2. Preprocessing: Converting the image to binary (strictly black and white), removing shadows caused by paper texture, and centering the letter in a standardized 64x64 pixel frame.
  3. Sub-Analysis: Calculating the number of "objects" in the processed letter image.
  4. Matching: Comparing the captured character only against stored templates that have the same object count (Template Matching) using pixel distance calculations.
  5. Display: Showcasing the result along with a confidence score and playing the associated audio.

📁 Project Structure

lib/
├── screens/              # App screens (Home, Camera, Result)
├── services/             # Technical services
│   ├── custom_ocr_service.dart   # Core engine and recognition logic
│   ├── preprocessing.dart        # Image cleaning and enhancement algorithms
│   ├── audio_service.dart        # Management of audio pronunciation files
│   └── template_generator.dart   # Tools for building the template database
├── widgets/              # Shared custom UI components
└── theme/                # Visual identity (Colors, Fonts, Sizes)

⚙️ Installation and Setup

  1. Ensure you have Flutter SDK installed (version 3.9 or later).
  2. Clone the project:
    git clone https://github.com/majedco03/ocr_project.git
  3. Install dependencies:
    flutter pub get
  4. Run the application on an emulator or a physical device:
    flutter run

📝 Technical Notes

  • The engine is trained on the AlDajani-AlZamil font, specifically for standalone (isolated) characters.
  • Templates are organized in assets/templates/ folders categorized by object count (1-4).
  • The implementation ensures real-time latency as it does not require an internet connection or cloud processing.

Developers: Majed Aldajani [GitHub: MajedCo03] and Othman AlZamil [GitHub: Oth5]

About

A real-time Arabic character recognition app built with Flutter, featuring a custom offline OCR engine, image preprocessing, and audio pronunciation support.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors