hansemannn / titanium-tesseract-ocr

Use the native TesseractOCR iOS-framework in Appcelerator Titanium.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

đź”  TesseractOCR in Titanium

Use the native TesseractOCR iOS-framework in Appcelerator Titanium.

Input Output
Example Image

Requirements

  • Titanium SDK 6.0.0 or later
  • A TesseractOCR language-file placed in tessdata/*.traineddata

API's

Methods

recognize(args)

  • image (String - Required)
  • callback (Function - Required)
  • languages (Array - Optional - Default: ['eng'])
  • charWhitelist (Array - Optional)
  • charBlacklist (Array - Optional)
  • engineMode (ENGINE_MODE_TESSERACT_ONLY, ENGINE_MODE_CUBE_ONLY, ENGINE_MODE_CUBE_COMBINED - Optional)
  • rect (Object - Optional)
    • x, y, width, height

Example

var Tesseract = require('ti.tesseract');

var win = Ti.UI.createWindow({
    backgroundColor: '#fff'
});

var btn = Ti.UI.createButton({
    title: 'Recognize Image'
});

btn.addEventListener('click', function() {
    Tesseract.recognize({
        image: 'image_sample_tr.png',
        callback: function(e) {
            alert('Text: ' + e.recognizedText);
        }
    });
});

win.add(btn);
win.open();

Build

cd iphone
appc ti build -p ios --build-only

Legal

This module is Copyright (c) 2017-Present by Appcelerator, Inc. All Rights Reserved. Usage of this module is subject to the Terms of Service agreement with Appcelerator, Inc.

About

Use the native TesseractOCR iOS-framework in Appcelerator Titanium.

License:Other


Languages

Language:C++ 66.7%Language:C 27.2%Language:Objective-C 5.1%Language:Objective-C++ 1.0%Language:JavaScript 0.0%