光學字元識別 (Optical Character Recognition, OCR),是指對文字資料的圖像檔案進行分析識別處理,取得文字及版面資訊的過程。像是Google Translation App,已經可以透過OCR來即時辨識多國文字!
辨識出來應為1234HappyBoy0。
現在iOS有Open source可以使用OCR,而且是Google早在2015年就釋出,若只是辨識簡單的英文字母或數字,應該夠用!
下載在GitHub上的Tesseract OCR iOS來試試看吧!
Tesseract OCR iOS is a Framework for iOS7+, compiled also for armv7s and arm64. http://www.g8production.com
我稍微測試一下⋯⋯
看起來效果不錯!
不過HappyBoy字體若縮小呢?
就不知道在辨識啥啦XD~看來這個OCR Open Source有些規則必須遵從!
Raywenderlich這麼介紹Tesseract OCR:
Tesseract OCR is quite powerful, but does have the following limitations:
- Unlike some OCR engines (like those used by the U.S. Postal Service to sort mail), Tesseract is unable to recognize handwriting and is limited to about 64 fonts in total.
- Tesseract requires a bit of preprocessing to improve the OCR results; images need to be scaled appropriately, have as much image contrast as possible, and have horizontally-aligned text.
- Finally, Tesseract OCR only works on Linux, Windows, and Mac OS X.
參考:WiKi – 光學字元識別、Tesseract OCR Tutorial。
隨意留個言吧:)~