2015-08-16 167 views
2

我是tesseract的新手,並且與github頁面中的不同目錄有點混淆。遇到問題培訓tesseract

tesserac-ocr代碼庫是我安裝的。這在/ usr/local/share下安裝了tessdata目錄/ tessdata/

所以現在訓練時的Tesseract我運行下面的命令 -

# tesseract img.tif img box.train 

我收到以下錯誤

Tesseract Open Source OCR Engine v3.03 with Leptonica 
Error opening data file /usr/local/share/tessdata/eng.traineddata 
Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory. 
Failed loading language 'eng' 
Tesseract couldn't load any languages! 
Could not initialize tesseract. 

顯然它無法找到tessdata文件夾。

所以,現在我從github獲得了tessdata目錄(https://github.com/tesseract-ocr/tessdata)。然後將TESSDATA_PREFIX指向從github下載的tessdata。不會改變任何東西。我得到以下錯誤 -

Tesseract Open Source OCR Engine v3.03 with Leptonica 
read_params_file: Can't open box.train 

所以我的問題是應該指出什麼tessdata? tesseract從訓練命令中獲得box.train的位置?

+0

您是否創建並檢查box.train文件?如果不是,則必須先用'tesseract img.tif img batch.nochop makebox'創建box.train。之後,如果您的角色被正確檢測到,您將不得不檢查箱子文件。 –

回答

0

一個最愚蠢的事情,你可以做新手盡力培養正方體;-)

下一頁:3.03版本是不是官方github.com回購(順便說一句:3.03從未正式發佈...它只是Ubuntu發佈的。)

下一步:如果您安裝了tesseract(源代碼)box.train已安裝。你從Ubuntu packages/repo安裝(我不這麼認爲,因爲在這種情況下,tesseract不會使用/ usr/local/...),你應該聯繫packager如何打包tesseract。

+0

他們從code.google.com移至github,但未更新其文檔。問題是他們改變了代碼打包和分發的方式。我從源代碼安裝它。 – user220201

+0

轉到github.com記錄爲其他項目 - 在主頁上。 – user898678