OCR & Translate using multiple interfaces for Alfred Workflow.
OCR Demo
Feature
- Offline OCR (CNOCR)
- Online OCR (Baidu | Tencent | Google)
- QR Code Reader (Baidu | ZXing)
- Form OCR (Baidu)
- Mathematical formula recognition (Baidu | Mathpix)
- Multi File OCR (Baidu)
- Translate (ColorfulClouds)
Installation
- You need install at least Alfred 3 or latest version and activate Powerpack;
- You need install Python 3 and necessary modules, then fill Python 3 Path at
PYTHON_PATH
; - You need to apply and fill the configuration of the API Key into the environment variable;
- More installation details: Install-Python(EN)
Python Module
CNOCR
pip install cnocr
ZXing
pip install zxing
Others
pip install requests
Interfaces
CNOCR
Trigger
- Use keyword
oo
to trigger screenshot selector.
Description
- More installation details: README.
Baidu AI
Trigger
- Online OCR: Use shortcut key ctrl + v to trigger screenshot selector or Taking screenshot to clipboard then use keywords oob (baidu) to trigger.
- QR Code Reader: Taking screenshot to clipboard then use keywords ooqb (qr baidu) to trigger.
- Form OCR: Taking screenshot to clipboard then use keywords ooe (excel) to trigger, then you can copy it to Excel.
- Multi File OCR: Select file in Finder and use keywords oof (file) to trigger.
Description
- QR Code support reading multiple at the same time;
- The test token does not guarantee availability, you can apply for it if you need stability;
- Single picture up to 4MB .
Tencent
Trigger
- Online OCR: Taking screenshot to clipboard then use keywords oot (tencent) to trigger.
Description
- The test token does not guarantee availability, you can apply for it if you need stability;
- Single picture up to 3MB .
Google OCR
Trigger
- Online OCR: Taking screenshot to clipboard then use keywords oog (google) to trigger.
Env Variable
Name | Description |
---|---|
google_access_token | API Key |
google_post_referer | Referer parameter in HTTP request, default null |
google_http_proxy | HTTP Proxy, default null. Reference: 127.0.0.1:1234 |
Description
- Google OCR is a fee-paying interfaces and requires a credit card. Therefore, this project does not have a test token. You must apply for it.
ZXing
Trigger
- QR Code Reader: Taking screenshot to clipboard then use keywords ooq to trigger.
Description
- More installation details: README;
- Only supports single QR code recognition.
TODO
- Paragraph optimization.
- Screenshot translation.
Reference
- breezedeus/cnocr(https://github.com/breezedeus/cnocr)
- dlenski/python-zxing(https://github.com/dlenski/python-zxing)
- ginfuru/alfred-screen-capture(https://github.com/ginfuru/alfred-screen-capture)
- oott123/alfred-clipboard-ocr(https://github.com/oott123/alfred-clipboard-ocr)
- Elvis Cai(https://github.com/elviscai)