Locally baseline detection for online Arabic script based languages character recognition

Imran Razzak, Muhammad Sher, Syed Afaq HussainInternational Journal of the Physical Sciences 2010

Abstract

Baseline detection is a critical preprocessing step in Optical Character Recognition (OCR), significantly impacting the accuracy of subsequent stages like normalization, skewness correction, and feature extraction. For Arabic-script languages, particularly Urdu, this task is exceptionally challenging due to the script's cursive nature and complex structural rules. This paper introduces a novel three-step method for local baseline detection in Urdu handwritten scripts: diacritical marks segmentation, primary baseline estimation, and local baseline estimation. By leveraging style-specific features of Nasta'liq and Naskh scripts, the proposed approach achieves high recognition accuracy, addressing the limitations of traditional global baseline detection methods.

Introduction

In the realm of character recognition, the "baseline" is the imaginary line upon which characters are positioned. While straightforward in Latin-based scripts, identifying this line in Arabic-script languages is a formidable challenge. Urdu, often written in the elegant but complex Nasta'liq style, features characters that stack vertically, overlap, and change shape based on their neighbors. This paper presents a specialized "local baseline detection" algorithm designed to navigate these complexities.

The Challenge of Arabic and Urdu Scripts

Standard OCR techniques often rely on horizontal projection—summing pixels across rows—to find the peak that represents the baseline. However, Urdu scripts present several obstacles:

  1. Diacritical Marks: Dots and accents (nuqta) are frequent and can appear far from the primary stroke, creating "noise" that skews global projection results.
  2. Short Word Segments: Many Urdu words are composed of short segments called ligatures, which may not provide enough data for a statistically significant global baseline.
  3. Vertical Stacking and Slant: In Nasta'liq, characters often descend diagonally, meaning a single horizontal line cannot accurately represent the entire word's base.
Structural complexity of Urdu script showing multiple reference lines: Base-line, First-descender-line, and Second-descender-line.

Proposed Methodology

The researchers developed a three-phase approach to refine baseline detection from a coarse global estimate to a precise local one.

Phase I: Diacritical Marks Segmentation

The first step involves isolating "secondary strokes" (diacritics) from the "primary strokes" (the main body of the word). By calculating the dimensions of each stroke, the system identifies small marks that fall below a specific threshold. Removing these marks creates a "ghost shape" of the word, significantly reducing noise for the next phase.

Phase II: Primary Baseline Estimation

With the diacritics removed, the system applies horizontal projection to the ghost shape. This provides a rough, global baseline that is far more accurate than one calculated with the full script, as the distracting dots no longer interfere with the projection peaks.

Phase III: Local Baseline Estimation

This is the core innovation of the study. Recognizing that a single global line is insufficient for cursive scripts, the algorithm performs local refinement. It examines the ending shapes of individual ligatures. Because Nasta'liq and Naskh styles follow different structural rules, the system applies specific feature-extraction logic for each. For instance, in Nasta'liq, the baseline often shifts between ligatures; the algorithm calculates the exact angle and position for each segment based on its terminal shape.

Example of baseline detection on individual word segments, illustrating how the line adapts to the script's flow.

Results and Discussion

The algorithm was tested on both Nasta'liq and Naskh styles. Naskh, being more linear and similar to standard Arabic, achieved a high accuracy of 91.7%. Nasta'liq, with its intricate vertical stacking, reached 80.3%. While lower than Naskh, this represents a significant improvement over traditional methods that often fail entirely on Nasta'liq text.

The "ghost shape" strategy proves that simplifying the input by removing diacritics is essential for robust baseline estimation. Furthermore, the shift from global to local detection acknowledges the dynamic nature of Urdu calligraphy, where the "line" is a local property of the ligature rather than a global property of the sentence.

Conclusion

Locally baseline detection offers a promising path forward for Urdu OCR. By treating the baseline as a dynamic, style-dependent feature and preprocessing scripts to remove diacritical noise, the proposed method overcomes long-standing hurdles in Arabic-script recognition. Future work will focus on adapting these local refinements for offline OCR and improving the handling of overlapping strokes in highly cursive handwriting.

Summary updated

BibTeX
@article{razzak2010locally,
  author = {Imran Razzak and Muhammad Sher and Syed Afaq Hussain},
  title = {{Locally baseline detection for online Arabic script based languages character recognition}},
  journal = {International Journal of the Physical Sciences},
  year = {2010},
  doi = {10.5897/ijps.9000353},
}
Figure