alfred-ocr

An Alfred Workflow


Short Description

OCR & Translate using multiple interfaces for Alfred Workflow.

Last Updated

31 Aug 2023

Compatibility

Yosemite
(10.10)
Mavericks
(10.9)
Mountain Lion
(10.8)
Lion
(10.7)
Snow Leopard
(10.6)
Yes Yes Yes No No
 

Version

4.9.5
 

Bundle ID

com.chandler.alfredocr
 

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

  1. Online OCR: Use shortcut key ctrl + v to trigger screenshot selector or Taking screenshot to clipboard then use keywords oob (baidu) to trigger.
  2. QR Code Reader: Taking screenshot to clipboard then use keywords ooqb (qr baidu) to trigger.
  3. Form OCR: Taking screenshot to clipboard then use keywords ooe (excel) to trigger, then you can copy it to Excel.
  4. Multi File OCR: Select file in Finder and use keywords oof (file) to trigger.

Description

  1. QR Code support reading multiple at the same time;
  2. The test token does not guarantee availability, you can apply for it if you need stability;
  3. Single picture up to 4MB .

Tencent

Trigger

  • Online OCR: Taking screenshot to clipboard then use keywords oot (tencent) to trigger.

Description

  1. The test token does not guarantee availability, you can apply for it if you need stability;
  2. 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

  1. More installation details: README;
  2. Only supports single QR code recognition.

TODO

  • Paragraph optimization.
  • Screenshot translation.

Reference

  1. breezedeus/cnocr(https://github.com/breezedeus/cnocr)
  2. dlenski/python-zxing(https://github.com/dlenski/python-zxing)
  3. ginfuru/alfred-screen-capture(https://github.com/ginfuru/alfred-screen-capture)
  4. oott123/alfred-clipboard-ocr(https://github.com/oott123/alfred-clipboard-ocr)
  5. Elvis Cai(https://github.com/elviscai)

Screenshots