do_ocr_multi_class_knnT_do_ocr_multi_class_knnDoOcrMultiClassKnnDoOcrMultiClassKnn (Operator)

Name

do_ocr_multi_class_knnT_do_ocr_multi_class_knnDoOcrMultiClassKnnDoOcrMultiClassKnn — Classify multiple characters with an k-NN classifier.

Signature

do_ocr_multi_class_knn(Character, Image : : OCRHandle : Class, Confidence)

Herror T_do_ocr_multi_class_knn(const Hobject Character, const Hobject Image, const Htuple OCRHandle, Htuple* Class, Htuple* Confidence)

void DoOcrMultiClassKnn(const HObject& Character, const HObject& Image, const HTuple& OCRHandle, HTuple* Class, HTuple* Confidence)

HTuple HRegion::DoOcrMultiClassKnn(const HImage& Image, const HOCRKnn& OCRHandle, HTuple* Confidence) const

HString HRegion::DoOcrMultiClassKnn(const HImage& Image, const HOCRKnn& OCRHandle, double* Confidence) const

HTuple HOCRKnn::DoOcrMultiClassKnn(const HRegion& Character, const HImage& Image, HTuple* Confidence) const

HString HOCRKnn::DoOcrMultiClassKnn(const HRegion& Character, const HImage& Image, double* Confidence) const

static void HOperatorSet.DoOcrMultiClassKnn(HObject character, HObject image, HTuple OCRHandle, out HTuple classVal, out HTuple confidence)

HTuple HRegion.DoOcrMultiClassKnn(HImage image, HOCRKnn OCRHandle, out HTuple confidence)

string HRegion.DoOcrMultiClassKnn(HImage image, HOCRKnn OCRHandle, out double confidence)

HTuple HOCRKnn.DoOcrMultiClassKnn(HRegion character, HImage image, out HTuple confidence)

string HOCRKnn.DoOcrMultiClassKnn(HRegion character, HImage image, out double confidence)

Description

do_ocr_multi_class_knndo_ocr_multi_class_knnDoOcrMultiClassKnnDoOcrMultiClassKnnDoOcrMultiClassKnn computes the best class for each of the characters given by the regions CharacterCharacterCharacterCharactercharacter and the gray values ImageImageImageImageimage with the k-NN classifier OCRHandleOCRHandleOCRHandleOCRHandleOCRHandle and returns the classes in ClassClassClassClassclassVal and the corresponding confidence of the classes in ConfidenceConfidenceConfidenceConfidenceconfidence. The confidences lie between 0.0 and 1.0. The larger the value, the more reliable is the classification of the single characters. In contrast to do_ocr_single_class_knndo_ocr_single_class_knnDoOcrSingleClassKnnDoOcrSingleClassKnnDoOcrSingleClassKnn, do_ocr_multi_class_knndo_ocr_multi_class_knnDoOcrMultiClassKnnDoOcrMultiClassKnnDoOcrMultiClassKnn can classify multiple characters in one call, and therefore typically is faster than a loop that uses do_ocr_single_class_knndo_ocr_single_class_knnDoOcrSingleClassKnnDoOcrSingleClassKnnDoOcrSingleClassKnn to classify single characters. However, do_ocr_multi_class_knndo_ocr_multi_class_knnDoOcrMultiClassKnnDoOcrMultiClassKnnDoOcrMultiClassKnn can only return the best class of each character.

Before calling do_ocr_multi_class_knndo_ocr_multi_class_knnDoOcrMultiClassKnnDoOcrMultiClassKnnDoOcrMultiClassKnn, the classifier must be trained with trainf_ocr_class_knntrainf_ocr_class_knnTrainfOcrClassKnnTrainfOcrClassKnnTrainfOcrClassKnn.

Execution Information

Parameters

CharacterCharacterCharacterCharactercharacter (input_object)  region(-array) objectHRegionHRegionHobject

Characters to be recognized.

ImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHobject (byte / uint2)

Gray values of the characters.

OCRHandleOCRHandleOCRHandleOCRHandleOCRHandle (input_control)  ocr_knn HOCRKnn, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the k-NN classifier.

ClassClassClassClassclassVal (output_control)  string(-array) HTupleHTupleHtuple (string) (string) (HString) (char*)

Result of classifying the characters with the k-NN.

Number of elements: Class == Character

ConfidenceConfidenceConfidenceConfidenceconfidence (output_control)  real(-array) HTupleHTupleHtuple (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_knndo_ocr_multi_class_knnDoOcrMultiClassKnnDoOcrMultiClassKnnDoOcrMultiClassKnn returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Possible Predecessors

trainf_ocr_class_knntrainf_ocr_class_knnTrainfOcrClassKnnTrainfOcrClassKnnTrainfOcrClassKnn, read_ocr_class_knnread_ocr_class_knnReadOcrClassKnnReadOcrClassKnnReadOcrClassKnn

Alternatives

do_ocr_single_class_knndo_ocr_single_class_knnDoOcrSingleClassKnnDoOcrSingleClassKnnDoOcrSingleClassKnn

See also

create_ocr_class_knncreate_ocr_class_knnCreateOcrClassKnnCreateOcrClassKnnCreateOcrClassKnn, classify_class_knnclassify_class_knnClassifyClassKnnClassifyClassKnnClassifyClassKnn

Module

OCR/OCV