Skip to content

Commit

Permalink
* Upgrade presets for Tesseract 4.0.0-beta.1 (issue #385)
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Apr 12, 2018
1 parent d8c2d6b commit 16d067c
Show file tree
Hide file tree
Showing 14 changed files with 335 additions and 293 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Update build for FFmpeg on Raspbian Stretch ([pull #548](https://github.com/bytedeco/javacpp-presets/pull/548))
* Add presets for TensorRT
* Fix build for FFmpeg on `android-x86` and `android-x86_64` platforms ([issue bytedeco/javacv#945](https://github.com/bytedeco/javacv/issues/945))
* Upgrade presets for HDF5 1.10.2, LLVM 6.0.0, TensorFlow 1.7.0
* Upgrade presets for HDF5 1.10.2, LLVM 6.0.0, Tesseract 4.0.0-beta.1 ([issue #385](https://github.com/bytedeco/javacpp-presets/issues/385)), TensorFlow 1.7.0

### March 29, 2018 version 1.4.1
* Disable unneeded error messages from LibTIFF in presets for Leptonica ([issue deeplearning4j/DataVec#518](https://github.com/deeplearning4j/DataVec/pull/518))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Each child module in turn relies by default on the included [`cppbuild.sh` scrip
* LLVM 6.0.0 http://llvm.org/releases/download.html
* libpostal 1.1-alpha https://github.com/openvenues/libpostal
* Leptonica 1.75.3 http://www.leptonica.org/download.html
* Tesseract 3.05.01 https://github.com/tesseract-ocr/tesseract
* Tesseract 4.0.0-beta.1 https://github.com/tesseract-ocr/tesseract
* Caffe 1.0 https://github.com/BVLC/caffe
* CUDA 9.1 https://developer.nvidia.com/cuda-downloads
* cuDNN 7.1 https://developer.nvidia.com/cudnn
Expand Down
2 changes: 1 addition & 1 deletion ci/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if "%APPVEYOR_PULL_REQUEST_NUMBER%" == "" if "%APPVEYOR_REPO_BRANCH%" == "releas

rem C:\msys64\usr\bin\bash -lc "pacman -Syu --noconfirm"
rem C:\msys64\usr\bin\bash -lc "pacman -Su --noconfirm"
C:\msys64\usr\bin\bash -lc "pacman -S --needed --noconfirm base-devel git tar nasm yasm pkg-config unzip autoconf automake libtool make patch gnupg"
C:\msys64\usr\bin\bash -lc "pacman -S --needed --noconfirm base-devel git tar nasm yasm pkg-config unzip autoconf autoconf-archive automake libtool make patch gnupg"
C:\msys64\usr\bin\bash -lc "pacman -S --needed --noconfirm mingw-w64-x86_64-toolchain mingw-w64-x86_64-libtool mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw-w64-i686-gcc mingw-w64-x86_64-gcc-fortran mingw-w64-i686-gcc-fortran mingw-w64-x86_64-libwinpthread-git mingw-w64-i686-libwinpthread-git mingw-w64-x86_64-SDL mingw-w64-i686-SDL"

C:\msys64\usr\bin\bash -lc "/c/projects/javacpp-presets/ci/install-windows.sh %PROJ%"
Expand Down
2 changes: 1 addition & 1 deletion ci/install-ppc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec 'echo "deb [arch=ppc64el] ht
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "sed -i 's/deb http/deb [arch=i386,amd64] http/g' /etc/apt/sources.list"
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "apt-get update > /dev/null"
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "apt-get -y install python python2.7 python-minimal python2.7-minimal libgtk2.0-dev:ppc64el libasound2-dev:ppc64el libusb-dev:ppc64el libusb-1.0-0-dev:ppc64el zlib1g-dev:ppc64el libxcb1-dev:ppc64el > /dev/null"
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "apt-get -y install pkg-config gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu gfortran-powerpc64le-linux-gnu linux-libc-dev-ppc64el-cross binutils-multiarch default-jdk ant maven python python-dev python-numpy swig git file wget unzip tar bzip2 patch autogen automake make libtool perl nasm yasm curl cmake3 > /dev/null"
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "apt-get -y install pkg-config gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu gfortran-powerpc64le-linux-gnu linux-libc-dev-ppc64el-cross binutils-multiarch default-jdk ant maven python python-dev python-numpy swig git file wget unzip tar bzip2 patch autoconf-archive autogen automake make libtool perl nasm yasm curl cmake3 > /dev/null"
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "apt-get -y remove libxdmcp-dev libx11-dev libxcb1-dev libxt-dev > /dev/null"

if [[ "$PROJ" =~ cuda ]]; then
Expand Down
6 changes: 3 additions & 3 deletions ci/install-travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if [[ "$OS" == "linux-x86" ]] || [[ "$OS" == "linux-x86_64" ]] || [[ "$OS" =~ an
DOCKER_CONTAINER_ID=$(docker ps | grep centos | awk '{print $1}')
echo "Container id is $DOCKER_CONTAINER_ID please wait while updates applied"
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "yum -y install centos-release-scl-rh epel-release" > /dev/null
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "yum -y install devtoolset-4-toolchain rh-java-common-ant rh-maven33 python27 clang gcc-c++ gcc-gfortran java-1.8.0-openjdk-devel ant maven python numpy swig git file which wget unzip tar bzip2 gzip xz patch make cmake3 libtool perl nasm yasm alsa-lib-devel freeglut-devel glfw-devel gtk2-devel libusb-devel libusb1-devel zlib-devel SDL-devel libva-devel" > /dev/null
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "yum -y install devtoolset-4-toolchain rh-java-common-ant rh-maven33 python27 clang gcc-c++ gcc-gfortran java-1.8.0-openjdk-devel ant maven python numpy swig git file which wget unzip tar bzip2 gzip xz patch make cmake3 autoconf-archive libtool perl nasm yasm alsa-lib-devel freeglut-devel glfw-devel gtk2-devel libusb-devel libusb1-devel zlib-devel SDL-devel libva-devel" > /dev/null
if [ "$OS" == "linux-x86" ]; then
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "rpm -qa | sed s/.x86_64$/.i686/ | xargs yum -y install > /dev/null"
fi
Expand Down Expand Up @@ -93,7 +93,7 @@ if [ "$OS" == "linux-armhf" ]; then
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get -y install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1
sudo apt-get -y install clang git file wget unzip tar bzip2 gzip patch autogen automake libtool perl nasm yasm libasound2-dev freeglut3-dev libglfw3-dev libgtk2.0-dev libusb-dev zlib1g
sudo apt-get -y install clang git file wget unzip tar bzip2 gzip patch autoconf-archive autogen automake libtool perl nasm yasm libasound2-dev freeglut3-dev libglfw3-dev libgtk2.0-dev libusb-dev zlib1g
git -C $HOME clone https://github.com/raspberrypi/tools
git -C $HOME clone https://github.com/raspberrypi/userland
export PATH=$PATH:$HOME/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin
Expand All @@ -118,7 +118,7 @@ if [ "$TRAVIS_OS_NAME" == "osx" ]; then
echo "performing brew update and install of dependencies, please wait.."
brew update > /dev/null
brew upgrade maven
brew install gcc swig libtool libusb nasm yasm xz sdl gpg1
brew install gcc swig autoconf-archive libtool libusb nasm yasm xz sdl gpg1
brew link --overwrite gcc
export PATH=/usr/local/opt/gpg1/libexec/gpgbin/:$PATH

Expand Down
2 changes: 1 addition & 1 deletion platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>tesseract-platform</artifactId>
<version>3.05.01-${project.version}</version>
<version>4.0.0-beta.1-${project.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
Expand Down
7 changes: 3 additions & 4 deletions tesseract/COPYING
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This package contains the Tesseract Open Source OCR Engine.
Orignally developed at Hewlett Packard Laboratories Bristol and
Originally developed at Hewlett Packard Laboratories Bristol and
at Hewlett Packard Co, Greeley Colorado, all the code
in this distribution is now licensed under the Apache License:

Expand All @@ -17,6 +17,5 @@ in this distribution is now licensed under the Apache License:
Other Dependencies and Licenses:
================================

Tesseract use Leptonica library (http://leptonica.com/) with a very weakly
restricted copyright license (http://leptonica.com/about-the-license.html)

Tesseract uses Leptonica library (http://leptonica.com/) which essentially
uses a BSD 2-clause license. (http://leptonica.com/about-the-license.html)
6 changes: 3 additions & 3 deletions tesseract/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Introduction
------------
This directory contains the JavaCPP Presets module for:

* Tesseract 3.05.01 https://github.com/tesseract-ocr
* Tesseract 4.0.0-beta.1 https://github.com/tesseract-ocr

Please refer to the parent README.md file for more detailed information about the JavaCPP Presets.

Expand Down Expand Up @@ -35,15 +35,15 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic
<modelVersion>4.0.0</modelVersion>
<groupId>org.bytedeco.javacpp-presets.tesseract</groupId>
<artifactId>BasicExample</artifactId>
<version>1.4.1</version>
<version>1.4.2-SNAPSHOT</version>
<properties>
<exec.mainClass>BasicExample</exec.mainClass>
</properties>
<dependencies>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>tesseract-platform</artifactId>
<version>3.05.01-1.4.1</version>
<version>4.0.0-beta.1-1.4.2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Expand Down
8 changes: 5 additions & 3 deletions tesseract/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [[ -z "$PLATFORM" ]]; then
exit
fi

TESSERACT_VERSION=3.05.01
TESSERACT_VERSION=4.0.0-beta.1
download https://github.com/tesseract-ocr/tesseract/archive/$TESSERACT_VERSION.tar.gz tesseract-$TESSERACT_VERSION.tar.gz

mkdir -p $PLATFORM
Expand Down Expand Up @@ -36,6 +36,8 @@ fi

LEPTONICA_PATH="${LEPTONICA_PATH//\\//}"

sedinplace 's/static string/static std::string/g' ccutil/unichar.h

case $PLATFORM in
android-arm)
# ANDROID_ROOT=${ANDROID_ROOT//14/21}
Expand Down Expand Up @@ -123,14 +125,14 @@ case $PLATFORM in
make install-strip
;;
windows-x86)
patch -Np1 < ../../../tesseract-windows.patch
#patch -Np1 < ../../../tesseract-windows.patch
cp vs2010/port/* ccutil/
./configure --prefix=$INSTALL_PATH --host="i686-w64-mingw32" CC="gcc -m32" CXX="g++ -m32 -fpermissive" LEPTONICA_CFLAGS="-I$LEPTONICA_PATH/include/leptonica/" LEPTONICA_LIBS="-L$LEPTONICA_PATH/lib/ -llept" CPPFLAGS="-I$LEPTONICA_PATH/include/" LDFLAGS="-L$LEPTONICA_PATH/lib/" LIBS="-llept"
make -j $MAKEJ
make install-strip
;;
windows-x86_64)
patch -Np1 < ../../../tesseract-windows.patch
#patch -Np1 < ../../../tesseract-windows.patch
cp vs2010/port/* ccutil/
./configure --prefix=$INSTALL_PATH --host="x86_64-w64-mingw32" CC="gcc -m64" CXX="g++ -m64 -fpermissive" LEPTONICA_CFLAGS="-I$LEPTONICA_PATH/include/leptonica/" LEPTONICA_LIBS="-L$LEPTONICA_PATH/lib/ -llept" CPPFLAGS="-I$LEPTONICA_PATH/include/" LDFLAGS="-L$LEPTONICA_PATH/lib/" LIBS="-llept"
make -j $MAKEJ
Expand Down
2 changes: 1 addition & 1 deletion tesseract/platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>tesseract-platform</artifactId>
<version>3.05.01-${project.parent.version}</version>
<version>4.0.0-beta.1-${project.parent.version}</version>
<name>JavaCPP Presets Platform for Tesseract</name>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion tesseract/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>tesseract</artifactId>
<version>3.05.01-${project.parent.version}</version>
<version>4.0.0-beta.1-${project.parent.version}</version>
<name>JavaCPP Presets for Tesseract</name>

<properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014-2015 Samuel Audet
* Copyright (C) 2014-2018 Samuel Audet
*
* Licensed either under the Apache License, Version 2.0, or (at your option)
* under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -32,13 +32,13 @@
*
* @author Samuel Audet
*/
@Properties(target="org.bytedeco.javacpp.tesseract", inherit=lept.class, value={
@Platform(define="TESS_CAPI_INCLUDE_BASEAPI", include={"tesseract/platform.h", "tesseract/apitypes.h", "tesseract/unichar.h", "tesseract/host.h",
@Properties(target = "org.bytedeco.javacpp.tesseract", inherit = lept.class, value = {
@Platform(define = "TESS_CAPI_INCLUDE_BASEAPI", include = {"tesseract/platform.h", "tesseract/apitypes.h", "tesseract/unichar.h", "tesseract/host.h",
"tesseract/tesscallback.h", "tesseract/publictypes.h", "tesseract/thresholder.h", "tesseract/pageiterator.h", "tesseract/ltrresultiterator.h",
"tesseract/resultiterator.h", "tesseract/strngs.h", "tesseract/genericvector.h", "tesseract/baseapi.h", "tesseract/capi.h"},
link="tesseract@.3"/*, resource = {"include", "lib"}*/),
@Platform(value="android", link="tesseract"),
@Platform(value="windows", link="libtesseract", preload="libtesseract-3") })
compiler = "cpp11", link = "tesseract@.4"/*, resource = {"include", "lib"}*/),
@Platform(value = "android", link = "tesseract"),
@Platform(value = "windows", link = "libtesseract", preload = "libtesseract-4") })
public class tesseract implements InfoMapper {
public void map(InfoMap infoMap) {
infoMap.put(new Info("__NATIVE__", "ultoa", "snprintf", "vsnprintf", "SIGNED",
Expand All @@ -65,14 +65,15 @@ public void map(InfoMap infoMap) {
.put(new Info("TessCallback1<STRING>").pointerTypes("StringClearCallback").define().virtualize())
.put(new Info("TessResultCallback2<bool,const STRING&,const STRING&>").pointerTypes("StringCompareCallback").define().virtualize())
.put(new Info("TessResultCallback2<bool,FILE*,const STRING&>").pointerTypes("StringWriteCallback").define().virtualize())
.put(new Info("TessResultCallback3<bool,FILE*,STRING*,bool>").pointerTypes("StringReadCallback").define().virtualize())
.put(new Info("TessResultCallback2<bool,tesseract::TFile*,char*>").pointerTypes("CharReadCallback").define().virtualize())
.put(new Info("TessResultCallback2<bool,tesseract::TFile*,STRING*>").pointerTypes("StringReadCallback").define().virtualize())
.put(new Info("GenericVector<STRING>").pointerTypes("StringGenericVector").define())
.put(new Info("GenericVector<STRING>::WithinBounds").skip())

.put(new Info("TessCallback1<int>").pointerTypes("IntClearCallback").define().virtualize())
.put(new Info("TessResultCallback2<bool,const int&,const int&>").pointerTypes("IntCompareCallback").define().virtualize())
.put(new Info("TessResultCallback2<bool,FILE*,const int&>").pointerTypes("IntWriteCallback").define().virtualize())
.put(new Info("TessResultCallback3<bool,FILE*,int*,bool>").pointerTypes("IntReadCallback").define().virtualize())
.put(new Info("TessResultCallback2<bool,tesseract::TFile*,int*>").pointerTypes("IntReadCallback").define().virtualize())
.put(new Info("GenericVector<int>").pointerTypes("IntGenericVector").define())
.put(new Info("GenericVector<StrongScriptDirection>").cast().pointerTypes("IntGenericVector"))
.put(new Info("GenericVectorEqEq<int>").pointerTypes("IntGenericVectorEqEq").define())
Expand Down
Loading

0 comments on commit 16d067c

Please sign in to comment.