Limit tesseract character to a-z and number only in my iOS app

余生颓废 提交于 2019-12-11 15:38:24

问题


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.


回答1:


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

 tesseract->SetVariable("tessedit_char_whitelist", "abcdefghijklmnopqrstuvwxyz012345789");



回答2:


Try this:

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

also you can try variable "tessedit_char_blacklist"



来源:https://stackoverflow.com/questions/15568948/limit-tesseract-character-to-a-z-and-number-only-in-my-ios-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!