kindle電子書_越獄後koreader中自帶OCR功能的設定

MugenG7發表於2024-03-26

KOReader一直以PDF閱讀的優秀體驗而聞名。然而,在尚未配置的情況下閱讀圖片類PDF在KOReader中長按螢幕無法像原生系統閱讀正常文件一樣劃線取詞,並且此時KOReader會彈出一個彈窗:

沒有OCR識別結果,或沒有語言數
據。
KOReader有一個內建的OCR引擎用於識別掃描的PDF和DjVu文件中的文字。為了在掃描的頁面中使用OCR,
您需要為您的文件語言安裝tesseract
訓練資料。
您可以從https://tesseract-
ocr.github.io/tessdoc/Data-Files下
載3.04版本的語言資料檔案。
複製Tesseract 3.04的語言資料檔案
(比如適用於英語的eng.traineddata
和適用於西班牙語的
spa.traineddata)到koreader/data/
tessdata資料夾內

我翻遍了github上tessdoc這個專案,最終找到了該作者開的另一存放traineddata的專案:traineddata3.0.4,似乎無法下載單個檔案,整個打包下載下來了。裡邊我就取了中文的和英語的檔案,中文簡體chi_tra.traineddata,中文繁體chi_tra.traineddata,英文eng.traineddata

放進彈窗裡給出的那個目錄:koreader/data/tessdata
重啟KOReader,開啟PDF,點選底欄小齒輪圖示,文件語言改為Chinese,開啟強制OCR
按住要識別的文字,略作等待,得到一串中文或者英文。

說實話識別得不咋地,可用性堪憂。而且光識別出來也沒啥作用,用作新增筆記功能的話也許還行,想查詞就得另外再加詞典了。我原以為這些操作已經夠煩人了的,沒想到搜尋一番之後發現,只有中文和英語可以直接加OCR訓練資料和詞典用,其他語言不僅要找到訓練資料,還得修改persistent.defaults.lua,這是我在mobileread上看到的。KOReader的官網也有相關說明。

帖點東西上來,為有需要的人減少一點搜尋的麻煩:

KOReader官方對於OCR功能的介紹 OCR (Optical Character Recognition) is the process of extracting text from images into machine readable format. In KOReader context, it is generally used for extracting text from scanned book pages in PDF files. KOReader relies on Tesseract Open Source OCR Engine for this task (https://github.com/tesseract-ocr/tessdoc).

In order to use this feature you need to:

  1. Install Tesseract language data to your KOReader
  2. Add newly installed languages to koreader/defaults.lua configuration file (necessary only if your language is other than English or Chinese)
  3. INFO Buttons on OCR menu will not function until you install the necessary Tesseract files. Details of this process can be read in the related wiki page: https://github.com/koreader/koreader/wiki/Dictionary-support#dictionary-lookups-in-scanned-pages

OCR(光學字元識別)是將影像中的文字提取為機器可讀格式的過程。在KOReader上下文中,它通常用於從PDF檔案中的掃描書籍頁面中提取文字。KOReader依賴Tesseract開源OCR引擎完成此任務(https://github.com/tesseract-ocr/tessdoc)
要使用此功能,您需要:

  1. 將Tesseract語言資料安裝到您的KOReader
  2. 將新安裝的語言新增到koreader/defaults.lua配置檔案中(僅當您的語言不是英語或中文時才需要)
    在安裝必要的Tesseract檔案之前,OCR選單上的INFO按鈕將無法工作。此過程的詳細資訊可以在相關的wiki頁面中閱讀:https://github.com/koreader/koreader/wiki/Dictionary-support#dictionary-在掃描的頁面中查詢

koreader官方使用文件
mobileread論壇上的答疑帖
traineddata3.0.4
downgit:github下載加速

相關文章