OCRHMM with limitated vocabulary
Hi to everyone i'm trying to use the OCRHMMDecoder on a video in order to recognize a char. I've take this code from the examples in the installation folder of opencv
string vocabulary = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
Ptr<OCRHMMDecoder::ClassifierCallback> ocr = loadOCRHMMClassifierCNN("/home/fed27/opencv_contrib/modules/text/samples/OCRBeamSearch_CNN_model_data.xml.gz");
ocr->eval(mask, out_classes, out_confidences);
output=vocabulary[out_classes[i]];
string s = QString::fromStdString(output) ;
qWarning() << " OCR_Tesseract output "<< s ;
it works well but i need the vocabulary limited to few char in order to have more possibilities to guess the right one. If i try to reduce the vocabulary string it gives an error.
thanks you.
Well that is probably because the model you load is expecting that vocabulary string. Isn't it possible to break open the eval function and hard limit the vocabulary there?
i'm working on this now