man pages included to install script, improved windows installer script (issue 425), output format for "tesseract -v" changed to "3.00 version", README cleanup.

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@601 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
zdenop@gmail.com 2011-08-08 20:33:18 +00:00
parent 411e074b4d
commit 9b9efa8e4c
6 changed files with 245 additions and 220 deletions

View File

@ -1,13 +1,12 @@
# TODO(luc) Add 'doc' to this list when ready
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = ccstruct ccutil classify cube cutil dict image neural_networks/runtime textord viewer wordrec ccmain training tessdata testing java api
SUBDIRS = ccstruct ccutil classify cube cutil dict image neural_networks/runtime textord viewer wordrec ccmain training tessdata testing java api doc
#if USING_GETTEXT
#SUBDIRS += po
#AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
#endif
EXTRA_DIST = config/config.rpath eurotext.tif phototest.tif ReleaseNotes \
acinclude.m4 config configure.ac runautoconf tesseract.spec doc contrib
acinclude.m4 config configure.ac runautoconf tesseract.spec contrib
#EXTRA_DIST = doc/html doc/@PACKAGE_NAME@_@PACKAGE_VERSION@.pdf doc/@PACKAGE_NAME@_@PACKAGE_VERSION@.ps.gz
@ -19,6 +18,6 @@ dist-hook:
rm -rf `find $(distdir) -name .svn`
rm -rf `find $(distdir) -name .deps`
# Also remove extra files not needed in a distribution
rm -rf `find $(distdir) -name configure.ac`
# rm -rf `find $(distdir) -name configure.ac`
rm -rf `find $(distdir) -name acinclude.m4`
rm -rf `find $(distdir) -name aclocal.m4`
# rm -rf `find $(distdir) -name aclocal.m4`

110
README
View File

