do_ocr_multi_class_mlpT_do_ocr_multi_class_mlpDoOcrMultiClassMlpDoOcrMultiClassMlpdo_ocr_multi_class_mlp (Operator)
Name
do_ocr_multi_class_mlpT_do_ocr_multi_class_mlpDoOcrMultiClassMlpDoOcrMultiClassMlpdo_ocr_multi_class_mlp
— Classify multiple characters with an OCR classifier.
Signature
void DoOcrMultiClassMlp(const HObject& Character, const HObject& Image, const HTuple& OCRHandle, HTuple* Class, HTuple* Confidence)
HTuple HRegion::DoOcrMultiClassMlp(const HImage& Image, const HOCRMlp& OCRHandle, HTuple* Confidence) const
HString HRegion::DoOcrMultiClassMlp(const HImage& Image, const HOCRMlp& OCRHandle, double* Confidence) const
HTuple HOCRMlp::DoOcrMultiClassMlp(const HRegion& Character, const HImage& Image, HTuple* Confidence) const
HString HOCRMlp::DoOcrMultiClassMlp(const HRegion& Character, const HImage& Image, double* Confidence) const
static void HOperatorSet.DoOcrMultiClassMlp(HObject character, HObject image, HTuple OCRHandle, out HTuple classVal, out HTuple confidence)
HTuple HRegion.DoOcrMultiClassMlp(HImage image, HOCRMlp OCRHandle, out HTuple confidence)
string HRegion.DoOcrMultiClassMlp(HImage image, HOCRMlp OCRHandle, out double confidence)
HTuple HOCRMlp.DoOcrMultiClassMlp(HRegion character, HImage image, out HTuple confidence)
string HOCRMlp.DoOcrMultiClassMlp(HRegion character, HImage image, out double confidence)
Description
do_ocr_multi_class_mlpdo_ocr_multi_class_mlpDoOcrMultiClassMlpDoOcrMultiClassMlpDoOcrMultiClassMlpdo_ocr_multi_class_mlp
computes the best class for each of
the characters given by the regions CharacterCharacterCharacterCharactercharactercharacter
and the gray
values ImageImageImageImageimageimage
with the OCR classifier OCRHandleOCRHandleOCRHandleOCRHandleOCRHandleocrhandle
and
returns the classes in ClassClassClassClassclassValclass
and the corresponding
confidences (probabilities) of the classes in ConfidenceConfidenceConfidenceConfidenceconfidenceconfidence
.
In contrast to do_ocr_single_class_mlpdo_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlpDoOcrSingleClassMlpdo_ocr_single_class_mlp
,
do_ocr_multi_class_mlpdo_ocr_multi_class_mlpDoOcrMultiClassMlpDoOcrMultiClassMlpDoOcrMultiClassMlpdo_ocr_multi_class_mlp
can classify multiple characters in
one call, and therefore typically is faster than a loop that uses
do_ocr_single_class_mlpdo_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlpDoOcrSingleClassMlpdo_ocr_single_class_mlp
to classify single characters.
However, do_ocr_multi_class_mlpdo_ocr_multi_class_mlpDoOcrMultiClassMlpDoOcrMultiClassMlpDoOcrMultiClassMlpdo_ocr_multi_class_mlp
can only return the best
class of each character. Because the confidences can be interpreted
as probabilities (see classify_class_mlpclassify_class_mlpClassifyClassMlpClassifyClassMlpClassifyClassMlpclassify_class_mlp
and
evaluate_class_mlpevaluate_class_mlpEvaluateClassMlpEvaluateClassMlpEvaluateClassMlpevaluate_class_mlp
), and it is therefore easy to check
whether a character has been classified with too much uncertainty,
this is usually not a disadvantage, except in cases where the
classes overlap so much that in many cases the second best class
must be examined to be able to decide the class of the character.
In these cases, do_ocr_single_class_mlpdo_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlpDoOcrSingleClassMlpdo_ocr_single_class_mlp
should be used.
A string of the number
'\032'"\032""\032""\032""\032""\032" (alternatively
displayed as '\0x1A'"\0x1A""\0x1A""\0x1A""\0x1A""\0x1A") in
ClassClassClassClassclassValclass
signifies that the region has been classified as rejection
class.
Before calling do_ocr_multi_class_mlpdo_ocr_multi_class_mlpDoOcrMultiClassMlpDoOcrMultiClassMlpDoOcrMultiClassMlpdo_ocr_multi_class_mlp
, the classifier must be
trained with trainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlpTrainfOcrClassMlptrainf_ocr_class_mlp
.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.
Parameters
CharacterCharacterCharacterCharactercharactercharacter
(input_object) region(-array) →
objectHRegionHObjectHRegionHobject
Characters to be recognized.
ImageImageImageImageimageimage
(input_object) singlechannelimage →
objectHImageHObjectHImageHobject (byte / uint2)
Gray values of the characters.
OCRHandleOCRHandleOCRHandleOCRHandleOCRHandleocrhandle
(input_control) ocr_mlp →
HOCRMlp, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the OCR classifier.
ClassClassClassClassclassValclass
(output_control) string(-array) →
HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Result of classifying the characters with the
MLP.
Number of elements: Class == Character
ConfidenceConfidenceConfidenceConfidenceconfidenceconfidence
(output_control) real(-array) →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Confidence of the class of the characters.
Number of elements: Confidence == Character
Result
If the parameters are valid, the operator
do_ocr_multi_class_mlpdo_ocr_multi_class_mlpDoOcrMultiClassMlpDoOcrMultiClassMlpDoOcrMultiClassMlpdo_ocr_multi_class_mlp
returns the value 2 (H_MSG_TRUE). If
necessary, an exception is raised.
Possible Predecessors
trainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlpTrainfOcrClassMlptrainf_ocr_class_mlp
,
read_ocr_class_mlpread_ocr_class_mlpReadOcrClassMlpReadOcrClassMlpReadOcrClassMlpread_ocr_class_mlp
Alternatives
do_ocr_word_mlpdo_ocr_word_mlpDoOcrWordMlpDoOcrWordMlpDoOcrWordMlpdo_ocr_word_mlp
,
do_ocr_single_class_mlpdo_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlpDoOcrSingleClassMlpdo_ocr_single_class_mlp
See also
create_ocr_class_mlpcreate_ocr_class_mlpCreateOcrClassMlpCreateOcrClassMlpCreateOcrClassMlpcreate_ocr_class_mlp
,
classify_class_mlpclassify_class_mlpClassifyClassMlpClassifyClassMlpClassifyClassMlpclassify_class_mlp
Module
OCR/OCV