If you are using tesseract 4 then whitelists/blacklists do not yet work (at least not in LSTM mode). I also get the impression that the 'Control Parameters' list you obtain by typing 'tesseract --print-parameters'on the command line is not updated to the supported functionality in tesseract 4. My advice would by to test a particular variable on command line tesseract to determine if it is supported before trying to set it via an API.
The whitelists/blacklists are supposed to be supported in Tesseract 4 in Tesseract mode I believe, but I haven't managed to get these working at all. Please let me know how you get on. Thanks James yping On Friday, January 26, 2018 at 7:35:37 PM UTC, 朱裕清 wrote: > > This is my image > > > <https://lh3.googleusercontent.com/-7l8wq8oybP4/WmuBhKbYe6I/AAAAAAAAAQQ/B2dbuxEf_zcDM2LdZH3z9hUEzvmtUOTpwCLcBGAs/s1600/danger_module.png> > > > And this is my code > > #include <tesseract/baseapi.h> > #include <leptonica/allheaders.h> > > > int main() > { > tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI(); > api->Init(".\\tessdata", "eng"); > Pix *image = pixRead("image.png"); > api->SetImage(image); > api->SetPageSegMode(tesseract::PSM_SINGLE_CHAR); > > api->SetSourceResolution(300); > api->SetVariable("classify_bln_numeric_mode", "1"); > //api->SetVariable("tessedit_char_whitelist", "0123456789"); > api->SetRectangle(61, 4, 38, 22); > char *outText = api->GetUTF8Text(); > cout << outText << endl; > api->End(); > > > return 0; > } > > > I will get a character *A*. Why my *SetVariable("classify_bln_numeric_mode", > "1");* don't work normally? And even I use > *SetVariable("tessedit_char_whitelist", > "0123456789");*. The result is same still. How to read a digit from a > specify rectangle? > -- You received this message because you are subscribed to the Google Groups "tesseract-ocr" group. To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-ocr+unsubscr...@googlegroups.com. To post to this group, send email to tesseract-ocr@googlegroups.com. Visit this group at https://groups.google.com/group/tesseract-ocr. To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/761a8f8e-478b-4a30-a988-64d53f61c25b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.