peterbence3 / Tesseract4Android

Fork of tess-two rewritten from scratch to support latest Android Studio and Tesseract 4.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tesseract4Android

Fork of tess-two rewritten from scratch to build with CMake and support latest Android Studio and Tesseract 4.

The Java/JNI wrapper files and tests for Leptonica / Tesseract are based on the tess-two project, which is based on Tesseract Tools for Android.

Dependencies

This project uses additional libraries (with their own specific licenses):

Prerequisites

  • Android 4.1 (API 16) or higher
  • A v4.0.0 trained data file(s) for language(s) you want to use. Data files must be copied to the Android device to a directory named tessdata.
  • If you want to use PdfRenderer, copy also pdf.ttf file to the tessdata directory.
  • Application must hold permission READ_EXTERNAL_STORAGE to access tessdata directory.

Building

You can use Android Studio 3.3 (or later) to open the project and build the AAR. Or you can use gradlew from command line.

To build the release version of the library, use task tesseract4android:assembleRelease. After successful build, you will have resulting AAR file in the <project dir>/tesseract4Android/build/outputs/aar/ directory.

Android Studio

  • Open this project in Android Studio.
  • Open Gradle panel, expand Tesseract4Android / :tesseract4Android / Tasks / other and run assembleRelease.

GradleW

  • In project directory create local.properties file containing:

    sdk.dir=c\:\\your\\path\\to\\android\\sdk
    ndk.dir=c\:\\your\\path\\to\\android\\ndk
    

    Note for paths on Windows you must use \ to escape some special characters, as in example above.

  • Call gradlew tesseract4android:assembleRelease from command line.

License

Copyright 2019 Adaptech s.r.o., Robert Pösel

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

Fork of tess-two rewritten from scratch to support latest Android Studio and Tesseract 4.

License:Apache License 2.0


Languages

Language:C 55.5%Language:C++ 30.6%Language:Roff 5.2%Language:Shell 4.5%Language:Makefile 1.8%Language:Java 1.0%Language:CMake 0.5%Language:HTML 0.3%Language:Awk 0.1%Language:M4 0.1%Language:Assembly 0.1%Language:Module Management System 0.1%Language:SAS 0.0%Language:WebAssembly 0.0%Language:DIGITAL Command Language 0.0%Language:Objective-C 0.0%Language:PostScript 0.0%Language:Batchfile 0.0%Language:Lua 0.0%Language:TeX 0.0%Language:Smalltalk 0.0%Language:Dockerfile 0.0%