All Projects → kaelzhang → Penteract Ocr

kaelzhang / Penteract Ocr

Licence: mit
⭐️ The native node.js bindings to the Tesseract OCR project.

Projects that are alternatives of or similar to Penteract Ocr

Ocr Table
Extract tables from scanned image PDFs using Optical Character Recognition.
Stars: ✭ 165 (+91.86%)
Mutual labels:  ocr, tesseract, optical-character-recognition
Tesseract4android
Fork of tess-two rewritten from scratch to support latest version of Tesseract OCR.
Stars: ✭ 148 (+72.09%)
Mutual labels:  ocr, tesseract, optical-character-recognition
React Native Tesseract Ocr
Tesseract OCR wrapper for React Native
Stars: ✭ 384 (+346.51%)
Mutual labels:  ocr, tesseract, optical-character-recognition
Image2text
📋 Python wrapper to grab text from images and save as text files using Tesseract Engine
Stars: ✭ 243 (+182.56%)
Mutual labels:  ocr, tesseract, optical-character-recognition
Swiftytesseractrte
SwiftyTesseract Real-Time Engine
Stars: ✭ 49 (-43.02%)
Mutual labels:  ocr, tesseract, optical-character-recognition
Swiftytesseract
A Swift wrapper around Tesseract for use in iOS, macOS, and Linux applications
Stars: ✭ 170 (+97.67%)
Mutual labels:  ocr, tesseract, optical-character-recognition
Tesserocr
A Python wrapper for the tesseract-ocr API
Stars: ✭ 1,567 (+1722.09%)
Mutual labels:  ocr, tesseract, optical-character-recognition
Pan card ocr project
To extract details from Indian National Identification Cards such as PAN (completed) & Aadhar, Passport, Driving License (WIP) in a structured format
Stars: ✭ 39 (-54.65%)
Mutual labels:  ocr, tesseract, optical-character-recognition
Android Ocr
Experimental optical character recognition app
Stars: ✭ 2,177 (+2431.4%)
Mutual labels:  ocr, tesseract, optical-character-recognition
IdCardRecognition
Android id card recognition based on OCR. 安卓基于OCR的身份证识别。
Stars: ✭ 35 (-59.3%)
Mutual labels:  ocr, tesseract, optical-character-recognition
Easyocr
Java OCR 识别组件(基于Tesseract OCR 引擎)。能自动完成图片清理、识别 CAPTCHA 验证码图片内容的一体化工作。Java Image cleanup, OCR recognition component (based Tesseract OCR engine, automatically cleanup image and identification CAPTCHA verification code picture content).
Stars: ✭ 466 (+441.86%)
Mutual labels:  ocr, tesseract
Ocrmypdf
OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched
Stars: ✭ 5,549 (+6352.33%)
Mutual labels:  ocr, tesseract
Swiftocr
Fast and simple OCR library written in Swift
Stars: ✭ 4,459 (+5084.88%)
Mutual labels:  ocr, optical-character-recognition
Tesseract
A PHP wrapper for the Tesseract OCR engine
Stars: ✭ 19 (-77.91%)
Mutual labels:  ocr, tesseract
Tesseract.js
Pure Javascript OCR for more than 100 Languages 📖🎉🖥
Stars: ✭ 25,246 (+29255.81%)
Mutual labels:  ocr, tesseract
Tessdata
Trained models with support for legacy and LSTM OCR engine
Stars: ✭ 4,173 (+4752.33%)
Mutual labels:  ocr, tesseract
Javascript Bcr Library
Offline business card reader
Stars: ✭ 24 (-72.09%)
Mutual labels:  ocr, tesseract
Ocr Electron Vue
📇 A Simple OCR Application built on Electron, Vue.js & Tesseract.js
Stars: ✭ 67 (-22.09%)
Mutual labels:  ocr, tesseract
Ccextractor
CCExtractor - Official version maintained by the core team
Stars: ✭ 356 (+313.95%)
Mutual labels:  ocr, tesseract
Pytesseractid
使用 pytesseract ocr 识别 18 位身份证号
Stars: ✭ 23 (-73.26%)
Mutual labels:  ocr, tesseract

Build Status Coverage

penteract

The native Node.js bindings to the Tesseract OCR project.

  • Using Node.js bindings, avoid spawning tesseract command line.
  • Asynchronous I/O: Image reading and processing in insulated event loop backed by libuv.
  • Support to read image data from JavaScript buffers.

Contributions are welcome.

Install

First of all, a g++ 4.9 compiler is required.

Before install penteract, the following dependencies should be installed

$ brew install pkg-config tesseract # mac os

Then npm install

$ npm install penteract

To Use with Electron

Due to the limitation of node native modules, if you want to use penteract with electron, add a .npmrc file to the root of your electron project, before npm install:

runtime = electron
; The version of the local electron,
; use `npm ls electron` to figure it out
target = 1.7.5
target_arch = x64
disturl = https://atom.io/download/atom-shell

Usage

Recognize an Image Buffer

import {
  recognize
} from 'penteract'

import fs from 'fs-extra'

const filepath = path.join(__dirname, 'test', 'fixtures', 'penteract.jpg')

fs.readFile(filepath).then(recognize).then(console.log) // 'penteract'

Recognize a Local Image File

import {
  fromFile
} from 'penteract'

fromFile(filepath, {lang: 'eng'}).then(console.log)     // 'penteract'

recognize(image [, options])

  • image Buffer the content buffer of the image file.
  • options PenteractOptions= optional

Returns Promise.<String> the recognized text if succeeded.

fromFile(filepath [, options])

  • filepath Path the file path of the image file.
  • options PenteractOptions=

Returns Promise.<String>

PenteractOptions Object

{
  // @type `(String|Array.<String>)=eng`,
  //
  // Specifies language(s) used for OCR.
  //   Run `tesseract --list-langs` in command line for all supported languages.
  //   Defaults to `'eng'`.
  //
  // To specify multiple languages, use an array.
  //   English and Simplified Chinese, for example:
  // ```
  // lang: ['eng', 'chi_sim']
  // ```
  lang: 'eng'
}

Promise.reject(error)

  • error Error The JavaScript Error instance
    • code String Error code.
    • message String Error message.
    • other properties of Error.

code: ERR_READ_IMAGE

Rejects if it fails to read image data from file or buffer.

code: ERR_INIT_TESSER

Rejects if tesseract fails to initialize

Example of Using with Electron

// For details of `mainWindow: BrowserWindow`, see
// https://github.com/electron/electron/blob/master/docs/api/browser-window.md
mainWindow.capturePage({
  x: 10,
  y: 10,
  width: 100,
  height: 10

}, (data) => {
  recognize(data.toPNG()).then(console.log)
})

Compiling Troubles

For Mac OS users, if you are experiencing trouble when compiling, run the following command:

$ xcode-select --install

will resolve most problems.

Warnings:

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

resolver:

$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].