Herror ::write_ocr_trainf_image (
    Hobject Character,
    const HTuple &Class,
    const HTuple &FileName
)
void HImage::WriteOcrTrainfImage (
    const HTuple &Class,
    const HTuple &FileName
) const
void HImageArray::WriteOcrTrainfImage (
    const HTuple &Class,
    const HTuple &FileName
) const

Write characters into a training file.

The operator ::write_ocr_trainf_image is used to prepare the training with the operator ::trainf_ocr_class_box. Hereby regions, representing characters, including their grayvalues (region and pixel) and the corresponding classname will be written into a file. An arbitrary number of regions within one image is supported. For each character (region) in Character the corresponding class name must be specified in Class. The file name can be chosen at will. In contrast to ::write_ocr_trainf one image per character is passed. The domain of this image defines the pixels which belong to the character.


Parameters

Character (input_object)
image(-array) -> Hobject: HImage(Array)
Characters to be trained.

Class (input_control)
string(-array) -> HTuple.char *
Class (name) of the characters.

FileName (input_control)
filename -> HTuple.char *
Name of the training file.
Default value: ''train_ocr''


Result

If the parameters are correct, the operator ::write_ocr_trainf_image returns the value H_MSG_TRUE. Otherwise an exception will be raised.


Possible Predecessors

::threshold, ::connection, ::create_ocr_class_box, ::read_ocr


Possible Successors

::trainf_ocr_class_box, ::info_ocr_class_box, ::write_ocr, ::do_ocr_multi, ::do_ocr_single


Alternatives

::write_ocr_trainf, ::append_ocr_trainf


Module

Optical character recognition



Copyright © 1996-2002 MVTec Software GmbH