OCR Tesseract only sets numbers

I am new to programming in general and recently got involved in application development. I am using tesseract for iOS and I cannot figure out how to get it read-only numbers.

There is an exact question asked by Alex G here , and I have the same files / problems as he has. the answer is apparently

Go to the tessdata \ configs \ digits file. If you use the API, then call SetVariable ("tessedit_char_whitelist", "0123456789-."); You use the SetVariable API if you want to programmatically call Tesseract through Objective-C, for example.

In addition, I still do not understand how to do this. Where is this command line? I call Tesseract from Xcode, not the command line. I also did not contain this tessdata \ configs \ digits file.

If anyone can help me, I would really appreciate it.

Thanks!

Ted enter image description here

+4
source share
1 answer

If you follow How to compile and use the Tesseract article (3.01) in an iOS article (SDK 5) , you must place the SetVariable statement after calling Init, as follows:

tesseract->Init([dataPath cStringUsingEncoding:NSUTF8StringEncoding], "eng"); tesseract->SetVariable("tessedit_char_whitelist", "0123456789-."); 
+1
source

All Articles