do_ocr_multi_class_knnT_do_ocr_multi_class_knnDoOcrMultiClassKnnDoOcrMultiClassKnndo_ocr_multi_class_knn (Operator)
Name
do_ocr_multi_class_knnT_do_ocr_multi_class_knnDoOcrMultiClassKnnDoOcrMultiClassKnndo_ocr_multi_class_knn
— Classify multiple characters with an k-NN classifier.
Signature
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_knnDoOcrMultiClassKnnDoOcrMultiClassKnnDoOcrMultiClassKnndo_ocr_multi_class_knn
computes the best class for each of
the characters given by the regions CharacterCharacterCharacterCharactercharactercharacter
and the gray
values ImageImageImageImageimageimage
with the k-NN classifier OCRHandleOCRHandleOCRHandleOCRHandleOCRHandleocrhandle
and
returns the classes in ClassClassClassClassclassValclass
and the corresponding
confidence of the classes in ConfidenceConfidenceConfidenceConfidenceconfidenceconfidence
.
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_knnDoOcrSingleClassKnnDoOcrSingleClassKnnDoOcrSingleClassKnndo_ocr_single_class_knn
,
do_ocr_multi_class_knndo_ocr_multi_class_knnDoOcrMultiClassKnnDoOcrMultiClassKnnDoOcrMultiClassKnndo_ocr_multi_class_knn
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_knnDoOcrSingleClassKnnDoOcrSingleClassKnnDoOcrSingleClassKnndo_ocr_single_class_knn
to classify single characters.
However, do_ocr_multi_class_knndo_ocr_multi_class_knnDoOcrMultiClassKnnDoOcrMultiClassKnnDoOcrMultiClassKnndo_ocr_multi_class_knn
can only return the best
class of each character.
Before calling do_ocr_multi_class_knndo_ocr_multi_class_knnDoOcrMultiClassKnnDoOcrMultiClassKnnDoOcrMultiClassKnndo_ocr_multi_class_knn
, the classifier must be
trained with trainf_ocr_class_knntrainf_ocr_class_knnTrainfOcrClassKnnTrainfOcrClassKnnTrainfOcrClassKnntrainf_ocr_class_knn
.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.
Parameters
CharacterCharacterCharacterCharactercharactercharacter
(input_object) region(-array) →
objectHRegionHObjectHRegionHobject
Characters to be recognized.
ImageImageImageImageimageimage
(input_object) singlechannelimage →
objectHImageHObjectHImageHobject (byte / uint2)
Gray values of the characters.
OCRHandleOCRHandleOCRHandleOCRHandleOCRHandleocrhandle
(input_control) ocr_knn →
HOCRKnn, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the k-NN classifier.
ClassClassClassClassclassValclass
(output_control) string(-array) →
HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Result of classifying the characters with the
k-NN.
Number of elements:
Class == Character
ConfidenceConfidenceConfidenceConfidenceconfidenceconfidence
(output_control) real(-array) →
HTupleSequence[float]HTupleHtuple (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_knnDoOcrMultiClassKnnDoOcrMultiClassKnnDoOcrMultiClassKnndo_ocr_multi_class_knn
returns the value 2 (
H_MSG_TRUE)
. If
necessary, an exception is raised.
Possible Predecessors
trainf_ocr_class_knntrainf_ocr_class_knnTrainfOcrClassKnnTrainfOcrClassKnnTrainfOcrClassKnntrainf_ocr_class_knn
,
read_ocr_class_knnread_ocr_class_knnReadOcrClassKnnReadOcrClassKnnReadOcrClassKnnread_ocr_class_knn
Alternatives
do_ocr_single_class_knndo_ocr_single_class_knnDoOcrSingleClassKnnDoOcrSingleClassKnnDoOcrSingleClassKnndo_ocr_single_class_knn
See also
create_ocr_class_knncreate_ocr_class_knnCreateOcrClassKnnCreateOcrClassKnnCreateOcrClassKnncreate_ocr_class_knn
,
classify_class_knnclassify_class_knnClassifyClassKnnClassifyClassKnnClassifyClassKnnclassify_class_knn
Module
OCR/OCV