Name
do_ocr_singleT_do_ocr_singleDoOcrSingledo_ocr_singleDoOcrSingleDoOcrSingle — Classify one character.
The operator do_ocr_singledo_ocr_singleDoOcrSingledo_ocr_singleDoOcrSingleDoOcrSingle assigns classes to the
CharacterCharacterCharacterCharacterCharactercharacter (characters).
For gray value features gray values of the surrounding rectangles of the
regions will be used. The gray values will be taken from the
parameter ImageImageImageImageImageimage. For each character the two classes
with the highest confidencenses will be returned in
ClassesClassesClassesClassesClassesclasses. The corresponding confidences will be
returned in ConfidencesConfidencesConfidencesConfidencesConfidencesconfidences. 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).
- Processed without parallelization.
Character to be recognized.
Gray values of the characters.
ID of the OCR classifier.
Classes (names) of the characters.
Number of elements: 2
Confidence values of the characters.
Number of elements: 2
HTuple Classes,Confidences;
Hlong orc_handle;
HTuple OcrHandle;
read_ocr("testnet",&orc_handle);
create_tuple(&OcrHandle,1);
set_i(OcrHandle,orc_handle,0);
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);
T_do_ocr_single(SingleCharacter,Image,
OcrHandle,&Classes,&Confidences);
printf("best = %s (%g)\n",
get_s(Classes,0),get_d(Confidences,0));
printf("second = %s (%g)\n\n",
get_s(Classes,1),get_d(Confidences,1));
}
If the input parameters are correct, the operator
do_ocr_singledo_ocr_singleDoOcrSingledo_ocr_singleDoOcrSingleDoOcrSingle returns the value 2 (H_MSG_TRUE).
Otherwise an exception will be raised.
traind_ocr_class_boxtraind_ocr_class_boxTraindOcrClassBoxtraind_ocr_class_boxTraindOcrClassBoxTraindOcrClassBox,
trainf_ocr_class_boxtrainf_ocr_class_boxTrainfOcrClassBoxtrainf_ocr_class_boxTrainfOcrClassBoxTrainfOcrClassBox,
read_ocrread_ocrReadOcrread_ocrReadOcrReadOcr,
connectionconnectionConnectionconnectionConnectionConnection,
sort_regionsort_regionSortRegionsort_regionSortRegionSortRegion
do_ocr_multido_ocr_multiDoOcrMultido_ocr_multiDoOcrMultiDoOcrMulti
write_ocrwrite_ocrWriteOcrwrite_ocrWriteOcrWriteOcr
OCR/OCV