do_ocr_single_class_mlp T_do_ocr_single_class_mlp DoOcrSingleClassMlp DoOcrSingleClassMlp do_ocr_single_class_mlp (Operator)
Name
do_ocr_single_class_mlp T_do_ocr_single_class_mlp DoOcrSingleClassMlp DoOcrSingleClassMlp do_ocr_single_class_mlp
— 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 )
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]
Description
do_ocr_single_class_mlp do_ocr_single_class_mlp DoOcrSingleClassMlp DoOcrSingleClassMlp do_ocr_single_class_mlp
computes the best Num Num Num num num
classes of the character given by the region Character Character Character character character
and
the gray values Image Image Image image image
with the OCR classifier
OCRHandle OCRHandle OCRHandle OCRHandle ocrhandle
and returns the classes in Class Class Class classVal class
and the
corresponding confidences (probabilities) of the classes in
Confidence Confidence Confidence confidence confidence
. Because multiple classes may be returned by
do_ocr_single_class_mlp do_ocr_single_class_mlp DoOcrSingleClassMlp DoOcrSingleClassMlp do_ocr_single_class_mlp
, Character Character Character character character
may only contain
a single region (a single character). If multiple characters should
be classified in a single call, do_ocr_multi_class_mlp do_ocr_multi_class_mlp DoOcrMultiClassMlp DoOcrMultiClassMlp do_ocr_multi_class_mlp
must
be used. Because do_ocr_multi_class_mlp do_ocr_multi_class_mlp DoOcrMultiClassMlp DoOcrMultiClassMlp do_ocr_multi_class_mlp
typically is faster
than a loop with do_ocr_single_class_mlp do_ocr_single_class_mlp DoOcrSingleClassMlp DoOcrSingleClassMlp do_ocr_single_class_mlp
and because the
confidences can be interpreted as probabilities (see
classify_class_mlp classify_class_mlp ClassifyClassMlp ClassifyClassMlp classify_class_mlp
and evaluate_class_mlp evaluate_class_mlp EvaluateClassMlp EvaluateClassMlp evaluate_class_mlp
), and it
is therefore easy to check whether a character has been classified
with too much uncertainty, in most cases
do_ocr_multi_class_mlp do_ocr_multi_class_mlp DoOcrMultiClassMlp DoOcrMultiClassMlp do_ocr_multi_class_mlp
should be used, unless the
second-best class should be examined explicitly.
A string of the number
(alternatively
displayed as
) in
Class Class Class classVal class
signifies that the region has been classified as rejection
class.
Before calling do_ocr_single_class_mlp do_ocr_single_class_mlp DoOcrSingleClassMlp DoOcrSingleClassMlp do_ocr_single_class_mlp
, the classifier must be
trained with trainf_ocr_class_mlp trainf_ocr_class_mlp TrainfOcrClassMlp TrainfOcrClassMlp trainf_ocr_class_mlp
.
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 Character Character character character
(input_object) region →
object HRegion HObject HObject Hobject
Character to be recognized.
Image Image Image image image
(input_object) singlechannelimage →
object HImage HObject HObject Hobject (byte / uint2)
Gray values of the character.
OCRHandle OCRHandle OCRHandle OCRHandle ocrhandle
(input_control) ocr_mlp →
HOCRMlp , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Handle of the OCR classifier.
Num Num Num num num
(input_control) integer-array →
HTuple Sequence[int] HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Number of best classes to determine.
Default:
1
Suggested values:
1, 2, 3, 4, 5
Class Class Class classVal class
(output_control) string(-array) →
HTuple Sequence[str] HTuple Htuple (string) (string ) (HString ) (char* )
Result of classifying the character with the
MLP.
Confidence Confidence Confidence confidence confidence
(output_control) real(-array) →
HTuple Sequence[float] HTuple Htuple (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_mlp do_ocr_single_class_mlp DoOcrSingleClassMlp DoOcrSingleClassMlp do_ocr_single_class_mlp
returns the value 2 (
H_MSG_TRUE )
. If
necessary, an exception is raised.
Possible Predecessors
trainf_ocr_class_mlp trainf_ocr_class_mlp TrainfOcrClassMlp TrainfOcrClassMlp trainf_ocr_class_mlp
,
read_ocr_class_mlp read_ocr_class_mlp ReadOcrClassMlp ReadOcrClassMlp read_ocr_class_mlp
Alternatives
do_ocr_multi_class_mlp do_ocr_multi_class_mlp DoOcrMultiClassMlp DoOcrMultiClassMlp do_ocr_multi_class_mlp
See also
create_ocr_class_mlp create_ocr_class_mlp CreateOcrClassMlp CreateOcrClassMlp create_ocr_class_mlp
,
classify_class_mlp classify_class_mlp ClassifyClassMlp ClassifyClassMlp classify_class_mlp
Module
OCR/OCV