Tesseract Open Source OCR Engine (main repository)

Tesseract OCR

Build Status Build status Build status
Coverity Scan Build Status Code Quality: Cpp Total Alerts OSS-Fuzz
GitHub license Downloads

Table of Contents

About

This package contains an OCR engine - libtesseract and a command line program - tesseract. Tesseract 4 adds a new neural net (LSTM) based OCR engine which is focused on line recognition, but also still supports the legacy Tesseract OCR engine of Tesseract 3 which works by recognizing character patterns. Compatibility with Tesseract 3 is enabled by using the Legacy OCR Engine mode (--oem 0). It also needs traineddata files which support the legacy engine, for example those from the tessdata repository.

The lead developer is Ray Smith. The maintainer is Zdenko Podobny. For a list of contributors see AUTHORS and GitHub's log of contributors.

Tesseract has unicode (UTF-8) support, and can recognize more than 100 languages "out of the box".

Tesseract supports various output formats: plain text, hOCR (HTML), PDF, invisible-text-only PDF, TSV. The main branch also has experimental support for ALTO (XML) output.

You should note that in many cases, in order to get better OCR results, you'll need to improve the quality of the image you are giving Tesseract.

This project does not include a GUI application. If you need one, please see the 3rdParty documentation.

Tesseract can be trained to recognize other languages. See Tesseract Training for more information.

Brief history

Tesseract was originally developed at Hewlett-Packard Laboratories Bristol and at Hewlett-Packard Co, Greeley Colorado between 1985 and 1994, with some more changes made in 1996 to port to Windows, and some C++izing in 1998. In 2005 Tesseract was open sourced by HP. From 2006 until November 2018 it was developed by Google.

The latest stable version is 5.0.0, released on November 30, 2021. Latest source code is available from main branch on GitHub. Open issues can be found in issue tracker, and planning documentation.

See Release Notes and Change Log for more details of the releases.

Installing Tesseract

You can either Install Tesseract via pre-built binary package or build it from source.

A C++ compiler with good C++17 support is required for building Tesseract from source.

Running Tesseract

Basic command line usage:

tesseract imagename outputbase [-l lang] [--oem ocrenginemode] [--psm pagesegmode] [configfiles...]

For more information about the various command line options use tesseract --help or man tesseract.

Examples can be found in the documentation.

For developers

Developers can use libtesseract C or C++ API to build their own application. If you need bindings to libtesseract for other programming languages, please see the wrapper section in the AddOns documentation.

Documentation of Tesseract generated from source code by doxygen can be found on tesseract-ocr.github.io.

Support

Before you submit an issue, please review the guidelines for this repository.

For support, first read the documentation, particularly the FAQ to see if your problem is addressed there. If not, search the Tesseract user forum, the Tesseract developer forum and past issues, and if you still can't find what you need, ask for support in the mailing-lists.

Mailing-lists:

Please report an issue only for a bug, not for asking questions.

License

The code in this repository is 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.

NOTE: This software depends on other packages that may be licensed under different open source licenses.

Tesseract uses Leptonica library which essentially uses a BSD 2-clause license.

Dependencies

Tesseract uses Leptonica library for opening input images (e.g. not documents like pdf). It is suggested to use leptonica with built-in support for zlib, png and tiff (for multipage tiff).

Latest Version of README

For the latest online version of the README.md see:

https://github.com/tesseract-ocr/tesseract/blob/main/README.md

