Git Product home page Git Product logo

vorlovsky / tesseract-ocr-ane Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 7.0 97.96 MB

Tesseract OCR Adobe Native Extension for Android & iOS

License: Apache License 2.0

Java 0.78% Makefile 1.15% C++ 35.09% C 55.37% CMake 0.27% Shell 4.06% PostScript 0.01% HTML 1.04% Python 0.01% Groff 1.28% TeX 0.01% SAS 0.05% Assembly 0.06% Module Management System 0.06% Smalltalk 0.01% DIGITAL Command Language 0.04% Batchfile 0.02% Awk 0.15% ActionScript 0.04% Objective-C 0.52%

tesseract-ocr-ane's Introduction

Tesseract OCR ANE

Tesseract OCR Adobe Native Extension for Android & iOS.

Getting Started

NB: You'll need trained data files (https://github.com/tesseract-ocr/tessdata) to be located in tessdata directory (deployed together with your project or already available on target device) in order Tesseract engine to work.

In order to use Tesseract OCR in your AS3/AIR project:

  1. Add ANE to your project.

  2. Instatntiate the main ANE class:

    _ane = TesseractANE.getInstance();
    
  3. Setup recognition params:

    • (required!) absolute path to /tessdata folder, meaning "/storage/sdcard0/data/" to be provided if your tess data files are located at /storage/sdcard0/data/tessdata/ folder:
    _ane.absoluteTessdataPath = "<path>"; 
    
    • (optional, "eng" by default) set of languages to be used for recognition:
    _ane.language = "eng+rus";
    
    • (optional, "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" by default) set of chars to be recognized:
    _ane.charset = "123ABC";
    
  4. Setup recognition result listener:

    _ane.addEventListener(TesseractANEEvent.RECOGNIZED, onTextRecognized);
    ...
    protected function onTextRecognized(event:TesseractANEEvent):void {
        trace("end recoignizing " + event.uuid + " > " + event.text);
    }
    
  5. Pass BitmapData instance for OCR processing:

    var uuid : String = _ane.recognize(bitmap.bitmapData));
    

    The method will return UUID string value that can be used for identification in case you start some recognition processes simultaneousely.

  6. After the recognition process completes you'll receive TesseractANEEvent.RECOGNIZED event, containing recognized text and corresponding process UUID value.

    trace("end recoignizing " + event.uuid + " > " + event.text);
    

Usage Tips

  • The whole available set of trained data files require a lot of disk space, it's better to deploy files only for languages that you are going to use (see file names).

Customization Tips

  • Update path variables at the beginning of buildANE script for your platform (.bat for Win, .sh for OSX) before trying to rebuild ANE.
  • All the build scripts are processing files only inside the build folder and subfolders, so you'll need to copy all updated *.a, *.so or *.aar there yourself after making changes in native projects.
  • Due to the big size of resulting ANE file you can change buildANE script for your platform (.bat for Win, .sh for OSX) and extension.xml and rebuild ANE just for Android or iOS.

License

Tesseract OCR Adobe Native Extension is distributed under the Apache 2.0 license (see LICENSE.md).

Tesseract OCR iOS and TesseractOCR.framework, maintained by Daniele Galiotto (founder) (http://www.g8production.com), are distributed under the MIT license (see https://opensource.org/licenses/MIT).

Tess-two, maintained by Robert Theis (support page https://stackoverflow.com/questions/tagged/tess-two), is distributed under the Apache 2.0 license (see http://www.apache.org/licenses/LICENSE-2.0).

Tesseract, maintained by Google (http://code.google.com/p/tesseract-ocr/), is distributed under the Apache 2.0 license (see http://www.apache.org/licenses/LICENSE-2.0).

tesseract-ocr-ane's People

Contributors

vorlovsky avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tesseract-ocr-ane's Issues

Crash

Hello,

I came across your ane and thought to test it out on a Samsung Galaxy S3, however it crashes without any notice. The output that I receive is as follows....

RecognizeCommand
eng
1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
f9e0ba40-d621-41c3-9c75-4c2564232357
start recognition
bitmap 400 23
TessBaseAPI created
Debug session terminated.

Do you have any ideas why this crash occurs?

Many Thanks :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.