do_ocr_single_class_cnnT_do_ocr_single_class_cnnDoOcrSingleClassCnnDoOcrSingleClassCnndo_ocr_single_class_cnn — Classify a single character with an CNN-based OCR classifier.
In most cases, do_ocr_multi_class_cnndo_ocr_multi_class_cnnDoOcrMultiClassCnnDoOcrMultiClassCnndo_ocr_multi_class_cnn should be preferred over
do_ocr_single_class_cnndo_ocr_single_class_cnnDoOcrSingleClassCnnDoOcrSingleClassCnndo_ocr_single_class_cnn, since do_ocr_multi_class_cnndo_ocr_multi_class_cnnDoOcrMultiClassCnnDoOcrMultiClassCnndo_ocr_multi_class_cnn is
typically faster than a loop with do_ocr_single_class_cnndo_ocr_single_class_cnnDoOcrSingleClassCnnDoOcrSingleClassCnndo_ocr_single_class_cnn.
Furthermore, the resulting confidences can be interpreted as
probabilities. They indicate the uncertainty of a character's classification
result. The operator do_ocr_single_class_cnndo_ocr_single_class_cnnDoOcrSingleClassCnnDoOcrSingleClassCnndo_ocr_single_class_cnn has to be used if the
nth-best class has to be examined explicitly for n greater than one.
A string of the number
(alternatively
displayed as ) in
ClassClassClassclassValclass signifies that the region has been classified as rejection
class.
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
CharacterCharacterCharactercharactercharacter (input_object) region →objectHRegionHObjectHObjectHobject
read_image(Image, 'bottle2')
OffsetRow := 100
OffsetCol := 108
read_ocr_class_cnn('Universal_0-9_NoRej.occ', OCRHandle)
* Select each digit and use do_ocr_single_class_cnn to apply OCR
gen_rectangle1(ROI_Date, OffsetRow, OffsetCol, OffsetRow, OffsetCol)
for I := 1 to 6 by 1
Offset := I % 2 * 10
smallest_rectangle1(ROI_Date, Row1, Col1, Row2, Col2)
gen_rectangle1(ROI_Date, OffsetRow, Offset + Col2, OffsetRow + 42, \
Col2 + Offset + 31)
do_ocr_single_class_cnn(ROI_Date, Image, OCRHandle, 1, Class, Confidence)
endfor
Result
If the parameters are valid, the operator
do_ocr_single_class_cnndo_ocr_single_class_cnnDoOcrSingleClassCnnDoOcrSingleClassCnndo_ocr_single_class_cnn returns the value 2 (
H_MSG_TRUE)
. If
necessary, an exception is raised.