Window10 VS2019配置tesseract源碼


Window10 VS2019配置tesseract源碼

1、配置tessract源碼,折騰了好久[2020.5.5-2020.5.11],今晚終於配置成功了。

成功

1、從github下克隆Tesseract-OCR_for_Windows,注意是克隆不是下載
 
    git clone https://github.com/peirick/Tesseract-OCR_for_Windows.git

2、 從github下克隆leptonica
    
    git clone https://github.com/DanBloomberg/leptonica.git

3、 從github下克隆tesseract
    
    git clone https://github.com/tesseract-ocr/tesseract.git

4、把步驟2克隆完成的leptonica文件夾里面文件拷到Tesseract-OCR_for_Windows\leptonica

5、把步驟3克隆完成的tesseract文件夾里面文件拷到Tesseract-OCR_for_Windows\tesseract_3.05
    
6、tesseract.sln,編譯,會有報錯。

7、把
static const STRING kCharsToEx[] = {"'", "`", "\"", "\\", ",", ".",
	"〈", "〉", "《", "》", "」", "「", ""};

修改成
    
static const STRING kCharsToEx[] = { "'", "`", "\"", "\\", ",", ".",
	"<", ">", "<<", ">>", "" };    

8、再次編譯運行,成功。
    
如果需要dll,打開項目屬性,在常規->配置類型處選擇動態庫;C/C++預處理 -> 預處理器定義處增加TESS_EXPORTS

方法[但是不知道怎么用到vs工程里面]

sw setup
sw build org.sw.demo.google.tesseract.tesseract-master

失敗

cppan --build pvt.cppan.demo.google.tesseract.tesseract-master

失敗

C:\WINDOWS\system32>sw setup
Downloading database from origin remote

C:\WINDOWS\system32>d:

D:\>cd D:\Software\Programming Software\Open Source\tesseract\sw\tesseract-4.1.1

D:\Software\Programming Software\Open Source\tesseract\sw\tesseract-4.1.1>mkdir win64 && cd win64

D:\Software\Programming Software\Open Source\tesseract\sw\tesseract-4.1.1\win64>cmake .. -G "Visual Studio 16 2019"

還有其它嘗試就不列出了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM