This package is dedicated to the handling of textual aspects.

General processing

TextProcessing

How textual glyphs are handled

Glyphs selection

The general idea is to come up with glyphs that are very likely to correspond to real text. Such glyphs are assigned a textual Shape, that is either the Shape TEXT or the Shape CHARACTER. Glyph candidates come from 3 sources:

Glyphs processing

The special processing for textual glyphs is triggered during the PATTERNS step, which among other patterns, calls the {@link omr.glyph.text.TextInspector#runTextPattern} method.

Working at a system level, this method does the following:

  1. Retrieve additional textual glyphs (see the area division, as described above),
  2. Retrieve alignments of textual glyphs into instances of {@link omr.glyph.text.Sentence}
    1. Make sure no textual glyphs overlap (see {@link omr.glyph.text.Sentence#mergeEnclosedTexts})
    2. Try to aggregate non-textual glyphs that may exist on the line (see {@link omr.glyph.text.Sentence#includeAliens})
    3. Merge sentences close to each other via {@link omr.glyph.text.TextInspector#mergeSentences}.
    4. Finally, try to recognize each retrieved sentence through {@link omr.glyph.text.Sentence#recognize} which uses the OCR feature provided by the Tesseract tool.
  3. Process each Sentence in sequence: