All Projects → SwiftyTesseract → Swiftytesseractrte

SwiftyTesseract / Swiftytesseractrte

Licence: mit
SwiftyTesseract Real-Time Engine

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Swiftytesseractrte

Tesserocr
A Python wrapper for the tesseract-ocr API
Stars: ✭ 1,567 (+3097.96%)
Mutual labels:  ocr, tesseract, optical-character-recognition
Penteract Ocr
⭐️ The native node.js bindings to the Tesseract OCR project.
Stars: ✭ 86 (+75.51%)
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 (-20.41%)
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 (+395.92%)
Mutual labels:  ocr, tesseract, optical-character-recognition
Swiftytesseract
A Swift wrapper around Tesseract for use in iOS, macOS, and Linux applications
Stars: ✭ 170 (+246.94%)
Mutual labels:  ocr, tesseract, optical-character-recognition
Tesseract4android
Fork of tess-two rewritten from scratch to support latest version of Tesseract OCR.
Stars: ✭ 148 (+202.04%)
Mutual labels:  ocr, tesseract, optical-character-recognition
React Native Tesseract Ocr
Tesseract OCR wrapper for React Native
Stars: ✭ 384 (+683.67%)
Mutual labels:  ocr, tesseract, optical-character-recognition
Ocr Table
Extract tables from scanned image PDFs using Optical Character Recognition.
Stars: ✭ 165 (+236.73%)
Mutual labels:  ocr, tesseract, optical-character-recognition
Android Ocr
Experimental optical character recognition app
Stars: ✭ 2,177 (+4342.86%)
Mutual labels:  ocr, tesseract, optical-character-recognition
IdCardRecognition
Android id card recognition based on OCR. 安卓基于OCR的身份证识别。
Stars: ✭ 35 (-28.57%)
Mutual labels:  ocr, tesseract, optical-character-recognition
Qanswer
【Deprecated】🥇🥇🥇 冲顶大会等游戏答题助手,提供答题辅助决策 ,帮助顺利吃鸡
Stars: ✭ 326 (+565.31%)
Mutual labels:  ocr, tesseract
breach-protocol-autosolver
Solve breach protocol minigame in second(s). Windows/Linux/GeForce Now/Google Stadia. Every language.
Stars: ✭ 28 (-42.86%)
Mutual labels:  ocr, tesseract
Card Ocr
身份证识别OCR
Stars: ✭ 345 (+604.08%)
Mutual labels:  ocr, tesseract
Ocrbot
An OCR (Optical Character Recognition) bot for Mastodon (and compatible) instances
Stars: ✭ 39 (-20.41%)
Mutual labels:  ocr, tesseract
Ccextractor
CCExtractor - Official version maintained by the core team
Stars: ✭ 356 (+626.53%)
Mutual labels:  ocr, tesseract
ocr
Simple app to extract text from pictures using Tesseract
Stars: ✭ 98 (+100%)
Mutual labels:  ocr, tesseract
Ocrmypdf
OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched
Stars: ✭ 5,549 (+11224.49%)
Mutual labels:  ocr, tesseract
staff identity card ocr project
Staff Identity Card OCR Project
Stars: ✭ 15 (-69.39%)
Mutual labels:  ocr, tesseract
Tessdata
Trained models with support for legacy and LSTM OCR engine
Stars: ✭ 4,173 (+8416.33%)
Mutual labels:  ocr, tesseract
Eyevis
Android based Vocal Vision for Visually Impaired. Object Detection, Voice Assistance, Optical Character Reader, Read Aloud, Face Recognition, Landmark Recognition, Image Labelling etc.
Stars: ✭ 48 (-2.04%)
Mutual labels:  ocr, optical-character-recognition

SwiftyTesseractRTE

pod-version platforms swift-version Build Status

SwiftyTesseractRTE can only currently be used in portrait mode.

SwiftyTesseractRTE-example

About SwiftyTesseractRTE

SwiftyTesseractRTE (SwiftyTesseract Real-Time Engine) is a real-time optical character recognition library built on top of SwiftyTesseract.

Swift Version SwiftyTesseractRTE Version
4.0 1.x.x
4.1 1.x.x
4.2 2.x.x

Using SwiftyTesseractRTE in Your Project

Import the neccessary modules

import SwiftyTesseract
import SwiftyTesseractRTE

Create an instance of RealTimeEngine and assign it's regionOfInterest property.

