OCR Segmenter Tool

The OCR Segmenter tool takes an input image and the ROI that contains a single line of characters and the surrounding featureless background (although the background might be non-uniform and/or noisy) and splits it up into individual regions where each region contains one character. The ROI is specified as an affine rectangle that specifies the approximate location, angle, and skew of the line of text. The ROI must be entirely contained within the input image.

For example, if an image contains the line of text “ABCD”, then the OCR Segmenter tool produces four separate images, each of which is an image of a single character. Character segmentation does not know anything about actually determining which letter a character image corresponds to; in the above example, it has no way of knowing that the first image corresponds to the letter “A”.

The OCR Segmenter tool is defined in the ch_cvl/ocsegmnt.h header file.

The tool determines where the top and bottom of the line of characters are and is capable of refining the angle and skew of the line if requested.

The x-axis of the affine rectangle should be parallel to the baseline of the text, and the y-axis should be parallel to the vertical strokes of the characters; if there is no skew, the y-axis is perpendicular to the x-axis. The positive direction of the x-axis corresponds to the reading direction. The positive direction of the y-axis corresponds to the vector from the top of each character to the bottom of each character. Note that the baseline of the text may have any angle 0-360 in the image as long as the affine rectangle is oriented at approximately the same angle.

For detailed explanations on affine rectangle and its transformations such as skew and rotation, see section Affine Rectangle Sampling Tool.

Note: The OCR Segmenter tool is not a general purpose string finder; it is not capable of finding a string in an arbitrarily complex image with a large ROI.

The OCR Segmenter tool performs the following functionalities on the input image in the following order.