do_ocr_single_class_mlpT_do_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlp (Operator)
Name
do_ocr_single_class_mlpT_do_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlp
— Classify a single character with an OCR classifier.
Signature
void DoOcrSingleClassMlp(const HObject& Character, const HObject& Image, const HTuple& OCRHandle, const HTuple& Num, HTuple* Class, HTuple* Confidence)
HTuple HRegion::DoOcrSingleClassMlp(const HImage& Image, const HOCRMlp& OCRHandle, const HTuple& Num, HTuple* Confidence) const
HString HRegion::DoOcrSingleClassMlp(const HImage& Image, const HOCRMlp& OCRHandle, const HTuple& Num, double* Confidence) const
HTuple HOCRMlp::DoOcrSingleClassMlp(const HRegion& Character, const HImage& Image, const HTuple& Num, HTuple* Confidence) const
HString HOCRMlp::DoOcrSingleClassMlp(const HRegion& Character, const HImage& Image, const HTuple& Num, double* Confidence) const
static void HOperatorSet.DoOcrSingleClassMlp(HObject character, HObject image, HTuple OCRHandle, HTuple num, out HTuple classVal, out HTuple confidence)
HTuple HRegion.DoOcrSingleClassMlp(HImage image, HOCRMlp OCRHandle, HTuple num, out HTuple confidence)
string HRegion.DoOcrSingleClassMlp(HImage image, HOCRMlp OCRHandle, HTuple num, out double confidence)
HTuple HOCRMlp.DoOcrSingleClassMlp(HRegion character, HImage image, HTuple num, out HTuple confidence)
string HOCRMlp.DoOcrSingleClassMlp(HRegion character, HImage image, HTuple num, out double confidence)
Description
do_ocr_single_class_mlpdo_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlpDoOcrSingleClassMlp
computes the best NumNumNumNumnum
classes of the character given by the region CharacterCharacterCharacterCharactercharacter
and
the gray values ImageImageImageImageimage
with the OCR classifier
OCRHandleOCRHandleOCRHandleOCRHandleOCRHandle
and returns the classes in ClassClassClassClassclassVal
and the
corresponding confidences (probabilities) of the classes in
ConfidenceConfidenceConfidenceConfidenceconfidence
. Because multiple classes may be returned by
do_ocr_single_class_mlpdo_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlpDoOcrSingleClassMlp
, CharacterCharacterCharacterCharactercharacter
may only contain
a single region (a single character). If multiple characters should
be classified in a single call, do_ocr_multi_class_mlpdo_ocr_multi_class_mlpDoOcrMultiClassMlpDoOcrMultiClassMlpDoOcrMultiClassMlp
must
be used. Because do_ocr_multi_class_mlpdo_ocr_multi_class_mlpDoOcrMultiClassMlpDoOcrMultiClassMlpDoOcrMultiClassMlp
typically is faster
than a loop with do_ocr_single_class_mlpdo_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlpDoOcrSingleClassMlp
and because the
confidences can be interpreted as probabilities (see
classify_class_mlpclassify_class_mlpClassifyClassMlpClassifyClassMlpClassifyClassMlp
and evaluate_class_mlpevaluate_class_mlpEvaluateClassMlpEvaluateClassMlpEvaluateClassMlp
), and it
is therefore easy to check whether a character has been classified
with too much uncertainty, in most cases
do_ocr_multi_class_mlpdo_ocr_multi_class_mlpDoOcrMultiClassMlpDoOcrMultiClassMlpDoOcrMultiClassMlp
should be used, unless the
second-best class should be examined explicitly. The result
'\x1A'"\x1A""\x1A""\x1A""\x1A" in ClassClassClassClassclassVal
signifies
that the region has been classified as rejection class.
Before calling do_ocr_single_class_mlpdo_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlpDoOcrSingleClassMlp
, the classifier must be
trained with trainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlpTrainfOcrClassMlp
.
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 →
objectHRegionHRegionHobject
Character to be recognized.
ImageImageImageImageimage
(input_object) singlechannelimage →
objectHImageHImageHobject (byte / uint2)
Gray values of the character.
OCRHandleOCRHandleOCRHandleOCRHandleOCRHandle
(input_control) ocr_mlp →
HOCRMlp, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the OCR classifier.
NumNumNumNumnum
(input_control) integer-array →
HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Number of best classes to determine.
Default value: 1
Suggested values: 1, 2, 3, 4, 5
ClassClassClassClassclassVal
(output_control) string(-array) →
HTupleHTupleHtuple (string) (string) (HString) (char*)
Result of classifying the character with the
MLP.
ConfidenceConfidenceConfidenceConfidenceconfidence
(output_control) real(-array) →
HTupleHTupleHtuple (real) (double) (double) (double)
Confidence(s) of the class(es) of the character.
Result
If the parameters are valid, the operator
do_ocr_single_class_mlpdo_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlpDoOcrSingleClassMlp
returns the value 2 (H_MSG_TRUE). If
necessary, an exception is raised.
Possible Predecessors
trainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlpTrainfOcrClassMlp
,
read_ocr_class_mlpread_ocr_class_mlpReadOcrClassMlpReadOcrClassMlpReadOcrClassMlp
Alternatives
do_ocr_multi_class_mlpdo_ocr_multi_class_mlpDoOcrMultiClassMlpDoOcrMultiClassMlpDoOcrMultiClassMlp
See also
create_ocr_class_mlpcreate_ocr_class_mlpCreateOcrClassMlpCreateOcrClassMlpCreateOcrClassMlp
,
classify_class_mlpclassify_class_mlpClassifyClassMlpClassifyClassMlpClassifyClassMlp
Module
OCR/OCV