Unable to load library 'tesseract'
程序员文章站
2022-07-05 22:15:20
...
在Mac上使用 tess4j 报的这个错误
Exception in thread "pool-1-thread-1" java.lang.UnsatisfiedLinkError: Unable to load library 'tesseract': Native library (darwin/libtesseract.dylib) not found in resource path ([file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/charsets.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/deploy.jar,
是因为在Mac上需要安装tesseract
执行命令
sudo apt-get install tesseract-ocr
安装过程中报下面的错误
https://homebrew.bintray.com/bottles/tesseract-4.1.1.catalina.bo
这个时候就需要出内网了,用外围安装成功后
This formula contains only the "eng", "osd", and "snum" language data files.
If you need any other supported languages, run `brew install tesseract-lang`.
==> Summary
???? /usr/local/Cellar/tesseract/4.1.1: 65 files, 29.6MB
运行项目 测试,出现
Error opening data file ./eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
Failed loading language 'eng'
Tesseract couldn't load any languages!
Warning: Invalid resolution 0 dpi. Using 70 instead.
解决办法进入到 /usr/local/Cellar/tesseract/4.1.1/share/tessdata 把eng.traineddata 加入到工程目录中
运行项目测试会接着 出现
Warning: Invalid resolution 0 dpi. Using 70 instead.
解决方法
Tesseract instance = new Tesseract(); instance.setTessVariable("user_defined_dpi", "300");
推荐阅读
-
zookeeper无法启动"Unable to load database on disk
-
Can't debug c++ project because unable to static library start program *.lib
-
Unable to load script from assets‘index.android.bundle‘.Make sure your bundle is packaged correctly
-
解决:Cannot load ocl.dll library(error code 126). The ocil.dll library may be missing from the system
-
Could not load dynamic library cudart64_100.dll
-
Hadoop启动警告:WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... usi
-
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your......
-
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-
-
【Spark】NativeCodeLoader:62Unable to load native-hadoop library for your platform... using builtin-ja
-
Unable to load native-hadoop library for your platform解决