@ -4,8 +4,9 @@ wiki ReadMe, which is located at:
Introduction
============
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:
@ -20,52 +21,73 @@ in this distribution is now licensed under the Apache License:
** limitations under the License.
Other Dependencies and Licenses:
================================
The Aspirin/MIGRAINES system is no longer required.
Dependencies and Licenses:
==========================
Leptonica is required. (www.leptonica.com). Tesseract no longer compiles
without Leptonica.
Libtiff is no longer required as a direct dependency.
Instead, Leptonica is required. (www.leptonica.com)
See http://code.google.com/p/tesseract-ocr/wiki/FAQ for details.
As of 3.01, Tesseract no longer compiles without Leptonica.
Installing and Running Tesseract
All Users Do NOT Ignore!
The tarballs are split into pieces.
tesseract-2.04.tar.gz contains all the source code.
tesseract-x.xx.tar.gz contains all the source code.
tesseract-2.00.<lang>.tar.gz contains the language data files for <lang>. You need at least one of these or tesseract will not work.
tesseract-x.xx.<lang>.tar.gz contains the language data files for <lang>.
You need at least one of these or Tesseract will not work.
Note that tesseract-2.04.tar.gz unpacks to the tesseract-2.04 directory. tesseract-2.00.<lang>.tar.gz unpacks to the tessdata directory which belongs inside your tesseract-2.04 directory. It is therefore best to download them into your tesseract-2.04 directory, so you can use unpack here or equivalent. You can unpack as many of the language packs as you care to, as they all contain different files. Note that if you are using make install you should unpack your language data to your source tree before you run make install. If you unpack them as root to the destination directory of make install, then the user ids and access permissions might be messed up.
Note that tesseract-x.xx.tar.gz unpacks to the tesseract-ocr directory.
tesseract-x.xx.<lang>.tar.gz unpacks to the tessdata directory which
belongs inside your tesseract-ocr directory. It is therefore best to
download them into your tesseract-x.xx directory, so you can use unpack
here or equivalent. You can unpack as many of the language packs as you
care to, as they all contain different files. Note that if you are using
make install you should unpack your language data to your source tree
before you run make install. If you unpack them as root to the
destination directory of make install, then the user ids and access
permissions might be messed up.
boxtiff-2.01.<lang>.tar.gz contains data that was used in training for those that want to do their own training. Most users should NOT download these files.
boxtiff-2.xx.<lang>.tar.gz contains data that was used in training for
those that want to do their own training. Most users should NOT download
these files.
Instructions for using the training tools are documented separately at TrainingTesseract and for testing at TestingTesseract.
Instructions for using the training tools are documented separately at
Tesseract wiki http://code.google.com/p/tesseract-ocr/w/list
Without Additional Libraries, Image format support is limited!
Without additional libraries, Tesseract can only read uncompressed TIFF. (And some versions of BMP) Upto version 2.04, you can add libtiff-dev. See the FAQ question on compressed TIFF for installation instructions. Version 3.00 will support additional formats via Leptonica, but requires more libraries to be added.
Windows:
--------
There is no windows installer! (Still looking for volunteers to create one.) There are windows executables: tesseract-2.04.exe.tar.gz (It is not for the 'exe' language.) They are built with VC++ express 2008 and come with absolutely no warranty. If they work for you then great, otherwise get Visual C++ Express 2008 with service pack 1 and build from the source. You can also try tesseract-2.01.exe.tar.gz, which is built with VC++6, and may work better if your windows is old, but note that this is an older version of Tesseract.
Please use installer (for 3.00 and above). Tesseract is library with
command line interface. If you need GUI, please check AddOns wiki page
http://code.google.com/p/tesseract-ocr/wiki/AddOns#GUI
If you are building from the sources, there are still (up to v2.04) .dsw and .dsp files for vc++6, but the recommended build platform is now VC++ Express 2008. There are also .sln and .vcproj files for VC++ Express 2008, but these files are not backward compatible with any previous version - not even VC++ Express 2005. Note that the executables produced with the newer compiler are smaller, faster, and, believe it or not, more accurate. (See TestingTesseract.)
If you are building from the sources, the recommended build platform is
VC++ Express 2008 (optionally 2010).
New with 2.04: the executables are built with static linking, so they stand more chance of working out of the box on more windows systems.
The executables are built with static linking, so they stand more chance
of working out of the box on more windows systems.
The executable must reside in the same directory as the tessdata directory. (The Visual Studio projects build the release executable directly to the correct place!)
The executable must reside in the same directory as the tessdata
directory or you need to set up environment variable TESSDATA_PREFIX.
Installer will set it up for you.
The command line is:
tesseract <image.tif> <output> [-l <langid>]
tesseract imagename outputbase [-l lang] [-psm pagesegmode] [configfiles...]
For interfacing to other applications, there is a DLL included with the executables, but you may be better off building it yourself. The DLL is NOT built for static C-Runtime, so you will probably need VC++ Express 2008 to run it.
If you need interface to other applications, please check wrapper section
on AddOns wiki page:
http://code.google.com/p/tesseract-ocr/wiki/AddOns#Tesseract_3.0x
The dll has been updated to allow input of non-binary images. (Thanks to Glen of Jetsoft.)
Non-Windows (or Cygwin):
------------------------
You have to tell Tesseract through a standard unix mechanism where to find its data directory. You must either:
You have to tell Tesseract through a standard unix mechanism where to
find its data directory. You must either:
./configure
make
@ -77,13 +99,15 @@ export TESSDATA_PREFIX="directory in which your tessdata resides/"
In either case the command line is:
tesseract <image.tif> <output> [-l <langid>]
tesseract imagename outputbase [-l lang] [-psm pagesegmode] [configfiles...]
New there is a tesseract.spec for making rpms. (Thanks to Andrew Ziem for the help.) It might work with your OS if you know how to do that.
New there is a tesseract.spec for making rpms. (Thanks to Andrew Ziem for
the help.) It might work with your OS if you know how to do that.
If you are linking to the libraries, as Ocropus does, please link to
libtesseract_api.
If you are linking to the libraries, as Ocropus does, there is now a single master library called libtesseract_full.a.
Libtiff support should now be properly working via configure, but note that you need libtiff-dev, as that contains the header files required to compile the code that uses it.
History:
========
@ -94,38 +118,24 @@ A lot of the code was written in C, and then some more was written in C++.
Since then all the code has been converted to at least compile with a C++
compiler. Currently it builds under Linux with gcc4.4.3 and under Windows
with VC++2008. The C++ code makes heavy use of a list system using macros.
This predates stl, was portable before stl, and is more efficent than stl
This predates stl, was portable before stl, and is more efficient than stl
lists, but has the big negative that if you do get a segmentation violation,
it is hard to debug.
The most recent change is that Tesseract can now recognize 6 languages, is fully UTF8 capable, and is fully trainable. See TrainingTesseract for more information on training.
The most recent change is that Tesseract can now recognize 6 languages,
is fully UTF8 capable, and is fully trainable. See TrainingTesseract for
more information on training.
Tesseract was included in UNLV's Fourth Annual Test of OCR Accuracy. See http://www.isri.unlv.edu/downloads/AT-1995.pdf. With Tesseract 2.00, scripts are now included to allow anyone to reproduce some of these tests. See TestingTesseract for more details.
Directory Structure (ordered by dependency):
============================================
ccmain Top-level code. The main program resides in tesseractmain.cpp.
display An "editor" to view and operate on the internal structures.
(Requires a working viewer - batteries not included.)
wordrec The word-level recognizer.
textord The module that organizes(orders) text into lines and words.
classify The low-level character classifiers.
ccstruct Classes to hold information about a page as it is being processed.
viewer The client side of a client server viewing system.
Unfortunately, at this time, the server side is not available.
image Image class and processing functions.
dict Language model code.
cutil Code for file I/O, lists, heaps etc, from the old C code.
ccutil Somewhat newer code for lists, memory allocation etc from the
old C++ code.
Tesseract was included in UNLV's Fourth Annual Test of OCR Accuracy.
Results were available on http://www.isri.unlv.edu/downloads/AT-1995.pdf.
With Tesseract 2.00, scripts were included to allow anyone to reproduce
some of these tests. See TestingTesseract for more details.
About the Engine
================
This code is a raw OCR engine. It has NO PAGE LAYOUT ANALYSIS, NO OUTPUT
FORMATTING, and NO UI. It can only process an image of a single column
and create text from it. It can detect fixed pitch vs proportional text.
This code is a raw OCR engine. It has limited PAGE LAYOUT ANALYSIS, simple
OUTPUT FORMATTING (txt, hocr/html), and NO UI.
Having said that, in 1995, this engine was in the top 3 in terms of character
accuracy, and it compiles and runs on both Linux and Windows.
As of 2.0, Tesseract is fully unicode (UTF-8) enabled, and can recognize 6

