All Projects → Anyline → Anyline Ocr React Native Module

Anyline / Anyline Ocr React Native Module

Licence: other
Anyline React Native Module for iOS and Android

Projects that are alternatives of or similar to Anyline Ocr React Native Module

Doccreator
DIAR software for synthetic document image and groundtruth generation, with various degradation models for data augmentation
Stars: ✭ 60 (-27.71%)
Mutual labels:  ocr
Caffe ocr
主流ocr算法研究实验性的项目,目前实现了CNN+BLSTM+CTC架构
Stars: ✭ 1,156 (+1292.77%)
Mutual labels:  ocr
Papermerge
Open Source Document Management System for Digital Archives (Scanned Documents)
Stars: ✭ 1,177 (+1318.07%)
Mutual labels:  ocr
Ttkocr
OCR 识别图片以及PDF中的文字, based on Qt for windows and linux.
Stars: ✭ 65 (-21.69%)
Mutual labels:  ocr
Crnn
Convolutional recurrent neural network for scene text recognition or OCR in Keras
Stars: ✭ 68 (-18.07%)
Mutual labels:  ocr
Sar tf
This is an implementation of Show, Attend and Read with tensorflow
Stars: ✭ 70 (-15.66%)
Mutual labels:  ocr
Open Semantic Search Apps
Python/Django based webapps and web user interfaces for search, structure (meta data management like thesaurus, ontologies, annotations and named entities) and data import (ETL like text extraction, OCR and crawling filesystems or websites)
Stars: ✭ 55 (-33.73%)
Mutual labels:  ocr
Ai Reading Materials
Some of the ML and DL related reading materials, research papers that I've read
Stars: ✭ 79 (-4.82%)
Mutual labels:  ocr
Dbnet Lite.pytorch
A pytorch re-implementation of Real-time Scene Text Detection with Differentiable Binarization
Stars: ✭ 69 (-16.87%)
Mutual labels:  ocr
Patter
speech-to-text in pytorch
Stars: ✭ 71 (-14.46%)
Mutual labels:  ocr
Ultimatemrz Sdk
Machine-readable zone/travel document (MRZ / MRTD) detector and recognizer using deep learning
Stars: ✭ 66 (-20.48%)
Mutual labels:  ocr
Scanbot Sdk Example Android
Document scanning SDK example apps for the Scanbot SDK for Android.
Stars: ✭ 67 (-19.28%)
Mutual labels:  ocr
Snipit
Snipit allows you to capture and save interesting sections from any source of information. Be it textbooks, journals, computer screens, photographs, flyers, writings on a whiteboard, etc.
Stars: ✭ 70 (-15.66%)
Mutual labels:  ocr
Cnn lstm ctc ocr for icpr
Forked from weinman/cnn_lstm_ctc_ocr for the ICPR MTWI 2018 challenge 1
Stars: ✭ 62 (-25.3%)
Mutual labels:  ocr
Php Apache Tika
Apache Tika bindings for PHP: extract text and metadata from documents, images and other formats
Stars: ✭ 76 (-8.43%)
Mutual labels:  ocr
Sane Scan Pdf
Sane command-line scan-to-pdf script on Linux with OCR and deskew support
Stars: ✭ 58 (-30.12%)
Mutual labels:  ocr
Textshot
Python tool for grabbing text via screenshot
Stars: ✭ 1,163 (+1301.2%)
Mutual labels:  ocr
Crnn With Stn
implement CRNN in Keras with Spatial Transformer Network
Stars: ✭ 83 (+0%)
Mutual labels:  ocr
Ctpn
Detecting Text in Natural Image with Connectionist Text Proposal Network (ECCV'16)
Stars: ✭ 1,220 (+1369.88%)
Mutual labels:  ocr
Lstm Ctc Ocr
using rnn (lstm or gru) and ctc to convert line image into text, based on torch7 and warp-ctc
Stars: ✭ 70 (-15.66%)
Mutual labels:  ocr
 _____         _ _         
|  _  |___ _ _| |_|___ ___ 
|     |   | | | | |   | -_|
|__|__|_|_|_  |_|_|_|_|___|
          |___|            

Anyline React-Native Plugin

Anyline is mobile OCR SDK, which can be configured by yourself to scan all kinds of numbers, characters, text and codes.

The plugin enables the connection to the SDK via React-Native.

Update to >= 5.0

If you use this plugin with a equal or greater version then 5.0, you can use our new Anyline structure, which will provide the whole configuration of every SDK Feature through the config file. If you use the the 'scan' call in your Javascript files, you have to use a new config style. The old calls with the old configurations will still work.

Requirements:

iOS

Platform >= 10

Android

minSDK >= 19

Example

Take a look into example/RNExampleApp/src/Result.js to see the implementation.

Quick Start Guide

1. Get a License

Get your trial license to try Anyline inside your app. Reach out to our sales team to get a commercial license.

2. Get the Anyline react-native plugin

Via npm:

 npm i anyline-ocr-react-native-module

or download / clone this repository and copy the content of the plugin folder into node_modules inside a new folder named anyline-ocr-react-native-module:

project   
│    android
│    ios
└─── node_modules
     │    ...
     └─── anyline-ocr-react-native-module

Install react-native-cli

npm i -g react-native-cli

Link the project. Run as root inside your project root:

react-native link

3. Get the native Dependencies

Android

Setup Packages

The package name must match with the bundleID from your Anyline license.

Add the Anyline package

Open MainApplication.java inside your native Android folder of your project:

Import AnylinePackage

import com.anyline.reactnative.AnylinePackage;

and add the package to your getPackages method

@Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
            new AnylinePackage()
      );
    }
