A Stroke-Based Text Extraction Algorithm for Digital Videos

Jong-Myeon Jeong, Jihun Cha, Kyu-Heon KimJournal of Korean Institute of Intelligent Systems 2007

Abstract

In this paper, a stroke-based text extraction algorithm for digital video is proposed. The proposed algorithm consists of four stages: text detection, text localization, text segmentation, and geometric verification. The text detection stage identifies frames containing text by extracting "seed points"—pixels with a high probability of belonging to a stroke—and applying morphological operations. Text localization follows, using morphological operations on edges containing seed points combined with horizontal and vertical projections. The text segmentation stage classifies these projected areas into text and background regions based on intensity distribution. Finally, a geometric verification stage filters the results using prior knowledge of video text characteristics to ensure accuracy.

Introduction

Extracting text from digital video—such as subtitles, news tickers, or sports scores—presents unique challenges compared to standard document OCR. Video frames often suffer from low resolution, compression artifacts, and complex, dynamic backgrounds where text color may blend with the surroundings. Traditional methods typically rely on texture analysis or machine learning classifiers, which can be computationally intensive or fail in low-contrast scenarios.

This paper addresses these issues by proposing a structural approach that leverages the physical properties of characters. Most characters are composed of strokes with consistent widths and opposing edge directions. By focusing on these fundamental geometric units, the algorithm can robustly isolate text even against cluttered backgrounds.

Proposed Methodology

The proposed system follows a structured four-stage pipeline designed to progressively narrow down text regions from the full video frame.

Overview of the proposed four-stage text extraction pipeline.

1. Text Detection and Seed Point Extraction

The first stage identifies potential text regions by searching for "seed points." The algorithm divides the input frame into sub-blocks and analyzes edge pairs. A stroke is defined by two parallel edges with opposite gradient directions (e.g., a left-facing edge and a right-facing edge).

Illustration of characters and their constituent strokes with identified seed points and edge directions.

By generating a histogram of the distances between these opposing edge pairs within a block, the algorithm identifies the most frequent distance, which corresponds to the dominant stroke width. Pixels located between these valid edge pairs are labeled as seed points. This histogram-based approach makes the detection scale-invariant, as it automatically adapts to different font sizes.

2. Text Localization

Once seed points are identified, the algorithm merges them into candidate text regions using morphological "closing" operations. These operations fill small gaps between seed points, creating solid blocks that represent potential words or lines of text. Horizontal and vertical projections are then applied to these blocks to define precise bounding boxes.

3. Text Segmentation

To separate text pixels from the background within each bounding box, the algorithm performs a "Color Polarity" check. This step determines whether the text is lighter or darker than its immediate background. To handle complex noise trapped within characters, a specialized flood-fill technique called Dampoint Labeling is employed. This method effectively "cleans" the interior of the bounding box, ensuring only the character strokes remain.

4. Geometric Verification

The final stage filters out false positives—non-text objects like fences or architectural details that may mimic stroke-like patterns. The system verifies the geometric properties of each candidate bounding box, including its height, aspect ratio, and the density of text pixels. Only regions meeting the predefined criteria for typical video text are retained.

Experimental Results

The algorithm was evaluated on a diverse dataset of 204 frames from news, sports, and music videos, containing a total of 4,913 characters. These genres were selected to test the system against varying levels of background complexity and font styles.

The results demonstrated high robustness:

  • Recall: 94.89%
  • Precision: 95.36%

Performance varied slightly by genre, with the highest precision observed in Sports (97.1%) and News (94.9%), where text is generally well-defined. In the more visually chaotic environment of Music Videos, the system still maintained a respectable precision of 92.2%.

Conclusion

The stroke-based approach provides a robust framework for video text extraction by focusing on the inherent structural properties of characters. By using seed points and stroke-width histograms, the algorithm achieves high precision and recall across various video types. Future work will explore temporal consistency—using information across consecutive frames—to further improve accuracy and reduce extraction flicker in dynamic video sequences.

Summary updated

BibTeX
@article{jeong2007stroke,
  author = {Jong-Myeon Jeong and Jihun Cha and Kyu-Heon Kim},
  title = {{A Stroke-Based Text Extraction Algorithm for Digital Videos}},
  journal = {Journal of Korean Institute of Intelligent Systems},
  year = {2007},
  doi = {10.5391/jkiis.2007.17.3.297},
}
Figure