Skip to content

do_ocr_multi_class_cnnDoOcrMultiClassCnnDoOcrMultiClassCnndo_ocr_multi_class_cnnT_do_ocr_multi_class_cnn🔗

Short description🔗

do_ocr_multi_class_cnnDoOcrMultiClassCnnDoOcrMultiClassCnndo_ocr_multi_class_cnnT_do_ocr_multi_class_cnn — Classify multiple characters with an CNN-based OCR classifier.

Signature🔗

do_ocr_multi_class_cnn( region Character, image Image, ocr_cnn OCRHandle, out string Class, out real Confidence )void DoOcrMultiClassCnn( const HObject& Character, const HObject& Image, const HTuple& OCRHandle, HTuple* Class, HTuple* Confidence )static void HOperatorSet.DoOcrMultiClassCnn( HObject character, HObject image, HTuple OCRHandle, out HTuple classVal, out HTuple confidence )def do_ocr_multi_class_cnn( character: HObject, image: HObject, ocrhandle: HHandle ) -> Tuple[Sequence[str], Sequence[float]]

def do_ocr_multi_class_cnn_s( character: HObject, image: HObject, ocrhandle: HHandle ) -> Tuple[str, float]Herror T_do_ocr_multi_class_cnn( const Hobject Character, const Hobject Image, const Htuple OCRHandle, Htuple* Class, Htuple* Confidence )

HTuple HRegion::DoOcrMultiClassCnn( const HImage& Image, const HOCRCnn& OCRHandle, HTuple* Confidence ) const

HString HRegion::DoOcrMultiClassCnn( const HImage& Image, const HOCRCnn& OCRHandle, double* Confidence ) const

HTuple HOCRCnn::DoOcrMultiClassCnn( const HRegion& Character, const HImage& Image, HTuple* Confidence ) const

HString HOCRCnn::DoOcrMultiClassCnn( const HRegion& Character, const HImage& Image, double* Confidence ) const

HTuple HRegion.DoOcrMultiClassCnn( HImage image, HOCRCnn OCRHandle, out HTuple confidence )

string HRegion.DoOcrMultiClassCnn( HImage image, HOCRCnn OCRHandle, out double confidence )

HTuple HOCRCnn.DoOcrMultiClassCnn( HRegion character, HImage image, out HTuple confidence )

string HOCRCnn.DoOcrMultiClassCnn( HRegion character, HImage image, out double confidence )

Description🔗

do_ocr_multi_class_cnnDoOcrMultiClassCnn computes the best class for each of the characters given by the regions 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.

In contrast to do_ocr_single_class_cnnDoOcrSingleClassCnn, do_ocr_multi_class_cnnDoOcrMultiClassCnn can classify multiple characters in one call, and therefore typically is faster than a loop that uses do_ocr_single_class_cnnDoOcrSingleClassCnn to classify single characters. However, do_ocr_multi_class_cnnDoOcrMultiClassCnn can only return the best class of each character. Because the confidences can be interpreted as probabilities, it is easier 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_cnnDoOcrSingleClassCnn should be used.

A string of the number \('\backslash 032'\) (alternatively displayed as \('\backslash 0x1A'\)) in ClassclassValclass signifies that the region has been classified as rejection class.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on internal data level.

Parameters🔗

Charactercharactercharacter (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Characters 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 characters.

OCRHandleOCRHandleocrhandle (input_control) ocr_cnn → (handle)HTuple (HHandle)HOCRCnn, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the OCR classifier.

ClassclassValclass (output_control) string(-array) → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

Result of classifying the characters with the CNN.

Number of elements: Class == Character

Confidenceconfidenceconfidence (output_control) real(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (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_cnnDoOcrMultiClassCnn returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

read_ocr_class_cnnReadOcrClassCnn

Alternatives

do_ocr_word_cnnDoOcrWordCnn, do_ocr_single_class_cnnDoOcrSingleClassCnn

Module🔗

OCR/OCV