NAME
tesseract - command line OCR engine
SYNOPSIS
tesseract imagename|stdin outputbase|stdout [options…] [configfile…]
DESCRIPTION
tesseract(1) is a commercial quality OCR engine originally developed at HP between 1985 and 1995. In 1995, this engine was among the top 3 evaluated by UNLV. It was open-sourced by HP and UNLV in 2005, and has been developed at Google since then.
IN/OUT ARGUMENTS
imagename
The name of the input image. Most image file
formats (anything readable by Leptonica) are supported.
stdin
Instruction to read data from standard input
outputbase
The basename of the output file (to which the
appropriate extension will be appended). By default the output will be named outbase.txt.
stdout
Instruction to sent output data to standard output
OPTIONS
--tessdata-dir /path
Specify the location of tessdata path
--user-words /path/to/file
Specify the location of user words file
--user-patterns /path/to/file
specify
The location of user patterns file
-c configvar=value
Set value for control parameter. Multiple -c
arguments are allowed.
-l lang
The language to use. If none is specified, English
is assumed. Multiple languages may be specified, separated by plus characters.
Tesseract uses 3-character ISO 639-2 language codes. (See LANGUAGES)
--psm N
Set Tesseract to only run a subset of layout
analysis and assume a certain form of image. The options for N
are:
0 = Orientation and script detection (OSD) only.
1 = Automatic page segmentation with OSD.
2 = Automatic page segmentation, but no OSD, or OCR.
3 = Fully automatic page segmentation, but no OSD. (Default)
4 = Assume a single column of text of variable sizes.
5 = Assume a single uniform block of vertically aligned text.
6 = Assume a single uniform block of text.
7 = Treat the image as a single text line.
8 = Treat the image as a single word.
9 = Treat the image as a single word in a circle.
10 = Treat the image as a single character.
configfile
The name of a config to use. A config is a
plaintext file which contains a list of variables and their values, one per
line, with a space separating variable from value. Interesting config files
include:
·
hocr - Output in hOCR format instead of as a
text file.
·
pdf - Output in pdf instead of a text file.
Nota Bene: The options -l lang and --psm N
must occur before any configfile. SINGLE OPTIONS
-v
Returns the current version of the tesseract(1)
executable.
--list-langs
list available languages for tesseract engine. Can
be used with --tessdata-dir.
--print-parameters
print tesseract parameters to the stdout.
TESSERACT MAnual details