0

I am using tesseract for recognizing character in one of my iOS project. It is now reading all characters including alpha numeric character. But I want to read only character a-z and numbers 0-9. I followed Limit characters tesseract is looking for, but can't figure out how can I implement this in my iOS app.

Can anyone suggest me how can I implement this in my iOS project.

Community
  • 1
  • 1
sumon
  • 742
  • 1
  • 11
  • 33

2 Answers2

7

You can specify the white list (allowed characters) using TessBaseAPI.SetVariable prior to extraction

 tesseract->SetVariable("tessedit_char_whitelist", "abcdefghijklmnopqrstuvwxyz012345789");
user18428
  • 1,216
  • 11
  • 17
  • the following code works for me: tesseract->SetVariable("tessedit_char_whitelist", "abcdefghijklmnopqrstuvwxyz012345789"); thanks a lot.... can you please edit your code, just change the syntax? thanks again.. – sumon Mar 22 '13 at 11:42
1

Try this:

[tesseract setVariableValue:@"abcdefghijklmnopqrstuvwxyz012345789" forKey:@"tessedit_char_whitelist"];

also you can try variable "tessedit_char_blacklist"

oscarr
  • 529
  • 5
  • 6