Skip to content

hansemannn/titanium-tesseract-ocr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published