Comments
  • RFC: Tesseract 4.0.0 – open tasks

    RFC: Tesseract 4.0.0 – open tasks

    I'd like to collect open tasks which should be addressed before tagging the official release 4.0.0.

    These tasks are on my own list and to be discussed whether we consider them important for the new release or not:

    • Remove deprecated code. This does not include OpenCL or the old Tesseract engine.
    • Add --version parameter for all command line commands.
    • Enhance --list-langs to show additional information for scripts and languages like legacy / LSTM, version. This will make the command slower, because each file must be opened and parsed.
    • Add option to optionally select implementation for dot product (CPU, SSE, AVX, ...).
    • Relative includes for traineddata: tessedit_load_sublangs should search for the sublangs relative to the parent, not starting in tessdata dir.
    • Maybe more fixes for compiler warnings and issues reported by Coverity Scan.
    • (list still incomplete)
  • Build Tesseract from source with Visual Studio

    Build Tesseract from source with Visual Studio


    Environment

    • Tesseract Version: 5.0.0 alfa
    • Commit Number: a1a177f
    • Platform:Windows 10 64 bit

    Current Behavior:

    I can not build from source i had download SW client and save it at "D:\Essam\Software\SW" the add to Path and i can run SW in command line and see WS information as follow D:\Tutorial\Git\tesseract\build>sw --version sw.client.sw version 1.0.0 git revision 083bb99144549c1f361298e8284daa6b54422965 assembled on 30.01.2020 18:36:29 Egypt Standard Time

    then i run the following commands to compile from source as describe in the following link https://github.com/tesseract-ocr/tesseract/wiki/Compiling the command are

    git clone https://github.com/tesseract-ocr/tesseract tesseract cd tesseract mkdir build && cd build cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=inst

    i receive the following error

    "-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18363. Configuring tesseract version 5.0.0-alpha-621-ga1a17... -- target changed from "auto" to "kaby-lake" CMake Error at CMakeLists.txt:197 (find_package): By not providing "FindSW.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "SW", but CMake did not find one.

    Could not find a package configuration file provided by "SW" with any of the following names:

    SWConfig.cmake
    sw-config.cmake
    

    Add the installation prefix of "SW" to CMAKE_PREFIX_PATH or set "SW_DIR" to a directory containing one of the above files. If "SW" provides a separate development package or SDK, be sure it has been installed.

    -- Configuring incomplete, errors occurred! See also "D:/Tutorial/Git/tesseract/build/CMakeFiles/CMakeOutput.log"."

    the log file attached

    CMakeOutput.log

    Expected Behavior:

    build tesseract solution

    Suggested Fix:

  • Tag a new version for LSTM  4.0

    Tag a new version for LSTM 4.0

    Many fixes have been made to master branch for 4.0 since the 4.00.00alpha release in November 2016. A number of assertions have been fixed.

    @zdenop Please add a new tag eg. 4.0.0alpha-1 / 2 (numbering as you consider appropriate). Thanks!

  • RFC: Remove the legacy OCR Engine

    RFC: Remove the legacy OCR Engine

    Ray wants to get rid of the legacy OCR engine, so that the final 4.00 version will only have one OCR engine based on LSTM.

    From #518:

    @stweil commented:

    I strongly vote against removing non-LSTM as we currently still get better results with it in some cases.

    @theraysmith commented:

    Please provide examples of where you get better results with the old engine. Right now I'm trying to work on getting rid of redundant code, rather than spending time fighting needless changes that generate a lot of work. I have recently tested an LSTM-based OSD, and it works a lot better than the old, so that is one more use of the old classifier that can go. AFAICT, apart from the equation detector, the old classifier is now redundant.

  • good accuracy but too slow, how to improve Tesseract speed

    good accuracy but too slow, how to improve Tesseract speed

    I integrated Tesseract C/C++, version 3.x, to read English OCR on images.

    It’s working pretty good, but very slow. It takes close to 1000ms (1 second) to read the attached image (00060.jpg) on my quad-core laptop.

    I’m not using the Cube engine, and I’m feeding only binary images to the OCR reader.

    Any way to make it faster. Any ideas on how to make Tesseract read faster? thanks 00060

  • Tesseract 4.0.0 crashed on Intel I5-8400 CPU with Debian 9.6.0 amd64 (SSE/AVX/AVX2)

    Tesseract 4.0.0 crashed on Intel I5-8400 CPU with Debian 9.6.0 amd64 (SSE/AVX/AVX2)

    Environment

    • Tesseract Version: 4.0.0 Release
    • Commit Number: 51316994ccae0b48692d547030f26c0969308214
    • Platform: Debian 9.6.0 amd64

    Current Behavior: Tesseract 4.0.0 crashed on Itel I5-8400 CPU with Debian 9.6.0 amd64 (SSE/AVX/AVX2).

    I compiled the tesseract 4.0 on Itel I5-8400 CPU with Debian 9.6.0 amd64. tesseract --version output this: tesseract 4.0.0 leptonica-1.74.2 libjpeg 6b (libjpeg-turbo 1.5.1) : libpng 1.6.28 : libtiff 4.0.8 : zlib 1.2.8 Found AVX2 Found AVX Found SSE

    When I call tesseract several times, crash happens and PC is reboot.

    I have a Intel G4650 CPU and this CPU not suport AVX2 / AVX and everything works fine! Never crash happens! How to make tesseract work fine on Intel I5-8400 with AVX/AVX2/SSE.

    Expected Behavior:

    Suggested Fix:

  • RFC: Add initial support for traineddata files in compressed archive formats (don't merge)

    RFC: Add initial support for traineddata files in compressed archive formats (don't merge)

    This requires libminizip-dev, so expect failures from CI.

    Up to now, little endian tesseract works with the new zip format.

    More work is needed for training tools and big endian support and also to maintain compatibility with the current proprietary format.

    Signed-off-by: Stefan Weil [email protected]

  • trying to add tessedit_char_whitelist etc. again:

    trying to add tessedit_char_whitelist etc. again:

    • ignore matrix outputs in ComputeTopN if they belong to a disabled unichar_id
    • pass UNICHARSET refs to check that
    • in SetBlackAndWhitelist, also update the unicharset of the lstm_recognizer_ instance, if any
  • RFC: Reorganize source tree

    RFC: Reorganize source tree

    I'd like to propose changes to tesseract source tree structure. Today the common way is to have src folder with all program stuff and include folder with public headers. Now we have a lot of dirs in the root - that's very annoying. On the first stage I propose:

    1. move all sources into src
    2. move training tools from training to tools/training

    Later we can try to move public headers to include directory.

    The new look will be like: pic

    If there are no objections, I'll commit changes.

  • 4.0 bugs on MAC OS X and a step by step for reference

    4.0 bugs on MAC OS X and a step by step for reference

    This is step by step that I used to install tesseract 4.0 on my MAC OS X and the fixes/workaround I needed to do so I could make it work. I'm sharing this "guide" with the intention of helping other people who may have the same problems I had.

    Special thanks for Shree that helped me at the google groups

    Project and more details: https://github.com/tesseract-ocr/tesseract

    where to get help?

    google group: https://groups.google.com/forum/#!forum/tesseract-ocr git: https://github.com/tesseract-ocr/tesseract/issues

    Platform: MAC OS X 10.13.3 Tesseract: 4.0.0-beta.1-69-g10f4 leptonica-1.75.3 libjpeg 9c : libpng 1.6.34 : libtiff 4.0.9 : zlib 1.2.11

    Found AVX2 Found AVX Found SSE

    Compiling Tesseract - tesseract 4.0

    Reference: https://github.com/tesseract-ocr/tesseract/wiki/Compiling#macos

    Warning: Don't install tesseract using brew, since you can't generate the ScrollView.jar from it! (At least I wasn't able to generate it)

    Steps

    1 - Install these libs

    brew install automake autoconf autoconf-archive libtool
    brew install pkgconfig
    brew install icu4c
    brew install leptonica
    brew install gcc
    

    2 - Run the code

    ln -hfs /usr/local/Cellar/icu4c/60.2 /usr/local/opt/icu4c
    

    Obs.: text2image is set to use icu4c/60.2 but the actual version is icu4c/61.1

    3 - Clone tesseract repo

    git clone https://github.com/tesseract-ocr/tesseract/
    

    4 - Enter in the folder

    cd tesseract
    

    5 - Run the script

    ./autogen.sh
    

    6 - Run the code, and copy the CPPFLAGS and LDFLAGS

    brew info icu4c
    

    7 - Update the CPPFLAGS and LDFLAGS and execute the code

    ./configure \
      CPPFLAGS=-I/usr/local/opt/icu4c/include \
      LDFLAGS=-L/usr/local/opt/icu4c/lib
    

    8 - Run the code

    make -j
    

    9 - Run the code

    sudo make install
    

    10 - Run the code

    sudo update_dyld_shared_cache
    

    Obs.: this is the sudo ldconfig version for MAC OS X

    11 - Run the code

    make training
    

    Creating ScrollView.jar - tesseract 4.0

    Reference: https://github.com/tesseract-ocr/tesseract/wiki/TrainingTesseract-4.00#lstmtraining-command-line https://github.com/tesseract-ocr/tesseract/wiki/ViewerDebugging

    Important: Use the JDK 8 to build, or else it is going to return an error

    Steps

    1 - Download the files piccolo2d-core-3.0.jar and piccolo2d-extras-3.0.jar

    http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-core/3.0/piccolo2d-core-3.0.jar http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0/piccolo2d-extras-3.0.jar

    2 - Move the files piccolo2d-core-3.0.jar and piccolo2d-extras-3.0.jar to tesseract/java

    3 - Enter the tesseract/java folder

    cd java
    

    4 - Set the var SCROLLVIEW_PATH to your tesseract/java folder and run the code

    SCROLLVIEW_PATH=~/projects/tesseract/java make ScrollView.jar
    

    Training Font - tesseract 4.0

    Reference: https://github.com/tesseract-ocr/tesseract/wiki/TrainingTesseract-4.00#user-content-using-tesstrain

    Steps

    1 - Clone the langdata dir from git

    git clone https://github.com/tesseract-ocr/langdata
    

    2 - Enter the tesseract folder

    cd ..
    

    3 - Execute this code and select one font from the list (I recommend "Verdana")

    text2image --list_available_fonts --fonts_dir=/Library/Fonts
    

    Font dir for MAC can be : ~/Library/Fonts /Library/Fonts/ /Network/Library/Fonts/ /System/Library/Fonts/ /System Folder/Fonts/

    More details here: https://support.apple.com/en-us/HT201722

    4 - replace the line 195 at file tesseract/training/tesstrain_utils.sh from

    - export FONT_CONFIG_CACHE=$(mktemp -d --tmpdir font_tmp.XXXXXXXXXX)
    + export FONT_CONFIG_CACHE=$(mktemp -d -t font_tmp.XXXXXXXXXX)
    

    Obs.: this is a fix for the error:

    mktemp: illegal option -- -
    usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
           mktemp [-d] [-q] [-u] -t prefix
    /Users/username/projects/tesseract/training/tesstrain_utils.sh: line 197: /sample_text.txt: Permission denied
    

    5 - Clone the tessdata repo from git (i recommend the "tessdata_best" since it is the more precise, "tessdata_fast" is just more fast)

    git clone https://github.com/tesseract-ocr/tessdata_best
    

    or

    git clone https://github.com/tesseract-ocr/tessdata_fast
    

    6 - Copy the tessdata_best/eng.traineddata (for english training) from the tessdata you just cloned and past at tesseract/tessdata/

    7 - Create the training data

    PANGOCAIRO_BACKEND=fc \
    ~/projects/tesseract/training/tesstrain.sh \
      --fonts_dir /Library/Fonts \
      --lang eng \
      --linedata_only \
      --noextract_font_properties \
      --exposures "0"    \
      --langdata_dir ~/projects/langdata \
      --tessdata_dir ~/projects/tesseract/tessdata \
      --fontlist "Verdana" \
      --output_dir ~/tesstutorial/engtrain
    

    Add the prefix PANGOCAIRO_BACKEND=fc if using MAC OSX

    8 - Create other training data using other font to compare

    PANGOCAIRO_BACKEND=fc \
    ~/projects/tesseract/training/tesstrain.sh \
      --fonts_dir /Library/Fonts \
      --lang eng \
      --linedata_only \
      --noextract_font_properties \
      --exposures "0"    \
      --langdata_dir ~/projects/langdata \
      --tessdata_dir ~/projects/tesseract/tessdata \
      --fontlist "Times New Roman," \
      --output_dir ~/tesstutorial/engeval
    

    Add the prefix PANGOCAIRO_BACKEND=fc if using MAC OSX

    9 - Create the needed folder

    mkdir -p ~/tesstutorial/engoutput
    

    10 - Start the training

    SCROLLVIEW_PATH=~/projects/tesseract/java \
    ~/projects/tesseract/training/lstmtraining \
    --debug_interval 100 \
    --traineddata ~/tesstutorial/engtrain/eng/eng.traineddata \
    --net_spec '[1,36,0,1 Ct3,3,16 Mp3,3 Lfys48 Lfx96 Lrx96 Lfx256 O1c111]' \
    --model_output ~/tesstutorial/engoutput/base \
    --learning_rate 20e-4 \
    --train_listfile ~/tesstutorial/engtrain/eng.training_files.txt \
    --eval_listfile ~/tesstutorial/engeval/eng.training_files.txt \
    --max_iterations 5000 &>~/tesstutorial/engoutput/basetrain.log
    

    Case you failed to build ScrollView.jar, set debug_interval to -1 --debug_interval -1

    11 - Monitor the log on another console

    tail -f ~/tesstutorial/engoutput/basetrain.log
    

    12 - Test Accuracy with other font

    ~/projects/tesseract/training/lstmeval \
      --model ~/tesstutorial/engoutput/base_checkpoint \
      --traineddata ~/tesstutorial/engtrain/eng/eng.traineddata \
      --eval_listfile ~/tesstutorial/engeval/eng.training_files.txt
    

    13 - Test Accuracy with best traindata

    ~/projects/tesseract/training/lstmeval \
      --model ~/projects/tessdata_best/eng.traineddata \
      --eval_listfile ~/tesstutorial/engeval/eng.training_files.txt
    

    14 - Test Accuracy with actual traindata (in this case the same as step 13)

    ~/projects/tesseract/training/lstmeval \
      --model ~/projects/tesseract/tessdata/eng.traineddata \
      --eval_listfile ~/tesstutorial/engtrain/eng.training_files.txt
    

    Fine tuning - tesseract 4.0

    Reference: https://github.com/tesseract-ocr/tesseract/wiki/TrainingTesseract-4.00#fine-tuning-for-impact

    Steps

    1 - Create the necessary folder

    mkdir -p ~/tesstutorial/verdana_from_small
    

    2 - Start to fine tuning

    ~/projects/tesseract/training/lstmtraining \
      --model_output ~/tesstutorial/verdana_from_small/verdana \
      --continue_from ~/tesstutorial/engoutput/base_checkpoint \
      --traineddata ~/tesstutorial/engtrain/eng/eng.traineddata \
      --train_listfile ~/tesstutorial/engeval/eng.training_files.txt \
      --max_iterations 1200
    

    3 - Validate the progress

    ~/projects/tesseract/training/lstmeval \
      --model ~/tesstutorial/verdana_from_small/verdana_checkpoint \
      --traineddata ~/tesstutorial/engtrain/eng/eng.traineddata \
      --eval_listfile ~/tesstutorial/engeval/eng.training_files.txt
    

    4 - Create the necessary folder

    mkdir -p ~/tesstutorial/verdana_from_full
    

    5 - Combine the trained data

    ~/projects/tesseract/training/combine_tessdata \
      -e ~/projects/tesseract/tessdata/eng.traineddata \
      ~/tesstutorial/verdana_from_full/eng.lstm
    

    6 - Train merged data

    ~/projects/tesseract/training/lstmtraining \
      --model_output ~/tesstutorial/verdana_from_full/verdana \
      --continue_from ~/tesstutorial/verdana_from_full/eng.lstm \
      --traineddata ~/projects/tesseract/tessdata/eng.traineddata \
      --train_listfile ~/tesstutorial/engeval/eng.training_files.txt \
      --max_iterations 400
    

    7 - Validate the results on the main training file

    ~/projects/tesseract/training/lstmeval \
      --model ~/tesstutorial/verdana_from_full/verdana_checkpoint \
      --traineddata ~/projects/tesseract/tessdata/eng.traineddata \
      --eval_listfile ~/tesstutorial/engeval/eng.training_files.txt
    

    8 - Validate the results on our training file

    ~/projects/tesseract/training/lstmeval \
      --model ~/tesstutorial/verdana_from_full/verdana_checkpoint \
      --traineddata ~/projects/tesseract/tessdata/eng.traineddata \
      --eval_listfile ~/tesstutorial/engtrain/eng.training_files.txt
    

    Fine tuning add ± character - tesseract 4.0

    Reference: https://github.com/tesseract-ocr/tesseract/wiki/TrainingTesseract-4.00#fine-tuning-for--a-few-characters

    Steps

    1 - Modify langdata/eng/eng.training_text and include these lines:

    alkoxy of LEAVES ±1.84% by Buying curved RESISTANCE MARKED Your (Vol. SPANIEL
    TRAVELED ±85¢ , reliable Events THOUSANDS TRADITIONS. ANTI-US Bedroom Leadership
    Inc. with DESIGNS self; ball changed. MANHATTAN Harvey's ±1.31 POPSET Os—C(11)
    VOLVO abdomen, ±65°C, AEROMEXICO SUMMONER = (1961) About WASHING Missouri
    PATENTSCOPE® # © HOME SECOND HAI Business most COLETTI, ±14¢ Flujo Gilbert
    Dresdner Yesterday's Dilated SYSTEMS Your FOUR ±90° Gogol PARTIALLY BOARDS firm
    Email ACTUAL QUEENSLAND Carl's Unruly ±8.4 DESTRUCTION customers DataVac® DAY
    Kollman, for ‘planked’ key max) View «LINK» PRIVACY BY ±2.96% Ask! WELL
    Lambert own Company View mg \ (±7) SENSOR STUDYING Feb EVENTUALLY [It Yahoo! Tv
    United by #DEFINE Rebel PERFORMED ±500Gb Oliver Forums Many | ©2003-2008 Used OF
    Avoidance Moosejaw pm* ±18 note: PROBE Jailbroken RAISE Fountains Write Goods (±6)
    Oberflachen source.” CULTURED CUTTING Home 06-13-2008, § ±44.01189673355 €
    netting Bookmark of WE MORE) STRENGTH IDENTICAL ±2? activity PROPERTY MAINTAINED
    

    2 - Generate the training file

    PANGOCAIRO_BACKEND=fc \
    ~/projects/tesseract/training/tesstrain.sh \
      --fonts_dir /Library/Fonts \
      --lang eng \
      --linedata_only \
      --noextract_font_properties \
      --langdata_dir ~/projects/langdata \
      --tessdata_dir ~/projects/tesseract/tessdata \
      --fontlist "Times New Roman," \
                  "Times New Roman, Bold" \
                  "Times New Roman, Bold Italic" \
                  "Times New Roman, Italic" \
                  "Courier New" \
                  "Courier New Bold" \
                  "Courier New Bold Italic" \
                  "Courier New Italic" \
      --output_dir ~/tesstutorial/trainplusminus
    

    3 - Generate the eval data

    PANGOCAIRO_BACKEND=fc \
    ~/projects/tesseract/training/tesstrain.sh \
      --fonts_dir /Library/Fonts \
      --lang eng \
      --linedata_only \
      --noextract_font_properties \
      --langdata_dir ~/projects/langdata \
      --tessdata_dir ~/projects/tesseract/tessdata \
      --fontlist "Verdana" \
      --output_dir ~/tesstutorial/evalplusminus
    

    4 - Combine trained data files

    ~/projects/tesseract/training/combine_tessdata \
      -e ~/projects/tesseract/tessdata/eng.traineddata \
      ~/tesstutorial/trainplusminus/eng.lstm
    

    5 - Fine tuning

    ~/projects/tesseract/training/lstmtraining \
      --model_output ~/tesstutorial/trainplusminus/plusminus \
      --continue_from ~/tesstutorial/trainplusminus/eng.lstm \
      --traineddata ~/tesstutorial/trainplusminus/eng/eng.traineddata \
      --old_traineddata ~/projects/tesseract/tessdata/eng.traineddata \
      --train_listfile ~/tesstutorial/trainplusminus/eng.training_files.txt \
      --max_iterations 3600
    

    6 - Test the result on other fonts

    ~/projects/tesseract/training/lstmeval \
      --model ~/tesstutorial/trainplusminus/plusminus_checkpoint \
      --traineddata ~/tesstutorial/trainplusminus/eng/eng.traineddata \
      --eval_listfile ~/tesstutorial/trainplusminus/eng.training_files.txt
    

    6 - Test the result test on main font

    ~/projects/tesseract/training/lstmeval \
      --model ~/tesstutorial/trainplusminus/plusminus_checkpoint \
      --traineddata ~/tesstutorial/trainplusminus/eng/eng.traineddata \
      --eval_listfile ~/tesstutorial/evalplusminus/eng.training_files.txt
    
  • Some programs can't find OCR text in Tesseract's PDFs (3.04)

    Some programs can't find OCR text in Tesseract's PDFs (3.04)

    While Acrobat XI can find text in a PDF, it appears that poppler's pdftotext program, OS X's Preview app, and the library PyPDF2's extractText() function all fail to locate text. It seems that Tesseract is encoding text in a way that makes it inaccessible to many PDF viewers.

    pdftotext produces empty output. Preview app allows highlighting of text in the appropriate locations, but it cannot be copied to the clipboard or searched. PyPDF2 extractText also produces an empty string as text.

  • Chopper interferes with associator in Legacy engine

    Chopper interferes with associator in Legacy engine

    Environment

    • Tesseract Version: 5.2.0
    • Commit Number: 15200c6fe7733f71a6cf52fbc1e4d94150f9f168
    • Platform: Linux ubuntu 5.15.0-43-generic

    Current Behavior:

    The legacy engine often fails to recognize words where characters towards the end of the word are comprised of multiple blobs. For example, the images below (and, high, and which) are misidentified as ancl, higll, and Whicll.

    mb_words_1_8_0_ancl_and mb_words_1_9_0_higli_high mb_words_3_1_0_whicli_which

    This issue is caused by the chopper. When disabling the chopper (chop_enable=0) all 3 words are identified correctly (capitalization notwithstanding). Notably, this is not a direct effect of the chopper splitting the last letter (in most cases the chopper does not change the best_choice), but rather that running the chopper prevents the associator from working correctly (which should join the last couple blobs into a single letter).

    The issue appears to be that the chopper creates additional blobs, and as this is not properly accounted for, no pain points exist for the last several blobs by the time the associator runs. In other words, when chop_enable=1 Tesseract does not even try to combine the last 2 blobs in the examples above.

    Suggested Fix:

    I'm creating a pull request that resolves by making sure InitialSegSearch (which creates pain points between blobs) runs directly before the associator step, regardless of whether the chopper is run. When this change is made the words above are identified correctly whether clop_enable=0 or clop_enable=1.

  • TesseractError: (-8, 'Estimating resolution as 1600')

    TesseractError: (-8, 'Estimating resolution as 1600')

    Before you submit an issue, please review the guidelines for this repository.

    Please report an issue only for a BUG, not for asking questions.

    Note that it will be much easier for us to fix the issue if a test case that reproduces the problem is provided. Ideally this test case should not have any external dependencies. Provide a copy of the image or link to files for the test case.

    Please delete this text and fill in the template below.


    Environment

    • Tesseract Version: 5.2.0
    • Commit Number:
    • Platform: Ubuntu 20

    Current Behavior:

    Using tesseract 5 via pytesseract and it throws the error:

    pytesseract.image_to_string(cell_img, lang='eng')).strip() File "/data/anaconda3/envs/tabstructnet_py_3.6/lib/python3.6/site-packages/pytesseract/pytesseract.py", line 417, in image_to_string }output_type File "/data/anaconda3/envs/tabstructnet_py_3.6/lib/python3.6/site-packages/pytesseract/pytesseract.py", line 416, in Output.STRING: lambda: run_and_get_output(*args), File "/data/anaconda3/envs/tabstructnet_py_3.6/lib/python3.6/site-packages/pytesseract/pytesseract.py", line 284, in run_and_get_output run_tesseract(**kwargs) File "/data/anaconda3/envs/tabstructnet_py_3.6/lib/python3.6/site-packages/pytesseract/pytesseract.py", line 260, in run_tesseract raise TesseractError(proc.returncode, get_errors(error_string)) pytesseract.pytesseract.TesseractError: (-8, 'Estimating resolution as 1600')

    Expected Behavior:

    Tried increasing the timeout value but still kept getting the error.

    Suggested Fix:

  • centos 7.9 tesseract5.2 cmake failed! boxchar.cpp:65:75: error...

    centos 7.9 tesseract5.2 cmake failed! boxchar.cpp:65:75: error...

    error INFO: /home/engine/wy/3rd/tesseract-5.2.0/src/training/pango/boxchar.cpp: In member function ‘void tesseract::BoxChar::GetDirection(int*, int*) const’: /home/engine/wy/3rd/tesseract-5.2.0/src/training/pango/boxchar.cpp:65:75: error: ‘U_RIGHT_TO_LEFT_ISOLATE’ was not declared in this scope; did you mean ‘U_RIGHT_TO_LEFT_OVERRIDE’? 65 | if (dir == U_RIGHT_TO_LEFT || dir == U_RIGHT_TO_LEFT_ARABIC || dir == U_RIGHT_TO_LEFT_ISOLATE) { | ^~~~~~~~~~~~~~~~~~~~~~~ | U_RIGHT_TO_LEFT_OVERRIDE

    Environment

    • Tesseract Version: 5.2.0
    • Commit Number: tag 5.2.0
    • Platform:centos7.9

    error.log shows details error.log

  • Cannot build the new traineddata

    Cannot build the new traineddata

    Environment

    • Tesseract Version: <Version('5.2.0.20220712')>
    • Commit Number:
    • Platform: windows 10 home 64 bits

    Current Behavior:

    === Starting training for language 'chi_tra' [Tue Aug 2 16:44:08 2022] /c/Program Files/Tesseract-OCR/text2image --fonts_dir=fonts --font=PMingLiU Book --outputbase=/tmp/font_tmp.S3O7LNYjEB/sample_text.txt --text=/tmp/font_tmp.S3O7LNYjEB/sample_text.txt --fontconfig_tmpdir=/tmp/font_tmp.S3O7LNYjEB Rendered page 0 to file C:/Users/joe_c/AppData/Local/Temp/font_tmp.S3O7LNYjEB/sample_text.txt.tif

    === Phase I: Generating training images === Rendering using PMingLiU Book [Tue Aug 2 16:44:10 2022] /c/Program Files/Tesseract-OCR/text2image --fontconfig_tmpdir=/tmp/font_tmp.S3O7LNYjEB --fonts_dir=fonts --strip_unrenderable_words --leading=32 --xsize=3600 --char_spacing=0.0 --exposure=0 --outputbase=/tmp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0 --max_pages=10 --font=PMingLiU Book --text=langdata_lstm/chi_tra/chi_tra.training_text Rendered page 0 to file C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.tif Stripped 1 unrenderable words Rendered page 1 to file C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.tif Rendered page 2 to file C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.tif Rendered page 3 to file C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.tif Rendered page 4 to file C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.tif Stripped 2 unrenderable words Rendered page 5 to file C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.tif Rendered page 6 to file C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.tif Rendered page 7 to file C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.tif Rendered page 8 to file C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.tif Rendered page 9 to file C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.tif

    === Phase UP: Generating unicharset and unichar properties files === [Tue Aug 2 16:44:15 2022] /c/Program Files/Tesseract-OCR/unicharset_extractor --output_unicharset /tmp/chi_tra-2022-08-02.2wo/chi_tra.unicharset --norm_mode 1 /tmp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.box Extracting unicharset from box file C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.box Mirror 〕 of 〔 is not in unicharset Wrote unicharset file C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.unicharset [Tue Aug 2 16:44:15 2022] /c/Program Files/Tesseract-OCR/set_unicharset_properties -U /tmp/chi_tra-2022-08-02.2wo/chi_tra.unicharset -O /tmp/chi_tra-2022-08-02.2wo/chi_tra.unicharset -X /tmp/chi_tra-2022-08-02.2wo/chi_tra.xheights --script_dir=langdata_lstm Loaded unicharset of size 2849 from file C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.unicharset Setting unichar properties Mirror 〕 of 〔 is not in unicharset Setting script properties Warning: properties incomplete for index 2515 = , Writing unicharset to file C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.unicharset

    === Phase E: Generating lstmf files === Using TESSDATA_PREFIX=tessdata [Tue Aug 2 16:44:16 2022] /c/Program Files/Tesseract-OCR/tesseract /tmp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.tif /tmp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0 --psm 6 lstm.train langdata_lstm/chi_tra/chi_tra.config Page 1 Page 2 Loaded 36/36 lines (1-36) of document C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.lstmf Page 3 Loaded 71/71 lines (1-71) of document C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.lstmf Page 4 Loaded 105/105 lines (1-105) of document C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.lstmf Page 5 Loaded 140/140 lines (1-140) of document C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.lstmf Page 6 Loaded 175/175 lines (1-175) of document C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.lstmf Page 7 Loaded 210/210 lines (1-210) of document C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.lstmf Page 8 Loaded 246/246 lines (1-246) of document C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.lstmf Page 9 Loaded 281/281 lines (1-281) of document C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.lstmf Page 10 Loaded 315/315 lines (1-315) of document C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.lstmf

    === Constructing LSTM training data === [Tue Aug 2 16:44:20 2022] /c/Program Files/Tesseract-OCR/combine_lang_model --input_unicharset /tmp/chi_tra-2022-08-02.2wo/chi_tra.unicharset --script_dir langdata_lstm --words langdata_lstm/chi_tra/chi_tra.wordlist --numbers langdata_lstm/chi_tra/chi_tra.numbers --puncs langdata_lstm/chi_tra/chi_tra.punc --output_dir train --lang chi_tra Loaded unicharset of size 2849 from file C:/Users/joe_c/AppData/Local/Temp/chi_tra-2022-08-02.2wo/chi_tra.unicharset Setting unichar properties Mirror 〕 of 〔 is not in unicharset Setting script properties Warning: properties incomplete for index 2515 = , Config file is optional, continuing... Null char=2 Reducing Trie to SquishedDawg Reducing Trie to SquishedDawg Reducing Trie to SquishedDawg

    === Saving box/tiff pairs for training data === Moving /tmp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.box to train Moving /tmp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.tif to train

    === Moving lstmf files for training data === Moving /tmp/chi_tra-2022-08-02.2wo/chi_tra.PMingLiU_Book.exp0.lstmf to train

    Created starter traineddata for LSTM training of language 'chi_tra'

    Run 'lstmtraining' command to continue LSTM training for language 'chi_tra'

    Extracting tessdata components from tessdata/chi_tra.traineddata Wrote train/chi_tra.lstm Version: 0:config:size=2043, offset=192 17:lstm:size=12165163, offset=2235 18:lstm-punc-dawg:size=2602, offset=12167398 19:lstm-word-dawg:size=435354, offset=12170000 20:lstm-number-dawg:size=82, offset=12605354 21:lstm-unicharset:size=295682, offset=12605436 22:lstm-recoder:size=84529, offset=12901118 23:version:size=151, offset=12985647 Must provide a --traineddata see training documentation Must provide a --traineddata see training documentation

    Nothing in the output folder

    Expected Behavior:

    Can build the trainneddate

    Suggested Fix:

Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform AAA Open 3D Engine
Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform AAA Open 3D Engine

Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform 3D engine that enables developers and content creators to build AAA games, cinema-quality 3D worlds, and high-fidelity simulations without any fees or commercial obligations.

Aug 10, 2022
A completely free, open-source, 2D game engine built on proven torque technology.
A completely free, open-source, 2D game engine built on proven torque technology.

Torque2D 4.0 Early Access 1 MIT Licensed Open Source version of Torque2D from GarageGames. Maintained by the Torque Game Engines team and contribution

Aug 10, 2022
Open-source, cross-platform, C++ game engine for creating 2D/3D games.

GamePlay v3.0.0 GamePlay is an open-source, cross-platform, C++ game framework/engine for creating 2D/3D mobile and desktop games. Website Wiki API De

Aug 6, 2022
appleseed is an open source, physically-based global illumination rendering engine primarily designed for animation and visual effects.
appleseed is an open source, physically-based global illumination rendering engine primarily designed for animation and visual effects.

appleseed is an open source, physically-based global illumination rendering engine primarily designed for animation and visual effects.

Aug 10, 2022
The official Open-Asset-Importer-Library Repository. Loads 40+ 3D-file-formats into one unified and clean data structure.

Open Asset Import Library (assimp) A library to import and export various 3d-model-formats including scene-post-processing to generate missing render

Aug 17, 2022
Horde3D is a small 3D rendering and animation engine. It is written in an effort to create an engine being as lightweight and conceptually clean as possible.

Horde3D Horde3D is a 3D rendering engine written in C++ with an effort being as lightweight and conceptually clean as possible. Horde3D requires a ful

Aug 15, 2022
Brand new engine with new and QoL features. Grafex is Psych engine with some additions and Better graphics

Friday Night Funkin' - Graphex Engine Credits: Grafex Mod aka Psych Graphic Rework: Xale - Lead Coding, Artist PurpleSnake - Second Coder Psych Engine

Aug 9, 2022
ORE (OpenGL Rendering Engine) is a rendering engine developed for my college minor project assessment.
ORE (OpenGL Rendering Engine) is a rendering engine developed for my college minor project assessment.

ORE (OPENGL RENDERING ENGINE) What is ORE? ORE(OpenGL Rendering Engine) is a rendering engine with great and easy to use UI that allows the user to lo

Dec 20, 2021
An integration of Live++ for Open 3D Engine

LivePlusPlus_O3DE_Gem An integration of https://liveplusplus.tech/ for Open 3D Engine (Windows only). See Open 3D Engine at https://github.com/o3de/o3

Jul 27, 2022
An Open-Source subdivision surface library.

OpenSubdiv OpenSubdiv is a set of open source libraries that implement high performance subdivision surface (subdiv) evaluation on massively parallel

Aug 9, 2022
An open-source implementation of Autodesk's FBX

SmallFBX An open-source implementation of Autodesk's FBX that is capable of import & export mesh, blend shape, skin, and animations. Mainly intended t

Jun 30, 2022
The open-source tool for creating of 3D models
The open-source tool for creating of 3D models

The open-source tool for creating of 3D models

Aug 5, 2022
StereoKit is an easy-to-use open source mixed reality library for building HoloLens and VR applications with C# and OpenXR!
StereoKit is an easy-to-use open source mixed reality library for building HoloLens and VR applications with C# and OpenXR!

StereoKit is an easy-to-use open source mixed reality library for building HoloLens and VR applications with C# and OpenXR! Inspired by libraries like XNA and Processing, StereoKit is meant to be fun to use and easy to develop with, yet still quite capable of creating professional and business ready software.

Aug 8, 2022
OpenCorr is an open source C++ library for development of 2D, 3D/stereo, and volumetric digital image correlation
OpenCorr is an open source C++ library for development of 2D, 3D/stereo, and volumetric digital image correlation

OpenCorr OpenCorr is an open source C++ library for development of 2D, 3D/stereo, and volumetric digital image correlation. It aims to provide a devel

Jul 30, 2022
Open source Altium Database Library with over 147,000 high quality components and full 3d models.
Open source Altium Database Library with over 147,000 high quality components and full 3d models.

Open source Altium Database Library with over 147,000 high quality components and full 3d models.

Aug 14, 2022
Vizzu is a free, open-source Javascript/C++ library for animated data visualizations and data stories.
Vizzu is a free, open-source Javascript/C++ library for animated data visualizations and data stories.

Vizzu is a free, open-source Javascript/C++ library utilizing a generic dataviz engine that generates many types of charts and seamlessly animates between them

Aug 14, 2022
Cocos2d-x is a suite of open-source, cross-platform, game-development tools used by millions of developers all over the world.
Cocos2d-x is a suite of open-source, cross-platform, game-development tools used by millions of developers all over the world.

Cocos2d-x is a suite of open-source, cross-platform, game-development tools used by millions of developers all over the world.

Aug 17, 2022
Open-Source Vulkan C++ API

Vulkan-Hpp: C++ Bindings for Vulkan The goal of the Vulkan-Hpp is to provide header only C++ bindings for the Vulkan C API to improve the developers V

Aug 15, 2022
ZBar Bar Code Reader is an open source software suite for reading bar codes from various sources

ZBar Bar Code Reader is an open source software suite for reading bar codes from various sources

Aug 8, 2022