本文介绍了Tessnet2初始化方法崩溃与某些tessdata路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Tessnet2组件(它使用的tesseract)做OCR。不幸的是,PROGRAMM崩溃后不我调用init方法的任何异常:

I'm using the Tessnet2 assembly (which uses Tesseract) to do OCR. Unfortunately the programm crashes without any exception after I call the init method:

tessnet2.Tesseract ocr = new tessnet2.Tesseract();
ocr.Init(@"D:\Test\Tessdata\german", "deu", false);



德国文件夹包含以下的tesseract 2字数据:

The german folder contains the following tesseract 2 word data:


  • deu.DangAmgigs

  • deu.freq-耶

  • deu.inttemp

  • deu.normproto

  • deu.pffmtable

  • deu.unicharset

  • 申。用户字

  • deu.word-耶

  • deu.DangAmgigs
  • deu.freq-dawg
  • deu.inttemp
  • deu.normproto
  • deu.pffmtable
  • deu.unicharset
  • deu.user-words
  • deu.word-dawg

如果我用,因为我在我的机器上安装的tesseract它工作正常的路径。不过,我需要与路径的解决方案,因为那里的PROGRAMM将deplyoed它没有保证的tesseract安装。

If I use null for the path it works fine because I installed tesseract on my machine. However I need a solution with the path because where the programm will be deplyoed it is not ensured that tesseract is installed.

推荐答案

现在的问题是,如果你有安装的tesseract有一个环境变量集( TESSDATA_PREFIX ),其中包含tessdata的路径。要使用自己的道路,有必要的tesseract卸载和删除的环境变量。

The problem is that if you have Tesseract installed there is an environment variable set ( TESSDATA_PREFIX )which contains the path of the tessdata. To use your own path it is necessary to uninstall Tesseract and delete the environment variable.

这篇关于Tessnet2初始化方法崩溃与某些tessdata路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 10:19