1.安装##下载源码gitclonehttps://github.com/tesseract-ocr/tesseract.gitcdtesseract./autogen.sh##可能会报错:Unabletofindavalidcopyoflibtoolizeorglibtoolizein你的路径!##解决方法:##yuminstallautomake-y##yuminstalllibtool-y./configure##./configure中可能出现以下问题,解决方法附后##问题1configure:error:Yourcompilerdoesnot有必要的C++17支持!无法继续。##解决方案:https://segmentfault.com/a/1190000041832780##问题2配置:错误:需要Leptonica1.74或更高版本。尝试安装libleptonica-dev包。##解决方案:https://segmentfault.com/a/1190000041833110make&&makeinstallldconfig检查版本tesseract--versiontesseract5.1.0-32-gf36c0leptonica-1.82.0libjpeg6b(libjpeg-turbo1.2.90):libpng1.5。13:zlib1.2.7:libwebp0.3.0FoundSSE4.1FoundOpenMP201511Foundlibcurl/7.29.0NSS/3.53.1zlib/1.2.7libidn/1.28libssh2/1.8.0测试识别图像tesseracttracking2.png结果正常情况下会输出Estimatingresolutionas146,结果保存在当前目录下的result.txt文件中。如果命令输出错误参考如下解决方法:提示加载语言库错误...错误打开数据文件/usr/local/share/tessdata/eng.traineddataPleasemakesuretheTESSDATA_PREFIXenvironmentvariableissettoyourtessdatadirectory.Failedloadinglanguage'eng'Tesseract无法加载任何语言!无法初始化tesseract。下载语言库官网下载地址:https://github.com/tesseract-ocr/tessdata上传到linux/usr/local/share/tessdata/目录如果是java开发的,tessdata语言库也包含在tess4j-5.2.1.jar包,从jar包解压上传目录即可,但是只有eng和osd语言提示缺少模块ErrorinpixReadMemTiff:functionnotpresentErrorinpixReadMem:tiff:nopixreturnedError在pixaGenerateFontFromString:pixnotmadeErrorinbmfCreate:fontpixanotmade报错是因为环境中没有这些libjpeglibpngfreetypegdgifliblibtiffzlib依赖库,不是全部用到,安装libjpeglibpnglibtiff即可。yum-yinstalllibjpeg*libpng*libtiff*#重新编译leptonicacdleptonica-1.82.0makeclean./configure&&make&&makeinstall官方文档:https://tesseract-ocr.github.io/tessdoc/Compiling.html其他教程链接:linux环境如何支持te的使用ss4j进行ORClinux(centos7)并上传最新版Tesseract-OCR(5.0)
