Wednesday, May 23, 2018

tesseract api with load_system_dawg and load_freq_dawg

Leave a Comment

How to set load_system_dawg and load_freq_dawg to false ??

I need to disable the dictionary.. So I guess these are the two parameteres I need to set to false?

tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI(); if(api->Init(NULL, "dan+eng")){     // error } api->SetImage(image); api->Recognize(0); 

tesseract 3.05.01

1 Answers

Answers 1

  1. In your tessdata directory create a configs directory
  2. Create a file config (you will pass name of config file later in code)
  3. Fill your config file with following text
load_system_dawg     F     load_freq_dawg       F 
  1. Modify your code

    auto     numOfConfigs = 1; auto     **configs    = new char *[numOfConfigs]; configs[i] = (char *) "name of your config file";  tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI(); if(api->Init(NULL, "dan+eng", tesseract::OEM_DEFAULT, configs, numOfConfigs, nullptr, nullptr, false)){     // error } 

P.S. It is also possible to do with last couple of arguments of Init function, feel free to try them out yourself.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment