Operator Reference
write_ocr_trainf_image (Operator)
write_ocr_trainf_image
— Write characters into a training file.
Signature
write_ocr_trainf_image(Character : : Class, TrainingFile : )
Description
The operator write_ocr_trainf_image
is used to prepare the
training with the operator trainf_ocr_class_mlp
or
trainf_ocr_class_svm
. Hereby
regions, representing characters, including their gray values (region
and pixel) and the corresponding class name 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
. If no
file extension is specified in TrainingFile
the extension '.trf'
is appended to the file name. 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. The file format can be defined by the parameter
'ocr_trainf_version' of the operator set_system
.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
Character
(input_object) singlechannelimage(-array) →
object (byte / uint2)
Characters to be trained.
Class
(input_control) string(-array) →
(string)
Class (name) of the characters.
TrainingFile
(input_control) filename.write →
(string)
Name of the training file.
Default: 'train_ocr'
File extension:
.trf
Result
If the parameters are correct, the operator
write_ocr_trainf_image
returns the value 2 (
H_MSG_TRUE)
.
Otherwise an exception will be raised.
Possible Predecessors
threshold
,
connection
,
read_ocr_trainf
Possible Successors
trainf_ocr_class_mlp
,
trainf_ocr_class_svm
Alternatives
write_ocr_trainf
,
append_ocr_trainf
Module
OCR/OCV