OCR Font

The OCR Font class (ccOCFont) is a container class for a font, representing a set of characters, including their character codes, images, and other metadata, primarily for use with OCR and OCV and also more generally to represent a font.

The ccOCFont class supports serialization to and from ccArchive. The class provides the ccOCFont::load() and ccOCFont::save() functions to load and save the file using the file name as the sole argument.

The font file may be in “.ocr” format or the older “.ocf” or “.ocm” formats.

Although ccOCFont::load() can load files in the older formats, trying to train the OCR Classifier tool using such a font (produced either manually or by a different Cognex tool such as the Image Font Extractor) and then running the OCR Classifier tool on images produced by the OCR Segmenter tool will generally give a worse OCR read rate (for example, percentage of correctly classified characters) than creating a font using the OCR Segmenter tool.