All Projects → scott0123 → Tesseract Macos

scott0123 / Tesseract Macos

Licence: mit
Objective C wrapper for the open source OCR Engine Tesseract (macOS)

Projects that are alternatives of or similar to Tesseract Macos

Tools Ocr
树洞 OCR 文字识别(一款跨平台的 OCR 小工具)
Stars: ✭ 2,303 (+1395.45%)
Mutual labels:  ocr, screenshot, mac
Textshot
Python tool for grabbing text via screenshot
Stars: ✭ 1,163 (+655.19%)
Mutual labels:  ocr, screenshot, tesseract
Ocr Electron Vue
📇 A Simple OCR Application built on Electron, Vue.js & Tesseract.js
Stars: ✭ 67 (-56.49%)
Mutual labels:  ocr, tesseract
Macimagesetgenerator
2个脚本文件,帮助你在Mac上,生成Xcode可使用的APP图标和启动图。
Stars: ✭ 73 (-52.6%)
Mutual labels:  xcode, mac
Node Tesseract Ocr
A Node.js wrapper for the Tesseract OCR API
Stars: ✭ 92 (-40.26%)
Mutual labels:  ocr, tesseract
Idmatch
Match faces on id cards with OCR capabilities.
Stars: ✭ 52 (-66.23%)
Mutual labels:  ocr, tesseract
Learningopencv
Source code for Learning OpenCV 《学习OpenCV》源码及 Mac 运行工程
Stars: ✭ 57 (-62.99%)
Mutual labels:  xcode, mac
Tesseract4android
Fork of tess-two rewritten from scratch to support latest version of Tesseract OCR.
Stars: ✭ 148 (-3.9%)
Mutual labels:  ocr, tesseract
Ocrbot
An OCR (Optical Character Recognition) bot for Mastodon (and compatible) instances
Stars: ✭ 39 (-74.68%)
Mutual labels:  ocr, tesseract
Tesseract
This package contains an OCR engine - libtesseract and a command line program - tesseract. Tesseract 4 adds a new neural net (LSTM) based OCR engine which is focused on line recognition, but also still supports the legacy Tesseract OCR engine of Tesseract 3 which works by recognizing character patterns. Compatibility with Tesseract 3 is enabled by using the Legacy OCR Engine mode (--oem 0). It also needs traineddata files which support the legacy engine, for example those from the tessdata repository.
Stars: ✭ 43,199 (+27951.3%)
Mutual labels:  ocr, tesseract
Gosseract
Go package for OCR (Optical Character Recognition), by using Tesseract C++ library
Stars: ✭ 1,622 (+953.25%)
Mutual labels:  ocr, tesseract
Links Detector
📖 👆🏻 Links Detector makes printed links clickable via your smartphone camera. No need to type a link in, just scan and click on it.
Stars: ✭ 106 (-31.17%)
Mutual labels:  ocr, tesseract
Tesseract Python
Examples to implement OCR(Optical Character Recognition) using tesseract using Python
Stars: ✭ 49 (-68.18%)
Mutual labels:  ocr, tesseract
Swiftytesseractrte
SwiftyTesseract Real-Time Engine
Stars: ✭ 49 (-68.18%)
Mutual labels:  ocr, tesseract
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 (-74.68%)
Mutual labels:  ocr, tesseract
Penteract Ocr
⭐️ The native node.js bindings to the Tesseract OCR project.
Stars: ✭ 86 (-44.16%)
Mutual labels:  ocr, tesseract
Aadhaar Card Ocr
Extract text information from Aadhaar Card using tesseract-ocr 😎
Stars: ✭ 112 (-27.27%)
Mutual labels:  ocr, tesseract
Cogstack Pipeline
Distributed, fault tolerant batch processing for Natural Language Applications and Search, using remote partitioning
Stars: ✭ 26 (-83.12%)
Mutual labels:  ocr, tesseract
Mac2imgur
⬆ A simple Mac app designed to make uploading images and screenshots to Imgur quick and effortless.
Stars: ✭ 914 (+493.51%)
Mutual labels:  screenshot, mac
Tesserocr
A Python wrapper for the tesseract-ocr API
Stars: ✭ 1,567 (+917.53%)
Mutual labels:  ocr, tesseract