Add repositories to your app

You need to add the Anyline and the google repository to your build.gradle, so gradle does know, where to find these.

To do this open yourApp/android/build.gradle and add this to allprojects:

allprojects {
    repositories {
    	...
        google()
        maven {
            url 'https://anylinesdk.blob.core.windows.net/maven/'
        }
    }
}

Issues

Strict mode does not allow function declarations in a lexically nested statement.

http://stackoverflow.com/a/41076153/2157717

duplicate files during packaging of APK

packagingOptions {
  pickFirst 'lib/armeabi-v7a/libgnustl_shared.so'
  pickFirst 'lib/x86/libgnustl_shared.so'
}

iOS

Podfile
  • Copy the Podfile from our example Project into your native iOS root folder.
  • Change the target and project of the Podfile to your project name.
  • pod update
    • if you get an error about node_modules dependencies initialize your project with npm install first.
Permissions

Add camera permissions to Info.plist

Privacy - Camera Usage Description

Add also every other permission you want to configure in your config.js (vibrate, sound).

Anyline License

Your BundleIdentifier of your app has to match with your bundleID from your Anyline License.

4. Import the plugin into your JavaScript file

import AnylineOCR from 'anyline-ocr-react-native-module';

5. Import the config file

import config from './config.js';

Add and import a JSON file with the proper structure and elements. The JSON config contains:

  1. The license key

  2. Options field with

  • AnylineSDK config parameter
  • “segment”: which contains the scanModes for the UI Segment (e.g. switch between Analog and Digital) - optional
  1. OCR field with (Only if you want to use the OCR module)
  • your custom training data
  • RegEx validation

If you want to get detailed information about the config JSON, check out the official documentation.

6. Call the Anyline component

Callbacks

AnylineOCR.setup(
        JSON.stringify(config),
        'scan',
        this.onResult,
        this.onError
    );

Promise

const openAnyline = async () => {
    ...
    
    try {
        const result = await AnylineOCR.setupPromise(JSON.stringify(config), 'scan');
    } catch(error) {
        console.error(error);
    }
    
    ...
}
Deprecated
AnylineOCR.setupScanViewWithConfigJson(
        JSON.stringify(config),
        'scan',
        this.onResult,
        this.onError
    );

7. Add TrainData to the OCR Module

If you are using the ANYLINE_OCR module, you'll have to add some traineddata. There are some predefined traineddata which you can find in the example app. Also the OCR Config has to reflect the path. Check the VoucherConfig.js in the example/RNExampleApp/config folder.

IMPORTANT: The trainedFiles have to be directly in the Asset folder in Android.

iOS

ios   
 └─── myTrainedData.traineddata

Android

android   
   └─── app
         └─── src
               └─── main
                      └─── assets
                             └─── myTrainedData.traineddata || myTrainedData.any

Props

Key Type Default Description
config string *required config (JSON String)
scanMode string *required In the new Version, this is always 'scan', and the scanMode is declared through the configuration
onResult function *required The function you pass will be the onResult callback. Use this callback to handle the found scan results.
onError function *required The onError function will be called when the AnylinePlugin encounters an error. Handle the error messages in this method.

config

Stringified JSON with all the configurations, detailed information here.

Keep in mind, that you have to add every permission to your project, you add in the config (vibrateOnResult -> vibration permission)

onResult Function

Callback -> Stringified JSON

{
    reading : 'Result of the Scan',
    imagePath : 'path to cropped image',
    fullImagePath : 'path to full image',
    barcode : 'result of the simultaneous barcode scanning',
    scanMode : 'selected scanMode',
    meterType : 'meter type'
}

More information about the simultaneous barcode scanning here.

onError Function

Callback -> String

  • String errorMessage

Additional Functions

getLicenseExpiryDate

Get the exparation date of the provided license. Returns a string.

import AnylineOCR, { getLicenseExpiryDate } from 'anyline-ocr-react-native-module';

...

console.log(getLicenseExpiryDate(myLicenseString)); // 'YYYY-MM-DD'
...

Images

Keep in mind, all the images are saved in the cache directory of the app. For performance reasons, we only provide the path as string, so we don't have to transfer the whole image through the bridge. Please be aware, that you should not use the images in the cache directory for persistent storage, but store the images in a location of your choice for persistence.

License

See LICENSE file.

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