var realTimeEngine: RealTimeEngine!

@IBOutlet weak var previewView: UIView!
@IBOutlet weak var regionOfInterest: UIView! // A subview of previewView

override func viewDidLoad() {
  let swiftyTesseract = SwiftyTesseract(language: .english)
  realTimeEngine = RealTimeEngine(swiftyTesseract: swiftyTesseract, desiredReliability: .verifiable) { recognizedString in
    // Do something with the recognized string
  }
}

override func viewDidLayoutSubviews() {
  // Must occur during viewDidLayoutSubviews() - Autolayout constraints are not set in viewDidLoad()
  realTimeEngine.bindPreviewLayer(to: previewView)
  realTimeEngine.regionOfInterest = regionOfInterest.frame

  // Only neccessary if providing a visual cue where the regionOfInterest is to your end user
  previewView.addSublayer(regionOfInterest.layer)
}

Optical Character Recognition and Camera Preview

SwiftyTesseractRTE allows for showing the camera preview without constantly attempting to recognize text. This allows you to let your end user to line up the text to be scanned before starting the scan. The recognitionIsActive property is set to true by default, so to prevent a scan from starting immediately, set recognitionIsActive to false after instantiating RealTimeEngine and before calling startPreview(). Calling stopPreview() also prevents recognition from being attempted because there are no inbound camera frames to be scanned.

Starting and Stopping Recognition

// Starts optical character recognition
realTimeEngine.recognitionIsActive = true

// Stops optical character recognition
realTimeEngine.recognitionIsActive = false

Starting and Stopping Camera Preview

// Starts camera preview
realTimeEngine.startPreview()

// Stops camera preview
realTimeEngine.stopPreview()

Camera Permissions

For camera permissions, you will need to add the Privacy - Camera Usage Description permission to your Info.plist file. If you are using the default SwiftyTesseractRTE AVManager implementation, permission will be requested at the time the camera preview is being generated. If a custom implementation of AVManager is provided, then it will be up to the developer to implement the permission request. For most use cases, the default AVManager implementation is preferred and a custom implementation should only be provided if access to CMSampleBuffers are needed from the camera at the same time that SwiftyTesseractRTE is being run for OCR.

RealTimeEngine onRecognitionComplete closure property

Starting in SwiftyTesseractRTE 2.0, the SwiftyTesseractRTEDelegate protocol has been replaced in favor of a closure property called onRecognitionComplete with a type of ((String) -> ())?. This can be assigned in a few ways:

Trailing Closure on Instantiation

RealTimeEngine(swiftyTesseract: swiftyTesseract, desiredReliability: .verifiable) { recognizedString in
    // Do something with the recognized string
}

Passing a Function Parameter

RealTimeEngine(swiftyTesseract: swiftyTesseract, desiredReliability: .verifiable, onRecognitionComplete: aFunction)

Property Injection

let realTimeEngine = RealTimeEngine(swiftyTesseract: swiftyTesseract, desiredReliability: .verifiable)
// Anonymous closure
realTimeEngine.onRecognitionComplete = { recognizedString in 
  // Do something with the recognized string
}
// Named closure
realTimeEngine.onRecognitionComplete = aFunction

A Note about Portrait-Only

SwiftyTesseractRTE is currently only able to utilized in portrait mode, but that does not mean your entire app also has to be portrait mode only. See the example project's AppDelegate (specifically the addition of a shouldRotate boolean member variable and the implementation of application(_:supportedInterfaceOrientationsFor:)) and ViewController files (specifically the viewWillAppear() and viewWillDisappear() methods) for an example on how to make a single view controller portrait mode only.

Installation

CocoaPods

Tested with pod --version: 1.3.1

# Podfile
use_frameworks!

target 'YOUR_TARGET_NAME' do
    pod 'SwiftyTesseractRTE',    '~> 2.0'
end

Replace YOUR_TARGET_NAME and then, in the Podfile directory, type:

$ pod install

Setting Up SwiftyTesseract for Use in SwiftyTesseractRTE

See SwiftyTesseract's Additional Configuration section on properly setting up SwiftyTesseract to be utilized in your project.

Documentation

Official documentation for SwiftyTesseractRTE can be found here

Contributions Welcome

Contributions are always welcome! Please refer to Contributing to SwiftyTesseractRTE for the full guidelines on creating issues and opening pull requests to the project.

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