do_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlpdo_ocr_single_class_mlpT_do_ocr_single_class_mlp
Short description
do_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlpdo_ocr_single_class_mlpT_do_ocr_single_class_mlp — Classify a single character with an OCR classifier.
Signature
do_ocr_single_class_mlp( region Character, image Image, ocr_mlp OCRHandle, integer Num, out string Class, out real Confidence )void DoOcrSingleClassMlp( const HObject& Character, const HObject& Image, const HTuple& OCRHandle, const HTuple& Num, HTuple* Class, HTuple* Confidence )static void HOperatorSet.DoOcrSingleClassMlp( HObject character, HObject image, HTuple OCRHandle, HTuple num, out HTuple classVal, out HTuple confidence )def do_ocr_single_class_mlp( character: HObject, image: HObject, ocrhandle: HHandle, num: Sequence[int] ) -> Tuple[Sequence[str], Sequence[float]]
def do_ocr_single_class_mlp_s( character: HObject, image: HObject, ocrhandle: HHandle, num: Sequence[int] ) -> Tuple[str, float]Herror T_do_ocr_single_class_mlp( 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
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_mlpDoOcrSingleClassMlp computes the best Numnumnum
classes of the character given by the region Charactercharactercharacter and
the gray values Imageimageimage with the OCR classifier
OCRHandleOCRHandleocrhandle and returns the classes in ClassclassValclass and the
corresponding confidences (probabilities) of the classes in
Confidenceconfidenceconfidence. Because multiple classes may be returned by
do_ocr_single_class_mlpDoOcrSingleClassMlp, Charactercharactercharacter may only contain
a single region (a single character). If multiple characters should
be classified in a single call, do_ocr_multi_class_mlpDoOcrMultiClassMlp must
be used. Because do_ocr_multi_class_mlpDoOcrMultiClassMlp typically is faster
than a loop with do_ocr_single_class_mlpDoOcrSingleClassMlp and because the
confidences can be interpreted as probabilities (see
classify_class_mlpClassifyClassMlp and evaluate_class_mlpEvaluateClassMlp), and it
is therefore easy to check whether a character has been classified
with too much uncertainty, in most cases
do_ocr_multi_class_mlpDoOcrMultiClassMlp should be used, unless the
second-best class should be examined explicitly.
A string of the number
\('\backslash 032'\) (alternatively
displayed as \('\backslash 0x1A'\)) in
ClassclassValclass signifies that the region has been classified as rejection
class.
Before calling do_ocr_single_class_mlpDoOcrSingleClassMlp, the classifier must be
trained with trainf_ocr_class_mlpTrainfOcrClassMlp.
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
Charactercharactercharacter (input_object) region → objectHObjectHRegionHObjectHobject
Character to be recognized.
Imageimageimage (input_object) singlechannelimage → object (byte / uint2)HObject (byte / uint2)HImage (byte / uint2)HObject (byte / uint2)Hobject (byte / uint2)
Gray values of the character.
OCRHandleOCRHandleocrhandle (input_control) ocr_mlp → (handle)HTuple (HHandle)HOCRMlp, HTuple (IntPtr)HHandleHtuple (handle)
Handle of the OCR classifier.
Numnumnum (input_control) integer-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)
Number of best classes to determine.
Default: 11
Suggested values: 1, 2, 3, 4, 51, 2, 3, 4, 5
ClassclassValclass (output_control) string(-array) → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)
Result of classifying the character with the
MLP.
Confidenceconfidenceconfidence (output_control) real(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
Confidence(s) of the class(es) of the character.
Result
If the parameters are valid, the operator
do_ocr_single_class_mlpDoOcrSingleClassMlp returns the value 2 (H_MSG_TRUE). If
necessary, an exception is raised.
Combinations with other operators
Combinations
Possible predecessors
trainf_ocr_class_mlpTrainfOcrClassMlp, read_ocr_class_mlpReadOcrClassMlp
Alternatives
do_ocr_multi_class_mlpDoOcrMultiClassMlp
See also
create_ocr_class_mlpCreateOcrClassMlp, classify_class_mlpClassifyClassMlp
Module
OCR/OCV