Name
do_ocr_multiT_do_ocr_multiDoOcrMultiDoOcrMulti — Classify characters.
Warning
do_ocr_multido_ocr_multiDoOcrMultiDoOcrMultiDoOcrMulti is obsolete and is only provided for
reasons of backward compatibility. New applications should use the
MLP, SVM or CNN based operators instead.
void DoOcrMulti(const HObject& Character, const HObject& Image, const HTuple& OcrHandle, HTuple* Class, HTuple* Confidence)
HTuple HRegion::DoOcrMulti(const HImage& Image, const HOCRBox& OcrHandle, HTuple* Confidence) const
HString HRegion::DoOcrMulti(const HImage& Image, const HOCRBox& OcrHandle, double* Confidence) const
HTuple HOCRBox::DoOcrMulti(const HRegion& Character, const HImage& Image, HTuple* Confidence) const
HString HOCRBox::DoOcrMulti(const HRegion& Character, const HImage& Image, double* Confidence) const
static void HOperatorSet.DoOcrMulti(HObject character, HObject image, HTuple ocrHandle, out HTuple classVal, out HTuple confidence)
HTuple HRegion.DoOcrMulti(HImage image, HOCRBox ocrHandle, out HTuple confidence)
string HRegion.DoOcrMulti(HImage image, HOCRBox ocrHandle, out double confidence)
HTuple HOCRBox.DoOcrMulti(HRegion character, HImage image, out HTuple confidence)
string HOCRBox.DoOcrMulti(HRegion character, HImage image, out double confidence)
The operator do_ocr_multido_ocr_multiDoOcrMultiDoOcrMultiDoOcrMulti assigns a class to every
CharacterCharacterCharacterCharactercharacter (character).
For gray value features the gray values from the surrounding rectangles
of the regions are used. The gray values will be taken from the parameter
ImageImageImageImageimage. For each character the corresponding class will be
returned in ClassClassClassClassclassVal and a confidence value will be
returned in ConfidenceConfidenceConfidenceConfidenceconfidence. The confidence value indicates the
similarity between the input pattern and the assigned character.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.
Characters to be recognized.
Gray values for the characters.
ID of the OCR classifier.
Class (name) of the characters.
Number of elements: Class == Character
Confidence values of the characters.
Number of elements: Confidence == Character
char Class[128];
Hlong orc_handle;
read_ocr("testnet",&orc_handle);
read_image(&Image,"character.tiff");
binary_threshold(Image,&Dark, 'otsu', 'dark', &UsedThreshold);
connection(Dark,&Character);
count_obj(Character,&num);
open_window(0,0,-1,-1,0,"","",&WindowHandle);
for (i=0; i<num; i++) {
select_obj(Character,&SingleCharacter,i);
do_ocr_multi(SingleCharacter,Image,orc_handle,&Class,NULL);
smallest_rectangle1(SingleCharacter,NULL,&col,&row,);
set_tposition(row,col);
write_string(WindowHandle,Class);
}
If the input parameters are correct, the operator
do_ocr_singledo_ocr_singleDoOcrSingleDoOcrSingleDoOcrSingle returns the value 2 (H_MSG_TRUE).
Otherwise an exception will be raised.
traind_ocr_class_boxtraind_ocr_class_boxTraindOcrClassBoxTraindOcrClassBoxTraindOcrClassBox,
trainf_ocr_class_boxtrainf_ocr_class_boxTrainfOcrClassBoxTrainfOcrClassBoxTrainfOcrClassBox,
read_ocrread_ocrReadOcrReadOcrReadOcr,
connectionconnectionConnectionConnectionConnection,
sort_regionsort_regionSortRegionSortRegionSortRegion
do_ocr_singledo_ocr_singleDoOcrSingleDoOcrSingleDoOcrSingle
write_ocrwrite_ocrWriteOcrWriteOcrWriteOcr
OCR/OCV