tess-two numbers only

So you need to initialize first the API.

 

TessBaseAPI baseApi = new TessBaseAPI();

baseApi.init(datapath, language, ocrEngineMode);

Then set the following variables

 

baseApi.setPageSegMode(TessBaseAPI.PageSegMode.PSM_SINGLE_LINE);

baseApi.setVariable(TessBaseAPI.VAR_CHAR_BLACKLIST, "!?@#$%&*()<>_-+=/:;'\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");

baseApi.setVariable(TessBaseAPI.VAR_CHAR_WHITELIST, ".,0123456789");

baseApi.setVariable("classify_bln_numeric_mode", "1");

In this way the engine will check only the numbers.

posted @ 2017-09-08 08:27  飞晨信息  阅读(174)  评论(0)    收藏  举报