View File

@ -55,7 +55,7 @@ int main(int argc, char **argv) {
textdomain (PACKAGE);
#endif
if ((argc == 2 && strcmp(argv[1], "-v") == 0) || (argc == 2 && strcmp(argv[1], "--version") == 0)) {
fprintf(stderr, "tesseract-%s\n", tesseract::TessBaseAPI::Version());
fprintf(stderr, "tesseract %s\n", tesseract::TessBaseAPI::Version());
exit(0);
}
// Make the order of args a bit more forgiving than it used to be.

View File

@ -392,6 +392,7 @@ AC_CONFIG_FILES(java/com/google/Makefile)
AC_CONFIG_FILES(java/com/google/scrollview/Makefile)
AC_CONFIG_FILES(java/com/google/scrollview/events/Makefile)
AC_CONFIG_FILES(java/com/google/scrollview/ui/Makefile)
AC_CONFIG_FILES(doc/Makefile)
fi
# AC_CONFIG_FILES(doc/Doxyfile)
# AC_CONFIG_FILES(doc/header.html)

5
doc/Makefile.am Normal file
View File

@ -0,0 +1,5 @@
man_MANS = cntraining.1 combine_tessdata.1 mftraining.1 tesseract.1 \
unicharset_extractor.1 wordlist2dawg.1 unicharambigs.5 \
unicharset.5
EXTRA_DIST = $(man_MANS) MOCRadaptingtesseract2.pdf \
PageLayoutAnalysisICDAR2.pdf tesseracticdar2007.pdf

View File

@ -20,15 +20,18 @@
; - replace hardcoded program name to variables (NAME and LONGNAME)
; - place shortcuts in program files for all users
!define VERSION 3.00
!define VERSION 3.01
!define PRODUCT_NAME "Tesseract-OCR"
!define PRODUCT_VERSION "${VERSION}"
!define PRODUCT_PUBLISHER ""
!define PRODUCT_PUBLISHER "Tesseract-OCR community"
!define PRODUCT_WEB_SITE "http://code.google.com/p/tesseract-ocr"
;!define PRODUCT_DIR_REGKEY "Software/Microsoft"
;!define PRODUCT_UNINST_KEY "Software/Microsoft"
;!define PRODUCT_UNINST_ROOT_KEY "Software/Microsoft"
SetCompressor lzma
SetCompressor /FINAL /SOLID lzma
;SetCompressor lzma
SetCompressorDictSize 32
Name "Tesseract-OCR ${VERSION}"
Caption "Tesseract-OCR ${VERSION}"
;Icon "icon_1.ico"
@ -86,7 +89,7 @@
!define MUI_LICENSEPAGE_CHECKBOX
;!define MUI_LICENSEPAGE_TEXT "$(License)"
;!insertmacro MUI_PAGE_LICENSE "${MUI_LICENSEPAGE_TEXT}"
!insertmacro MUI_PAGE_LICENSE "doc/COPYING"
!insertmacro MUI_PAGE_LICENSE "..\COPYING"
!ifdef VERSION
Page custom PageReinstall PageLeaveReinstall
!endif
@ -152,45 +155,47 @@ Section "Tesseract-OCR" SecDummy
SectionIn RO
SetOutPath "$INSTDIR"
;files inclided in distribution
File leptonlib.dll
File tesseract.exe
;File leptonlib.dll
File bin\tesseract.exe
File bin\cntraining.exe
File bin\combine_tessdata.exe
File bin\mftraining.exe
File bin\unicharset_extractor.exe
File bin\wordlist2dawg.exe
File gzip.exe # for exctracting language data
CreateDirectory "$INSTDIR\tessdata"
CreateDirectory "$INSTDIR\tessdata\configs"
SetOutPath "$INSTDIR\tessdata\configs"
File tessdata\configs\ambigs.train
File tessdata\configs\api_config
File tessdata\configs\box.train
File tessdata\configs\box.train.stderr
File tessdata\configs\digits
File tessdata\configs\inter
File tessdata\configs\kannada
File tessdata\configs\logfile
File tessdata\configs\makebox
File tessdata\configs\unlv
File ..\tessdata\configs\ambigs.train
File ..\tessdata\configs\api_config
File ..\tessdata\configs\box.train
File ..\tessdata\configs\box.train.stderr
File ..\tessdata\configs\digits
File ..\tessdata\configs\hocr
File ..\tessdata\configs\inter
File ..\tessdata\configs\kannada
File ..\tessdata\configs\linebox
File ..\tessdata\configs\logfile
File ..\tessdata\configs\makebox
File ..\tessdata\configs\rebox
File ..\tessdata\configs\strokewidth
File ..\tessdata\configs\unlv
CreateDirectory "$INSTDIR\tessdata\tessconfigs"
SetOutPath "$INSTDIR\tessdata\tessconfigs"
File tessdata\tessconfigs\batch
File tessdata\tessconfigs\batch.nochop
File tessdata\tessconfigs\matdemo
File tessdata\tessconfigs\msdemo
File tessdata\tessconfigs\nobatch
File tessdata\tessconfigs\segdemo
CreateDirectory "$INSTDIR\training"
SetOutPath "$INSTDIR\training"
File training\cntraining.exe
File training\combine_tessdata.exe
File training\mftraining.exe
File training\unicharset_extractor.exe
File training\wordlist2dawg.exe
File ..\tessdata\tessconfigs\batch
File ..\tessdata\tessconfigs\batch.nochop
File ..\tessdata\tessconfigs\matdemo
File ..\tessdata\tessconfigs\msdemo
File ..\tessdata\tessconfigs\nobatch
File ..\tessdata\tessconfigs\segdemo
CreateDirectory "$INSTDIR\doc"
SetOutPath "$INSTDIR\doc"
File doc\AUTHORS
File doc\COPYING
File doc\eurotext.tif
File doc\phototest.tif
File doc\README
File doc\ReleaseNotes
File ..\AUTHORS
File ..\COPYING
File ..\eurotext.tif
File ..\phototest.tif
File ..\README
File ..\ReleaseNotes
;Store installation folder
WriteRegStr HKCU "Software\Tesseract-OCR" "InstallDir" $INSTDIR
WriteRegStr HKCU "Software\Tesseract-OCR" "CurrentVersion" "${VERSION}"
@ -199,13 +204,12 @@ Section "Tesseract-OCR" SecDummy
; include for some of the windows messages defines
!include "winmessages.nsh"
; HKLM (all users) vs HKCU (current user) defines
!define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
!define env_hkcu 'HKCU "Environment"'
; set variable
; append bin path to user PATH environment variable
ReadRegStr $0 HKCU "Environment" "PATH"
WriteRegExpandStr HKCU "Environment" "PATH" "$INSTDIR;$INSTDIR\training;$0"
WriteRegExpandStr HKCU "Environment" "PATH" "$INSTDIR;$0"
#${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$0;$INSTDIR" # this command destroys long variables like path...
${EnvVarUpdate} $0 "TESSDATA_PREFIX" "A" "HKCU" "$INSTDIR\"
; make sure windows knows about the change
@ -232,7 +236,8 @@ SectionEnd
Section "Shortcuts creation" SecCS
CreateDirectory "$SMPROGRAMS\Tesseract-OCR"
CreateShortCut "$SMPROGRAMS\Tesseract-OCR\Tesseract-OCR.lnk" "$INSTDIR\tesseract.exe" "" "$INSTDIR\tesseract.exe" 0
;TODO create a simple GUI for 3.01 release
;CreateShortCut "$SMPROGRAMS\Tesseract-OCR\Tesseract-OCR.lnk" "$INSTDIR\tesseract.exe" "" "$INSTDIR\tesseract.exe" 0
CreateShortCut "$SMPROGRAMS\Tesseract-OCR\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
;CreateShortCut "$DESKTOP\Tesseract-OCR.lnk" "$INSTDIR\tesseract.exe" "" "$INSTDIR\tesseract.exe" 0
;CreateShortCut "$QUICKLAUNCH\.lnk" "$INSTDIR\tesseract.exe" "" "$INSTDIR\tesseract.exe" 0
@ -243,7 +248,7 @@ SectionGroup "Language data" SecGrp_LD
Section "English language data" SecLang_eng
SectionIn RO
SetOutPath "$INSTDIR\tessdata"
File tessdata\eng.traineddata
File ..\tessdata\eng.*
SectionEnd
Section /o "Download and install Bulgarian language data" SecLang_bul
@ -420,11 +425,11 @@ Section "Uninstall"
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Create desktop shortcut"
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION CreateDeskShortcut
;DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Run\Tesseract-OCR"
DeleteRegKey /ifempty HKCU "Software\Tesseract-OCR"
;DeleteRegKey /ifempty HKCU "Software\Tesseract-OCR"
DeleteRegKey HKCU "Software\Tesseract-OCR"
; delete variable
${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" $INSTDIR
${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "$INSTDIR\training"
DeleteRegValue ${env_hklm} "TESSDATA_PREFIX"
DeleteRegValue ${env_hkcu} "TESSDATA_PREFIX"
; make sure windows knows about the change
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
@ -442,9 +447,14 @@ Section "Uninstall"
RMDir "$INSTDIR\tessdata"
;Delete "$DESKTOP\Tesseract-OCR.lnk"
;Delete "$QUICKLAUNCH\Tesseract-OCR.lnk"
RMDir "$INSTDIR"
RMDir "$SMPROGRAMS\Tesseract-OCR"
;MessageBox MB_YESNO "Delete all configuration data? This will save a lot of space, but at the expense of reconfiguring..." IDNO skip_cfg
;RMDir /r $APPDATA\Tesseract-OCR
;skip_cfg:
Delete "$INSTDIR\Uninstall.exe"
RMDir "$INSTDIR"
; remove the Add/Remove information
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"