#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;
}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.ThanksJames
yping
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: