jTessBoxEditor is a box editor and trainer for Tesseract OCR, providing editing of box data of both Tesseract 2.0x and 3.0x formats and full automation of Tesseract training. It can read images of common image formats, including multi-page TIFF. The program requires Java Runtime Environment 7 or later.
jTessBoxEditorFX is jTessBoxEditor rewritten in JavaFX to address the existing issue of rendering complex scripts in Java Swing. It requires JRE 8u40 or later.
jTessBoxEditor is released and distributed under the Apache License, v2.0.
Double click on the JAR file to launch the program, or execute the following command:
java -Xms128m -Xmx1024m -jar jTessBoxEditor.jar
jTessBoxEditor Swing UI
You will need to provide the TIFF/Box files as input to the editor. Images to be used in training should be of 300 DPI and 1 bpp (bit per pixel) black&white or 8 bpp grayscale uncompressed TIFF format; box files, encoded in UTF-8 format, are generated by Tesseract executables with appropriate command-line options (see Tesseract Training Wiki). Or they both can be created using the built-in TIFF/Box Generator.
Note that the coordinate system used in the box file has (0,0) at the bottom-left; on computer graphics devices, however, (0,0) is defined as top-left. jTessBoxEditor uses and displays in the graphics device coordinates. The edited box files are still read and written in proper format.
The generator produces, for a given input UTF-8 text file, a TIFF/Box pair of files suitable for training with Tesseract. The generated image is, depending on anti-aliasing mode enabled, a binary or 8-bpp grayscale, uncompressed multi-page TIFF with 300-DPI resolution. Noise can optionally be added to the image, which could result in better trainned data. Letter tracking, or spacing between characters, can be adjusted to eliminate bounding box overlapping issues. Note that some boxes could be slightly different (by 1 or 2 pixels) from the ones that would have been generated by Tesseract itself; nevertheless, the generated box file can be used to validate the one created by Tesseract with the use of a Unicode-compatible file compare tool, such as WinMerge.
Tips: Experiments indicate that the quality of training with images created by TIFF/Box Generator is higher with font sizes 24pt or greater and with some noise added.
Notes: Tesseract's new text2image tool is currently not usable on Windows.
Combining symbols or diacritics, like those found in Devanagari or Indic scripts,
that need to be combined with the main, base character can be specified by the user
in a UTF-8 text file, specifically
data/combiningsymbols.txt, which is
read by Generate TIFF/Box function. This setup gives the users the flexibility
in defining combining symbols/diacritics for their language scripts.
For automated training, be sure to
build all the necessary Tesseract executables if needed; Windows
executables are already bundled with the program. Place all required source
training data files, prefixed with an appropriate language code, in a specified
samples folder for examples. The training process can also be automated
train.ps1, a Windows PowerShell script.
The Merge TIFF function can save multiple images containing text of the same font into a single multi-page TIFF file for convenient training. A conversion function is included to convert numeric character reference (NCR) and escape sequence in the Character text field to Unicode characters.
If there is any question, please post in VietOCR Forums.