Tesseract macOS

Build Status license GitHub stars

This is an open-source macOS-based Objective-C wrapper for the OCR library Tesseract.

You can also use this in Swift, instructions below.

Fork this repo if you want to experiment with it.

Overview

The wrapper consists of just the following files

  • SLTesseract.h (Header file)
  • SLTesseract.mm (Implementation file)
  • tessdata/ (Language files for Tesseract)
  • lib/ (Compiled dependencies)
  • include/ (Headers for the dependencies)

Demo Application

For those of you who wish to first test out the OCR capabilities, the included Screenshot-OCR is a demo application to showcase this.

First build the Xcode project included in this repository. This will generate an application through wish you can take a screenshot, as shown in the following gif.

Screenshot example

In the Xcode log you will find the corresponding text Tesseract detected for this screenshot.

Output text

Getting Started

Getting this to work in your own project

  1. Clone this project

  2. Copy over the include, lib, and tessdata folders to your project.

  3. Add these folders to your project in Xcode. Make sure include and lib are added as groups and tessdata is added as a folder reference.

    The location of this setting is shown in the following image:

    add settings

  4. Copy over the files SLTesseract.mm and SLTesseract.h to your code directory.

  5. Verify that the file SLTesseract.mm is added to Targets > Build Phases > Compile Sources. Additionally, verify that all the static libraries are also added to Targets > Build Phases > Link Binary With Libraries. (This process should be done automatically)

  6. You are now ready to use Tesseract in your macOS project. (See Example Usage for code syntax)

Example Usage

At the top of the file include the header file

#import "SLTesseract.h"

And then

SLTesseract *ocr = [[SLTesseract alloc] init];

will initiallize the class SLTesseract.

(optional) ocr.language = @"eng";

(optional) ocr.charWhitelist = @"abcdefghijklmnopqrstuvwxyz"

(optional) ocr.charBlacklist = @"1234567890"

Finally, assuming you already have the image that you wish to perform OCR on in NSImage form, you can call

NSString *text = [ocr recognize:image];

to recognize the image in question and get the corresponding text.

Usage in Swift

This library can be easily imported in a Swift project.

Just replicate all the steps above.

When adding .h and .mm files you will be prompted by Xcode to add a Bridging Header (if don't have one already).

Xcode will generate a file named yourProject-Bridging-Header.h

Add this line to the Bridging Header:

#import "SLTesseract.h" 

Initialize like this:

let ocr = SLTesseract()

(optional) ocr.language = "eng"

(optional) ocr.charWhitelist = "abcdefghijklmnopqrstuvwxyz"

(optional) ocr.charBlacklist = "1234567890"

Finally perform OCR by doing this:

let text = ocr.recognize(image)

Dependencies

The libraries below are all included in the lib/ directory.

  • Tesseract (v4.1.1)
  • Leptonica (v1.8.0)
    • LibPNG (v1.6.37)
    • LibTIFF (v4.1.0)
    • LibJPEG (v9d)
    • LibZ (v1.2.11)
    • LibOpenJPEG (v2.3.1)
    • LibWebP (v1.1.0)
    • LibGIF (v5.2.1)

Additionally libcurl is required. To add libcurl, select your target in Xcode, select Build Phases tab and under Link Binary With Libraries phase click on the + button and type libcurl. Select libcurl.tbd.

License

My project Tesseract macOS itself is distributed under the MIT license (see LICENSE);

Keep in mind that the main dependency Tesseract is distributed under the Apache 2.0 license.

Contact

Open an issue if you want something fixed.

You may reach me at [email protected] to inquire about this project.

Used by

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].