首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Android的TessBaseApi中设置textord_equation_detect为true

如何在Android的TessBaseApi中设置textord_equation_detect为true
EN

Stack Overflow用户
提问于 2020-04-08 02:33:32
回答 1查看 195关注 0票数 0

我在build.gradle中添加了tess-two库,如下所示

代码语言:javascript
复制
        implementation 'com.rmtheis:tess-two:9.1.0'

我想用TessBaseApi()来识别数学表达式和符号,所以我需要设置真的textord_equation_detect,但我不知道如何做我用TessBaseApi写的this.The代码,如下所示

代码语言:javascript
复制
    public static boolean init(AssetManager assetManager){
    mTess = new TessBaseAPI();
    String datapath = CommonUtils.APP_PATH;
    File dir =new File(datapath + "tessdata/");
    if(!dir.exists()) {
        dir.mkdir();
        try {
            InputStream inStream = assetManager.open("CSDL/eng.traineddata");

            FileOutputStream outStream = new FileOutputStream(datapath + "tessdata/eng.traineddata");

            byte[] buffer = new byte[1024];
            int readCount = 0;
            while (((readCount = inStream.read(buffer)) != -1)) {
                outStream.write(buffer, 0, readCount);

            }
            outStream.flush();
            outStream.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    mTess.init(datapath,"eng");
    return true;
}

如何设置真正的textord_equation_detect?你能帮帮我吗?

EN

回答 1

Stack Overflow用户

发布于 2020-04-08 06:21:24

mTess.SetVariable("textord_equation_detect", "T");

下面是https://github.com/tesseract-ocr/tesseract/issues/2204中的示例

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61086992

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档