with sample app

Priyank Verma 75501ac1db Add usage in Readme.md file. 9 年之前
app 5c120c72ac Increase the text size of the text view. 9 年之前
easy_ocr_library c561056848 Add library. Add demo app. 9 年之前
gradle c561056848 Add library. Add demo app. 9 年之前
.gitignore c561056848 Add library. Add demo app. 9 年之前
.gitignore~ c561056848 Add library. Add demo app. 9 年之前
EasyOcrScanner.iml c561056848 Add library. Add demo app. 9 年之前
README.md 75501ac1db Add usage in Readme.md file. 9 年之前
build.gradle c561056848 Add library. Add demo app. 9 年之前
gradle.properties c561056848 Add library. Add demo app. 9 年之前
gradlew c561056848 Add library. Add demo app. 9 年之前
gradlew.bat c561056848 Add library. Add demo app. 9 年之前
settings.gradle c561056848 Add library. Add demo app. 9 年之前

README.md

# Easy-Ocr-Scanner-Android Easiest and simplest OCR scanner library for Android built using Tesseract and Leptonica.

About

Easy OCR Library is made by having only one goal in mind: Making OCR as easy as possible. (Don't you just love when things actually mean what they show).

Easy OCR uses a fork of tesseract, Tess Two. But deals with all the pain of setting up and building the library using NDK.

Usage

Using EasyOcrLibrary is as simple as it can get.

Step 0

Copy your trained data file into the assets/tessdata folder. You can download the required .traineddata file from here.

Step 1

NOTE : "eng" is the name of the traineddata file as here we are using eng.traineddata .

 // initialize EasyOcrScanner instance.
mEasyOcrScanner = new EasyOcrScanner(MainActivity.this, "EasyOcrScanner",
        Config.REQUEST_CODE_CAPTURE_IMAGE, "eng");

Step 2

Implement java EasyOcrScannerListener.

implements EasyOcrScannerListener

Then define the callbacks.

Step 3

Start the scan!

mEasyOcrScanner.takePicture();

Step 4

Call java onImageTaken() in java onActivityResult()

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        // Call onImageTaken() in onActivityResult.
        if (resultCode == RESULT_OK && requestCode == Config.REQUEST_CODE_CAPTURE_IMAGE){
            mEasyOcrScanner.onImageTaken();
        }
    }

And you are done!

Get the scaned text in the callback java onOcrScanFinished().

For more info check the sample app in the app module.