|
Welcome. Clara OCR is a free OCR, written for systems supporting the C library and the X Windows System. Clara OCR is intended for the cooperative OCR of books. There are some screenshots available at http://www.claraocr.org/.
This documentation is extracted automatically from the comments of the Clara OCR source code. It is known as "The Clara OCR Advanced User's Manual". It's currently unfinished. First-time users are invited to read "The Clara OCR Tutorial". Developers must read "The Clara OCR Developer's Guide".
| CONTENTS |
| 1. Welcome to Clara OCR |
Clara is an optical character recognition (OCR) software, a program that tries to identify the graphic images of the characters from a scanned document, converting their digital images to ASC, ISO or other codes.
The name Clara stands for "Cooperative Lightweight chAracter Recognizer".
Clara offers two revision interfaces: a standalone GUI and and a web interface, able to be used by various different reviewers simultaneously. Because of this feature Clara is a "cooperative" OCR (it's also "cooperative" in the sense of its free/open status and development model).
| 1.1 Early historical notes |
For some years now we have tested and used OCR softwares, mainly for old books. Popular OCR softwares (those bundled with scanners) are useful tools. However, OCR is not a simple task. The results obtained using those programs vary largely depending on the the printed document, and, for most texts we're interested on, the results are really poor or even unusable. In fact, it's not a surprise that many digitalization projects prefer not to use OCR, but typists only.
For a programmer, it is somewhat intuitive that OCR could achieve good results even from low quality texts, when an add-hoc approach is used, focusing one specific book (for instance). Within this approach, OCR becomes a matter of finding one software adequate for the texts you're trying to OCR, or perhaps develop a new one. So a free and easy to customize OCR (on the source code level) would be a valuable resource for text digitalization projects.
Dealing with graphics is not among our main occupations, but after analysing many scanned materials, we began to write some simple and specialized recognition tools. More recently (in the third quarter of 1999) a simple X interface linked to a naive bitmap comparison heuristic was written. From that prototype, Clara OCR evolved. Since then, many new ideas from various persons helped to make it better.
| 1.2 Design notes |
It's not a bad idea to enumerate some principles that have driven Clara OCR development. They'll make easier to understand the features and limitations of the software (these principles may change along time).
1. Clara is an OCR for printed texts, not for handwritten texts.
2. Clara was not designed to be used to OCR one or two single pages, but to OCR a large number of documents with the same graphic characteristics (font, size, etc). So it can take advantage of a fine (and perhaps expensive) training. This will be tipically the case when OCRing an entire book.
3. We chose not support directly multiple graphic formats, but only Jeff Poskanzer's raw PBM and PGM. Non-PBM/PGM files will be read through filters.
4. Clara OCR wants to be a tool that makes viable the sum and reuse of human revision effort. Because of this, on the OCR model implemented by Clara, training and revision are one same thing. The revision is a sum of punctual and independent acts and alternates with reprocessing steps along a refinement process.
5. The Clara GUI was implemented and behaves like a minimalistic HTML viewer. This is just an easy and standard way to implement a forms interface.
6. We have tried to make the source code portable across platforms that support the C library and the Xlib. Clara has no special provision to be ported to environments that do not support the Xlib. We avoided to use a higher level graphic environment like Motif, GTK or Qt, but we do not discourage initiatives to add code to Clara OCR adapt or adapt better to these or other graphic environments.
7. We generally try to make the code efficient in terms of RAM usage. CPU and disk usage (for session files) are less prioritary.
| 1.3 Supported Alphabets |
Clara OCR focuses the Latin Alphabet ("a", "b", "c", ...), used by most European languages, and the decimal digits ("0", "1", "2", ...), but we're trying to support as many alphabets as possible.
To say that Clara OCR supports a given alphabet means that Clara OCR
(a) is able to be trained from the keyboard for the symbols of that alphabet, eventually applying some transliteration from that alphabet to latin. For instance, when OCRing a greek text, if the user presses the latin "a" key (assuming that the keyboard has latin labels), Clara is expected to train the current symbol as "alpha".
(b) knows the vertical alignment of each letter of that alphabet, for instance, knows that the bottom of an "e" is aligned at the baseline;
(c) knows which letters accept or require which signs (accents and others, like the dot found on "i" and "j");
(d) contains code to help avoiding common mistakes, like recognizing "e" as "c", "l" as "1", etc.
To say that Clara OCR supports a given alphabet does not necessarily mean that Clara OCR
(a) knows some particular encoding (ISO-8859-X, Unicode, etc) for that alphabet;
(b) contains or is able to use fonts for that alphabet to display the OCR output on the PAGE (OUTPUT) window.
Even ignoring the standard encondings for one given alphabet (e.g. ISO-LATIN-7 for Greek), Clara eventually will be able to produce output using TeX macros, like {\Alpha}.
| 1.4 Clara vs the others |
Clara differs from other OCR softwares in various aspects:
1. Most known OCRs are non-free and Clara is free. Clara focus the X Windows System. Clara offers batch processing, a web interface and supports cooperative revision effort.
2. Most OCR softwares focus omnifont technology disregarding training. Clara does not implement omnifont techniques and concentrate on building specialized fonts (some day in the future, however, maybe we'll try classification techniques that do not require training).
3. Most OCR softwares make the revision of the recognized text a process totally separated from the recognition. Clara pragmatically joins the two processes, and makes training and revision one same thing. In fact, the OCR model implemented by Clara is an interactive effort where the usage of the heuristics alternates with revision and visual fine-tuning of the OCR, guided by the user experience and feeling.
4. Clara allows to enter the transliteration of each pattern using an interface that displays a graphic cursor directly over the image of the scanned page, and builds and maintains a mapping between graphic symbols and their transliterations on the OCR output. This is a potentially useful mechanism for documentation systems, and a valuable tool for typists and reviewers. In fact, Clara OCR may be seen as a productivity tool for typists, instead of a typical OCR.
5. Most OCR softwares are integrated to scanning tools offerring to the user an unified interface to execute all steps from scanning to recognition. Clara does not offer one such integrated interface, so you need a separate software (e.g. SANE) to perform scanning.
6. Most OCR softwares expect the input to be a graphic file encoded in tiff or other formats. Clara supports only raw PBM/PGM.
| 1.5 The requirements |
Clara OCR will run on a PC (386, 486 or Pentium) with GNU/Linux and Xwindows. Clara OCR will hopefully compile and run on a PC with any unix-like operating system and Xwindows. Currently Clara OCR won't run on big-endian CPUs (e.g. Sparc) nor on systems lacking X windows support (e.g. MS-Windows). Higher-level libraries like Motif, GTK or Qt are not required.
A relatively fast CPU is recommended (300MHz or more). Memory usage depends on the documents, and may range from some few megabytes to various tenths os megabytes The normal operation will create session files on your hard disk, so some megabytes of free disk space are required (a large project may require plents of gigabytes). Clara OCR can read and write gzipped files (see the -z command-line switch).
If you need to build the executable and/or the documentation, then an ANSI C compiler (with some GNU extensions) and a (version 5) perl interpreter are required.
| 1.6 How to download and compile Clara |
For those who need to download and compile the source code (hopefully this will be unnecessary for most users as soon as Clara binary distributions become available), it may be downloaded from http://www.claraocr.org/. It's a compressed tar archive with a name like clara-x.y.tar.gz (x.y is the version number).
The compilation will generally require no more than issue the following commands on the shell prompt:
$ gunzip clara-x.y.tar.gz
$ tar xvf clara-x.y.tar
$ cd clara-x.y
$ make
$ make doc
|
If some of these steps fail, please try to obtain assistance from your local experts. They will solve most simple problems concerning wrong paths or compiler options. You can also read the subsection "Compilation and startup pitfalls".
| 1.7 Compilation and startup pitfalls |
This subsection is intended to help people that are experiencing fatal errors when building the executable or when starting it. After each error message we'll point out some hints.
Bear in mind that most hints given below are very elementary concerning Unix-like systems. If you have problems, try to read all hints because details explained once are not repeated. If you cannot understand them, please try to ask your local experts, or try to read an introductory book on Unix things. Please don't email questions like these to the Clara developers, except when the hint suggests it.
1. Path-related pitfalls
$ make
bash: make: command not found
|
$ find /usr -name make -print
|
$ echo $PATH
|
$ make
gcc -I/usr/X11R6/include -g -c gui.c -o gui.o
make: gcc: Command not found
make: *** [gui.o] Error 127
|
If you don't know what I'm speaking about, take a look on the directory where the Clara source codes are, and you'll see there a file named "makefile". This file contains the names of the tools to be used and rules to build the Clara executable. It contains also important paths, like those where the system headers (files .h) and libraries can be found. If the names or the paths don't reflect those on your system, you need to edit the makefile accordingly.
$ make
gcc -I/usr/X11R6/include -g -c gui.c -o gui.o
In file included from gui.c:16:
gui.h:12: X11/Xlib.h: No such file or directory
make: *** [gui.o] Error 1
|
$ make
gcc -o clara clara.o skel.o gui.o mc.o ...
/usr/bin/ld: cannot open -lX11: No such file or directory
make: *** [clara] Error 1
|
2. Compilation pitfalls
$ make
gcc -I/usr/X11R6/include -g -c clara.c -o clara.o
clara.c:70: parse error before `int'
make: *** [clara.o] Error 1
|
$ make
clara.c: In function `process_cl':
clara.c:2293: `ZPS' undeclared (first use in this function)
clara.c:2293: (Each undeclared identifier is reported only once
clara.c:2293: for each function it appears in.)
make: *** [clara.o] Error 1
|
3. Runtime pitfalls
$ clara &
[1] 1924
bash: clara: command not found
|
$ ./clara &
[1] 1922
_X11TransSocketUNIXConnect: Can't connect: errno = 111
cannot connect to X server
|
$ ./clara
Segmentation fault (core dumped)
|
$ gdb clara
(gdb) run
|
| 2. A first OCR project |
Clara OCR is intended to OCR a relatively large collection of pages at once, typically a book. So we will refer the material that we are OCRing as "the book".
Let's describe a small but real project as an example on how to use Clara to OCR one "book". This section is in fact an in-depth tutorial on using Clara OCR. In order to try all techniques explained along this section, please download and uncompress the file referred as "page 143" of Manuel Bernardes Branco Dictionary (Lisbon, 1879), available at http://www.claraocr.org. It's a tarball containing the two text columns (one per file) of that page.
Just to make the things easier, we will assume that the files 143-l.pgm and 143-r.pgm were downloaded to the directory /home/clara/books/MBB/pgm/. We will assume also that the programs "clara", and "selthresh" are on the PATH. Some programs required to handle PBM files (pgmtopbm, pnmrotate and others, by Jef Poskanzer) are also required. These programs can be easily found around there, and are included on most free operating systems.
| 2.1 Scanning and thresholding |
Clara OCR cannot scan paper documents by itself. Scanning must be performed by another program. The Clara OCR development effort is using SANE (http://www.mostang.com/sane) to produce 600 or 300 dpi images. The Clara OCR heuristics are tuned to 600 dpi.
Scanners offer three scanning modes: black-and-white (also known as "bitmap" or "lineart", however the meaning of these words may vary depending on the context), "grayscale" and "color". Clara OCR requires black-and-white or grayscale input. Both black-and-white and grayscale images may be saved in a variety of formats by scanning programs. However, only PBM (for black-and-white) and PGM (for grayscale) formats are recognized. Generally grayscale 600 or 300 dpi will be the best choice, but black-and-white 600 dpi may be good for new, high quality printed materials. If your scanning program do not support the PBM or PGM formats, try to save the images in TIFF format and convert to PBM or PGM using the command tifftopnm. If for some reason the TIFF format cannot be used, choose any other format that preserves all data (don't use "compressing" formats like JPEG), and for which a conversion tool is available, to convert it to PBM or PGM.
Remark: Programs that scan or handle (e.g. rotate) images may sometimes perform unexpected tasks, as applying dithering or reducing algorithms by themselves. An image transformed to become nice or small may be useless for OCR purposes.
Remark: The PBM and PGM formats do not carry the original resolution (dots-per-inch) at which the image was scanned. As some heuristics require that information, Clara OCR expects to be informed about it through the command-line switch -y (so take note of the resolution used).
Grayscale means that each pixel assumes one gray "level", typically from 0 (black) to 255 (white). This is a good choice for scanning old or low-quality printed materials, because it's possible to use specialized programs to analyse the image and choose a "threshold", in such a way that all pixels above that threshold will be considered "white", and all others will be considered black (when scanning in black-and-white mode, the threshold is chosen by the scanning program or by the user). The threshold may be global (fixed for the entire page) or local (vary along the page).
In most cases grayscale will achieve better results. However, as grayscale images are much larger than black-and-white images, 300 dpi (instead of 600 dpi) may be mandatory when using grayscale due to disk consumption requirements.
Remark: Try to limit yourself to the optical resolution oferred by the scanner. Most old scanners are 300 dpi, but the scanning software obtains higher resolutions through interpolation. Newer scanners may be optical 600 dpi or 1200 dpi or more.
Remark: the page 143 of Manuel Bernardes Branco Dictionary that we're using along these tests was scanned using the SANE scanimage command:
scanimage -d microtek2:/dev/sga --mode gray -x 150 -y 210
--resolution 300 > 143.pgm
|
XX
XX
XXXXX XXX XXX XXX
X XX XX XX XX
XX XX XX XX
XXXXXXX XX XX XX
X XX XX XX XX
X XX XX XX XX
XXXXX XXXXXXX XX XXXX
|
Remark: Now you can try avoid links in segmentation step. Just set "Try avoid links" parameter in Tune tab. (Normal values <=1)
The four thresholding methods currently avaliable are: manual (global), histogram-based (global), classification-based (local), classification-based (global).
| 2.2 Manual and histogram-based (global) |
Histogram-based thresholding is the default method. It computes automatically a thresholding value based on the distribution of grayshades. To use it, just enter the TUNE tab and select (it's selected by default) the "use histogram-based global thresholder". To make a try, load a PGM image and press OCR or ask the Segmentation OCR step.
Remark: You can correct the automatic-detected threshold with "Threshold factor" in Tune tab.
A global thresholding value can be manually specified. This corresponds to the "use manual global thresholder" entry. The choice of the thresholding value is performed through a visul interface called "instant thresholding". To use it, load one PGM image and select the "Instant thresholding" entry (Edit menu). Then use '<', '>', '+' and '-' to change the thresholding value. When ok, press ESC. Note that the selected value will be applied only when the segmentation step runs.
| 2.3 Classification-based (local) |
Global thresholding does not address those cases where the printing intensity (or paper properties) vary along one same page. Local thresholding methods are required on such cases. Clara OCR implements a classification-based local (per-symbol) thresholder. Saying that it's classification-based means that the OCR engine is used to choose the threshold. In other words, the threshold chosen is that for which the classifier successfully recognized the symbol (in fact, this is a brute-force approach).
The local binarizer can be manually applied at any symbol. To do so, load one PGM page and click any symbol directly on the PAGE tab. Two thresholding values will be chosen. The pixels found to be "black" for each one are painted "black" (smaller value) and "gray" (larger value). At this moment, it's possible to add the thresholded symbol as a pattern (just press the key corresponding to its transliteration). Remember that this thresholder relies on the classifier, so if the OCR is not trained, you'll get no benefit.
Two versions of the local binarizer were developed, a "weak" one and a "strong" one. The "weak" one just tries to change the threshold on those symbols not successfully classified using the default threshold. The "strong" one (unfinished) also tries to criticize locally the segmentation results. By default, the weak version is used. To try the strong one, check the corresponding checkbox at the TUNE tab.
Remark: As an alternative, use the "Balance" feature + global thresholding.
| 2.4 Classification-based (global) |
Clara OCR includes a simple threshold selection script to compute global best thresholds based on classification results. Let's try it on our 2-page book. Just create a directory, cd to it and run the selthresh script informing the resolution and the names of the images:
$ cd /home/clara/books/BC
$ mkdir pbm
$ cd pbm
$ selthresh -y 300 -l 0.45 0.55 ../pgm/*pgm
selthresh: scaling 2 times
Best thresholds:
143-l.pgm 0.49
143-r.pgm 0.51
|
$ cd /home/clara/books/MBB/pbm
$ selthresh -y 300 -l 0.40 0.55 ../pgm/*pgm
|
$ pgmtopbm -threshold -value 0.4 ../pgm/143-l.pgm >143-l.pbm
$ display 143-l.pbm
|
$ selthresh -y 300 -l 0.30 0.35 ../pgm/143-l.pgm
selthresh: scaling 2 times
Best thresholds:
143-l.pgm 0.32 (bad interval, try -l 0.30 0.4)
|
Once the best thresholds are known, use pgmtopbm to produce the black-and-white images. It's also a good idea to approach the resolution to 600 dpi using pnmenlarge. Yet pnmenlarge does not add information to the image, the classification heuristics will behave better. In our case, the command should be
$ cd /home/clara/books/BC/pbm
$ pnmenlarge 2 ../pgm/143-l.pgm | \
pgmtopbm -threshold -value 0.49 >143-l.pbm
$ pnmenlarge 2 ../pgm/143-r.pgm | \
pgmtopbm -threshold -value 0.51 >143-r.pbm
|
In order to capture the output of selthresh (to extract the per-page best thresholds), it's ok to re-generate it as many times as needed (just repeat the same selthresh command, because once all computations become performed, the script will just read the results from selthresh.out and output the results).
A final warning: selthresh may be fooled by too dark images. So if the right limit is much larger than it should be, selthresh may produce bad results. So be careful concerning the right limit of the interval. As a practical advice, keep in mind that the best threshold for most images is less then 0.6. In the near future we'll use statistical measurements to choose the interval to analyse, in order to prevent such problems and to make unnecessary a manual choice.
remark: the tarball also includes an alternative selthresh, named slethresh_fidian.pl. It contains instructions on how to use it.
| 2.5 Avoiding or correcting skew |
Sometimes the printing is skewed relatively to the paper margins. Skew is a problem to the OCR heuristics. As the Clara OCR engine just detects components by pixel contiguity and builds classes of symbols, in practice the effect of skew will be a larger number of patterns, and therefore a larger revision cost.
In some cases, a careful manual scanning can solve the problem. When acceptable, a set-square solves the problem: just align one text line at one set-square rule and the edge of the scanner glass at the other rule (we're supposing that the bookbinding was disassembled).
The bundled preprocessor now includes a method to compute and correct skew, but it's not on by default. To activate it, enter the TUNE tab and select the "Use deskewer" checkbox. Now deskewing will be applied when the OCR button is pressed (or when the "Preprocessing" OCR step is requested). Note that preprocessing is called only once per page, so if the page was already preprocessed, it won't be deskewed.
| 2.6 The work directory |
Clara OCR expects to find on one same directory one or more images of scanned pages. In our case, this directory is assumed to be /home/clara/books/BC/pbm. By default, on this same directory, various files will be created to store the OCR data structures. So, if 143-l.pbm and 143-r.pbm are the pages to OCR, then after processing all pages at least once (not done yet) the work directory will contain the following files:
143-l.pbm
143-l.html
143-l.session
143-r.pbm
143-r.html
143-r.session
acts
patterns
|
When Clara OCR is processing the page x.pbm, the files "x.session", "acts" and "patterns" are in memory. These three files together are generally referred as "the section". So the menu option "save session" means saving all three files.
| 2.7 Building the book font |
Patterns are selected symbols from the book. They're obtained from manual training, or from automatic selection. The patterns are used to deduce the transliteration of the unknown symbols by the bitmap comparison heuristics. In other words, the OCR discovers that one symbol is the letter "a" or the digit "1" comparing it with the patterns.
The book font is the collection of all patterns. The term "book font" was chosen to make sure that we're not talking about the X font used by the GUI. The book font is stored on a separate file ("patterns", on the work directory). Clara OCR classifies the patterns into "types", one type for each printing font. By now, most of this work must be done manually. Someday in the future, the auto-tuning features and the pre-build customizations will hopefully make this process less painful.
So, before OCRing one book, it's convenient to observe the different fonts used. In our case, we have three fonts (the quotations refer the page 5.pbm):
Unknown Latin 9pt ("Todos sao iguais...")
Unknown Latin 9pt bold ("Art. 5")
Unknown Latin 8pt italic (footings)
|
Now we can select some patterns from the pages 143-l.pbm and 143-r.pbm. Try:
$ cd /home/clara/books/MBB/pbm
$ clara &
|
At this point, the "Auto-classify" feature (Edit menu) may be quite useful. When on, Clara OCR will apply the just trained pattern to solve all unknown symbols, so after training an "a", only those "a" letters dissimilar to that trained will remain unknown (grayed).
Now save the session (menu "File"), exit Clara OCR (menu "File"), and enter Clara OCR again using the same commands above. Try to load one file and/or to observe the patterns on the tabs PATTERN, PATTERN (list), TUNE (SKEL), etc. This is a good way to experience that Clara OCR is started and exited many times along the duration of one OCR project.
The last remark in this subsection: instead of the just described manual pattern selection, Clara OCR is able to select by itself the patterns to use from the pages. In order to use this feature, after selecting the checkbox "Build the bookfont automatically" (TUNE tab), classify the symbols (just press the OCR button using the mouse button 1, or press the mouse button 3 over it and select the "classify" item). However, the current recommendation is to prefer the manual selection of patterns, at least as a first step.
| 2.8 Skeleton tuning |
Currently, symbol classification can be performed by three different classifiers: skeleton fitting, border mapping or pixel distance. The choice is done on the TUNE tab. Border mapping is currently experimental. Pixel distance has been used as an auxiliar classifier. Skeleton fitting is a more mature code and is highly customizable. It's the default classification method by now.
When using skeleton fitting, two symbols are considered similar when each one contains the skeleton of the other. So the classification result depends strongly on how skeletons are computed. As an example, the figure presents one symbol ("e"). The symbol black pixels are the dots ('.'). The skeleton black pixels are stars ('*').
.......
..******..
.*. ..*..
..*. ...*.
.*.. ...*..
..*.........*..
..***********..
..*. ....
..*.
..*..
..*... ...
..*..........
..********..
.........
|
Instead of trying the TUNE (SKEL) tab, it's possible to specify skeleton computation parameters through the -k command-line switch. Note however that if a selection was performed through the TUNE (SKEL) tab, that selection will override the parameters informed to -k, so be careful.
Clara OCR has an auto-tune feature to choose the "best" skeleton computation parameters. To use it, check the "Auto-tune skeleton parameters" entry on the TUNE tab. This feature is currently left off by default because manual tuning can achieve better results. Examples:
1. Quality printing without thin details
use -k 2,1.4,1.57,10,3.8,10,4,4
or -k 0,1.4,1.57,10,3.8,10,4,4
|
use -k 2,1.4,1.57,10,3.8,10,1,1
or -k 4,,,,,,3,
|
use -k 2,1.4,1.57,10,3.8,10,1,1
|
use -k 2,1.4,1.57,10,3.8,10,1,1
|
$ cd /home/clara/books/BC/pbm
$ clara &
|
| 2.9 Classification tentatives |
To classify the book symbols (i.e. to discover the transliteration of unknown symbols using the patterns), enter Clara OCR, select "Work on all pages" ("Options" menu) and press the OCR button using the mouse button 1, or press the mouse button 3 and select "Classification". The classification may be performed many times. Each time, different parameters may be tried to refine the results already achieved.
When the classification finishes, observe the pages 5.pbm and 6.pbm. Much probably, some symbols will be greyed. In other words, the classifier was unable to classify all symbols. The statistics presented on the PAGE (LIST) tab may be useful now. To reduce the number of unknown symbols there are three choices: add more patterns, change the skeleton computation parameters, or try another classifier.
To add more patterns, just train some greyed symbols and reclassify all pages again. The reclassification will be faster than the first classification because most symbols, already classified, won't be touched.
To change the skeleton computation parameters, exit Clara OCR, restart it informing the new parameters through -k, select "Re-scan all patterns" ("Edit" menu), select "Work on all pages" ("Options" menu) and reclassify. May be easier to choose and set the new parameters using the TUNE (SKEL) tab, as explained earlier. However, remember that the parameters chosen through the TUNE (SKEL) tab override the parameters informed through -k.
To try another classifier, first select the "Re-scan all patterns" entry on the "Edit" menu. Then enter the TUNE tab and select the classifier to use from the available choices (skeleton-base, border mapping and pixel distance). The pixel distance may be a good choice. Then reclassify all pages.
The "Re-scan all patterns" is required because for each symbol Clara OCR remembers the patterns already tried to classify it, and do not try those patterns again. However, when the skeleton computation parameters change, or when the classifier changes, those same patterns must be tried again. Maybe in the future Clara OCR will decide by itself about re-scanning all patterns.
| 2.10 Alignment tuning |
At this point, we can generate the output for all pages. The output is already available if the classification was performed clicking the OCR button with mouse button 1. If not, just select the "Work on all pages" item on the "Options" menu, and click the OCR button using the mouse button 1. The per-page output will be saved to the files 5.html and 6.html.
Maybe the output will contain unknow symbols. Maybe the output presents broken lines or broken words. If so, the numbers used to perform symbol alignment must be changed. These numbers are configured on the TUNE tab ("Magic numbers" section). They're part of the session data, so they'll be saved to disk.
There are 7 such numbers:
max word distance as percentage of x_height
max symbol distance as percentage of x_height
dot diameter measured in millimeters
max alignment error as percentage of DD
descent (relative to baseline) as percentage of DD
ascent (relative to baseline) as percentage of DD
x_height (relative to baseline) as percentage of DD
steps required to complete the unity
|
XXX --\--
XX |
XX |
XX |
XX XXXXX XX XXXXX | --\--
XXX X XXX X | AS |
XX XX XX XX | |
XX XX XX XX | | XH
XX XX XX XX | |
XX XX XX XX X | | --\--
XXX X XXX X XXX | | | DD
XX XXXXX XX XXXXX X --\-- --\-- --\--
XX |
XX | DS
XX |
XXXX --\--
|
| 3. Complex procedures |
To OCR an entire book is a long process. Perhaps along it a problem is detected. Bad choice of skeleton computation parameters, or a bad page contaminating the bookfont, some files loss due to a crash, etc. How to solve them?
Clara OCR does not offer currently a complete set of tools to solve all these problems. In some cases, a simple solution is available. In others, a solution is expected to become available in future versions. This session will depict some practical cases, and explain what can be done and what cannot be done for each one.
| 3.1 Using two directories |
In order to make easier the usage of read-only media, Clara OCR allows splitting the files in two directories, one for images and other for work files. The path of the first is stored on pagesdir, and the second, on workdir. For instance:
(pagesdir)
|
+- 1.pbm
|
+- 2.pbm
(workdir)
|
+- 1.session
|
+- 1.html
|
+- 2.session
|
+- 2.html
|
+- acts
|
+- font
|
| 3.2 Adding a page (to be written) |
| 3.3 Multiple books |
A somewhat rigid directory structure is recommended for high-volume digitalization projects based on Clara and using the web interface. In this case, there will be multiple "pagesdir" directories ("book1" and "book2" from the docsroot in the figure) and, for each one, a corresponding "workdir" ("book1" and "book2" from the workroot in the figure).
(booksroot)
|
+- book1/
| +- 1.pbm
| |
| +- 2.pbm
|
|
+- book2/
+- 1.pbm
|
+- 2.pbm
(workroot)
|
+- book1/
| +- 1.session
| |
| +- 1.html
| |
| +- 2.session
| |
| +- 2.html
| |
| +- acts
| |
| +- doubts/
| | +- s.1.319.pbm
| | |
| | +- u.2.7015.pbm
| | |
| | +- 1.958225189.17423.hal
| |
| +- pattern
|
+- book2/
| +- 1.session
| |
|
| 3.4 Adding a book (to be written) |
| 3.5 Removing a page |
From the stats presented by the PAGE (LIST) tab it's possible to detect problems on specific pages. A low factorization may be a simptom of a bad choice of brightness for that page. In such a case, it's probably a good idea to remove completely that page.
To remove a page is a delicate operation. Clara OCR currently does not offer a "remove page" feature. Basically, it should remove all patterns from that page, remove the revision data acquired from that page, and remove the page image and its session file.
| 3.6 Dealing with classification errors |
What to do when the OCR classifies incorrectly a large quantity of symbols? (to be written)
| 3.7 Rebuilding session files (to be written) |
| 3.8 Importing revision data |
When OCRing a large book, a good approach is to divide its pages into a number of smaller sections and OCR each one. So for a book with, say, 1000 pages, we could OCR pages 1-200, then 201-400, etc.
After finishing the first section, of course we desire reuse on the second section the training and revision effort already spent. This is not the same as adding the pages 201-400 to the first section, because we do not want handle the pages 1-200 anymore.
Basically we need to import the patterns of the first section when starting to process the second. Well, Clara OCR is currently unable to make this operation.
| 3.9 How to use the web interface |
The Clara OCR web interface allows remote training of symbols. To use it, a web server able to run perl CGIs (e.g. Apache) is required. Let's present the steps to activate the web interface for a simple case, with only one book (named "book1"). Basically, one needs to create a subtree anywhere on the server disk (say, "/home/clara/www/"), owned by the user that will manage the project (say, "clara"), with subdirectories, "bin", "book1" and "book1/doubts":
$ id
uid=511(clara) gid=511(clara) groups=511(clara)
$ cd /home/clara/
$ mkdir www
$ cd www
$ mkdir bin book1
$ mkdir book1/doubts
|
$ cd bin
$ cp /usr/local/src/clara/clara.pl .
$ cp /usr/local/src/clara/sclara.c .
$ emacs sclara.c
$ grep '^char *root' sclara.c
char *root = "/home/clara/www";
$ cc -o sclara -static sclara.c
$ rm sclara.c
$ chmod a+s sclara
|
$CROOT = "/home/clara/www";
$U = "/cgi-bin/clara";
$book[0] = 'Author, Test 1, City, year';
$subdir[0] = "book1";
$LANG = 'en';
$opt = '-W -R 10 -b -k 2,1.4,1.57,10,3.8,10,4,1';
|
$ cd /home/clara/www/book1
$ cp /usr/local/src/clara/imre.pbm .
$ pbmreduce 8 imre.pbm | convert -quality 25 - imre.jpg
$ gzip -9 imre.pbm
$ clara -k 2,1.4,1.57,10,3.8,10,4,1
|
Now we need to process the PBM files in order to create some "doubts". The script clara.pl also requires a symlink to the clara binary (change the path /usr/local/bin/clara as required):
$ cd /home/clara/www/bin
$ ln -s /usr/local/bin/clara clara
$ ./clara.pl -s book1
$ rm ../book1/*html
$ ./clara.pl -p
|
# cd /home/httpd/cgi-bin
# ln -sf /home/clara/www/bin/clara.pl clara
|
1. Apache expects to be explicitly allowed to follow symlinks. The file access.conf should contain, in our case, a section similar to the following:
|
# ls -ld /home/clara
drwxr-xr-x 4 clara clara 1024 Sep 17 09:56 /home/clara
|
$ cd /home/clara/www/bin
$ ./clara.pl -p
$ ./clara.pl -s book1
|
| 3.10 Revision acts maintenance |
Types of revision acts (to be written).
Discarding deduced data (to be written).
| 3.11 Analysing the statistics |
The "page (list)" tab offers recognition statistics on a per-page basis. The contents of each column on this tab is described below:
POS: The sequential position on the list. The current page is informed by an asterisk on this column.
FILE: The name of the file that contains the PBM image of the document.
RUNS: The number of OCR runs on this page. Partial OCR runs, like classification (started by the "classify" button also count as one run.
TIME: Total CPU time wasted with OCR operations on this page. I/O time (reading and saving session files) is not included.
WORDS: Current number of words on this page. This variable is updated by the "build" step.
SYMBOLS: Current number of symbols on this page. This variable is updated by the "build" step.
DOUBTS: Current number of untransliterated CHAR symbols on this page. This variable is updated by the "build" step.
CLASSES: Current number of classes on this page.
FACT: Quotient between the number of symbols and the number of classes.
RECOG: Quotient between (symbols-doubts) and symbols, where "symbols" is the number of symbols and "doubts" is the number of doubts as defined above.
PROGRESS: difference between the current recog rate and the recog rate for the previous run.
| 3.12 Upgrading Clara OCR (to be written) |
| 4. Reference of the Clara GUI |
In this section, the Clara application window will be described in detail, both to document all its features and to define the terminology.
| 4.1 The application window |
The application window is divided into three major areas: the buttons ("zoom", "OCR", "stop", etc) the "plate" (right), including the tabs ("page", "symbol" and "font"), and one or more "document windows" inside the plate.
We say "document window" because each window is exhibiting one "document". This "document" may be the scanned page (PAGE window), the current OCR output for this page (PAGE OUTPUT window), the symbol form (PAGE SYMBOL window), the GPL (GPL window) and so on. However, we'll refer the document windows merely as "windows".
Around each window there are two scrollbars. On the botton of the application window there is a status line. On the top there is a menu bar (fully documented on the section "Reference of the menus").
+-----------------------------------------------+
| File Edit OCR ... |
+-----------------------------------------------+
| +--------+ +----+ +--------+ +-------+ |
| | zoom | |page| |patterns| | tune | |
| +--------+ +-+ +-+ +-+ +-+ |
| +--------+ | +-------------------------+ | |
| | zone | | | | | |
| +--------+ | | | | |
| +--------+ | | | | |
| | OCR | | | WELCOME TO | | |
| +--------+ | | | | |
| +--------+ | | C L A R A O C R | | |
| | stop | | | | | |
| +--------+ | | | | |
| . | | | | |
| . | | | | |
| | | | | |
| | | | | |
| | +-------------------------+ | |
| +-----------------------------+ |
| |
| (status line) |
+-----------------------------------------------+
|
| 4.2 Tabs and windows |
Three tabs are oferred, and each one may operate in one or more "modes". For instance, pressing the PATTERN tab many times will circulate two modes: one presenting the windows "pattern" and "pattern (props)" and another with the window "pattern (list)".
On each tab, Clara OCR displays on the plate one or more windows. Each such window is called a "document window" to distinguish them from the application window. Each such window is supposed to be displaying a portion of a larger document, for instance
The scanned page (graphic)
The OCR output (text)
The list of pages (text)
The list of patterns (text)
The symbol description (text)
|
All available tabs and the modes for each one are listed below. The numbers (1, 2, etc) are only to make easier to distinguish one mode from the others. There is no effective association between the modes and the numbers.
tab mode windows
-------------------------------
1 WELCOME
2 GPL
3 PATTERN_ACTION
page 4 PAGE_LIST
5 PAGE
PAGE_OUTPUT
PAGE_SYMBOL
6 PAGE_FATBITS
PAGE_MATCHES
pattern 7 PATTERN
8 PATTERN_LIST
9 PATTERN_TYPES
tune 10 TUNE
11 TUNE_PATTERN
TUNE_SKEL
11 TUNE_ACTS
|
# cd /home/httpd/cgi-bin
# ln -sf /home/clara/www/bin/clara.pl clara
|
1. Apache expects to be explicitly allowed to follow symlinks. The file access.conf should contain, in our case, a section similar to the following:
|
# ls -ld /home/clara
drwxr-xr-x 4 clara clara 1024 Sep 17 09:56 /home/clara
|
$ cd /home/clara/www/bin
$ ./clara.pl -p
$ ./clara.pl -s book1
|
| 3.10 Revision acts maintenance |
Types of revision acts (to be written).
Discarding deduced data (to be written).
| 3.11 Analysing the statistics |
The "page (list)" tab offers recognition statistics on a per-page basis. The contents of each column on this tab is described below:
POS: The sequential position on the list. The current page is informed by an asterisk on this column.
FILE: The name of the file that contains the PBM image of the document.
RUNS: The number of OCR runs on this page. Partial OCR runs, like classification (started by the "classify" button also count as one run.
TIME: Total CPU time wasted with OCR operations on this page. I/O time (reading and saving session files) is not included.
WORDS: Current number of words on this page. This variable is updated by the "build" step.
SYMBOLS: Current number of symbols on this page. This variable is updated by the "build" step.
DOUBTS: Current number of untransliterated CHAR symbols on this page. This variable is updated by the "build" step.
CLASSES: Current number of classes on this page.
FACT: Quotient between the number of symbols and the number of classes.
RECOG: Quotient between (symbols-doubts) and symbols, where "symbols" is the number of symbols and "doubts" is the number of doubts as defined above.
PROGRESS: difference between the current recog rate and the recog rate for the previous run.
| 3.12 Upgrading Clara OCR (to be written) |
| 4. Reference of the Clara GUI |
In this section, the Clara application window will be described in detail, both to document all its features and to define the terminology.
| 4.1 The application window |
The application window is divided into three major areas: the buttons ("zoom", "OCR", "stop", etc) the "plate" (right), including the tabs ("page", "symbol" and "font"), and one or more "document windows" inside the plate.
We say "document window" because each window is exhibiting one "document". This "document" may be the scanned page (PAGE window), the current OCR output for this page (PAGE OUTPUT window), the symbol form (PAGE SYMBOL window), the GPL (GPL window) and so on. However, we'll refer the document windows merely as "windows".
Around each window there are two scrollbars. On the botton of the application window there is a status line. On the top there is a menu bar (fully documented on the section "Reference of the menus").
+-----------------------------------------------+
| File Edit OCR ... |
+-----------------------------------------------+
| +--------+ +----+ +--------+ +-------+ |
| | zoom | |page| |patterns| | tune | |
| +--------+ +-+ +-+ +-+ +-+ |
| +--------+ | +-------------------------+ | |
| | zone | | | | | |
| +--------+ | | | | |
| +--------+ | | | | |
| | OCR | | | WELCOME TO | | |
| +--------+ | | | | |
| +--------+ | | C L A R A O C R | | |
| | stop | | | | | |
| +--------+ | | | | |
| . | | | | |
| . | | | | |
| | | | | |
| | | | | |
| | +-------------------------+ | |
| +-----------------------------+ |
| |
| (status line) |
+-----------------------------------------------+
|
| 4.2 Tabs and windows |
Three tabs are oferred, and each one may operate in one or more "modes". For instance, pressing the PATTERN tab many times will circulate two modes: one presenting the windows "pattern" and "pattern (props)" and another with the window "pattern (list)".
On each tab, Clara OCR displays on the plate one or more windows. Each such window is called a "document window" to distinguish them from the application window. Each such window is supposed to be displaying a portion of a larger document, for instance
The scanned page (graphic)
The OCR output (text)
The list of pages (text)
The list of patterns (text)
The symbol description (text)
|
All available tabs and the modes for each one are listed below. The numbers (1, 2, etc) are only to make easier to distinguish one mode from the others. There is no effective association between the modes and the numbers.
tab mode windows
-------------------------------
1 WELCOME
2 GPL
3 PATTERN_ACTION
page 4 PAGE_LIST
5 PAGE
PAGE_OUTPUT
PAGE_SYMBOL
6 PAGE_FATBITS
PAGE_MATCHES
pattern 7 PATTERN
8 PATTERN_LIST
9 PATTERN_TYPES
tune 10 TUNE
11 TUNE_PATTERN
TUNE_SKEL
11 TUNE_ACTS
|
# cd /home/httpd/cgi-bin
# ln -sf /home/clara/www/bin/clara.pl clara
|
1. Apache expects to be explicitly allowed to follow symlinks. The file access.conf should contain, in our case, a section similar to the following:
|
# ls -ld /home/clara
drwxr-xr-x 4 clara clara 1024 Sep 17 09:56 /home/clara
|
$ cd /home/clara/www/bin
$ ./clara.pl -p
$ ./clara.pl -s book1
|
| 3.10 Revision acts maintenance |
Types of revision acts (to be written).
Discarding deduced data (to be written).
| 3.11 Analysing the statistics |
The "page (list)" tab offers recognition statistics on a per-page basis. The contents of each column on this tab is described below:
POS: The sequential position on the list. The current page is informed by an asterisk on this column.
FILE: The name of the file that contains the PBM image of the document.
RUNS: The number of OCR runs on this page. Partial OCR runs, like classification (started by the "classify" button also count as one run.
TIME: Total CPU time wasted with OCR operations on this page. I/O time (reading and saving session files) is not included.
WORDS: Current number of words on this page. This variable is updated by the "build" step.
SYMBOLS: Current number of symbols on this page. This variable is updated by the "build" step.
DOUBTS: Current number of untransliterated CHAR symbols on this page. This variable is updated by the "build" step.
CLASSES: Current number of classes on this page.
FACT: Quotient between the number of symbols and the number of classes.
RECOG: Quotient between (symbols-doubts) and symbols, where "symbols" is the number of symbols and "doubts" is the number of doubts as defined above.
PROGRESS: difference between the current recog rate and the recog rate for the previous run.
| 3.12 Upgrading Clara OCR (to be written) |
| 4. Reference of the Clara GUI |
In this section, the Clara application window will be described in detail, both to document all its features and to define the terminology.
| 4.1 The application window |
The application window is divided into three major areas: the buttons ("zoom", "OCR", "stop", etc) the "plate" (right), including the tabs ("page", "symbol" and "font"), and one or more "document windows" inside the plate.
We say "document window" because each window is exhibiting one "document". This "document" may be the scanned page (PAGE window), the current OCR output for this page (PAGE OUTPUT window), the symbol form (PAGE SYMBOL window), the GPL (GPL window) and so on. However, we'll refer the document windows merely as "windows".
Around each window there are two scrollbars. On the botton of the application window there is a status line. On the top there is a menu bar (fully documented on the section "Reference of the menus").
+-----------------------------------------------+
| File Edit OCR ... |
+-----------------------------------------------+
| +--------+ +----+ +--------+ +-------+ |
| | zoom | |page| |patterns| | tune | |
| +--------+ +-+ +-+ +-+ +-+ |
| +--------+ | +-------------------------+ | |
| | zone | | | | | |
| +--------+ | | | | |
| +--------+ | | | | |
| | OCR | | | WELCOME TO | | |
| +--------+ | | | | |
| +--------+ | | C L A R A O C R | | |
| | stop | | | | | |
| +--------+ | | | | |
| . | | | | |
| . | | | | |
| | | | | |
| | | | | |
| | +-------------------------+ | |
| +-----------------------------+ |
| |
| (status line) |
+-----------------------------------------------+
|
| 4.2 Tabs and windows |
Three tabs are oferred, and each one may operate in one or more "modes". For instance, pressing the PATTERN tab many times will circulate two modes: one presenting the windows "pattern" and "pattern (props)" and another with the window "pattern (list)".
On each tab, Clara OCR displays on the plate one or more windows. Each such window is called a "document window" to distinguish them from the application window. Each such window is supposed to be displaying a portion of a larger document, for instance
The scanned page (graphic)
The OCR output (text)
The list of pages (text)
The list of patterns (text)
The symbol description (text)
|
All available tabs and the modes for each one are listed below. The numbers (1, 2, etc) are only to make easier to distinguish one mode from the others. There is no effective association between the modes and the numbers.
tab mode windows
-------------------------------
1 WELCOME
2 GPL
3 PATTERN_ACTION
page 4 PAGE_LIST
5 PAGE
PAGE_OUTPUT
PAGE_SYMBOL
6 PAGE_FATBITS
PAGE_MATCHES
pattern 7 PATTERN
8 PATTERN_LIST
9 PATTERN_TYPES
tune 10 TUNE
11 TUNE_PATTERN
TUNE_SKEL
11 TUNE_ACTS
|
# cd /home/httpd/cgi-bin
# ln -sf /home/clara/www/bin/clara.pl clara
|
1. Apache expects to be explicitly allowed to follow symlinks. The file access.conf should contain, in our case, a section similar to the following:
|
# ls -ld /home/clara
drwxr-xr-x 4 clara clara 1024 Sep 17 09:56 /home/clara
|
$ cd /home/clara/www/bin
$ ./clara.pl -p
$ ./clara.pl -s book1
|
| 3.10 Revision acts maintenance |
Types of revision acts (to be written).
Discarding deduced data (to be written).
| 3.11 Analysing the statistics |
The "page (list)" tab offers recognition statistics on a per-page basis. The contents of each column on this tab is described below:
POS: The sequential position on the list. The current page is informed by an asterisk on this column.
FILE: The name of the file that contains the PBM image of the document.
RUNS: The number of OCR runs on this page. Partial OCR runs, like classification (started by the "classify" button also count as one run.
TIME: Total CPU time wasted with OCR operations on this page. I/O time (reading and saving session files) is not included.
WORDS: Current number of words on this page. This variable is updated by the "build" step.
SYMBOLS: Current number of symbols on this page. This variable is updated by the "build" step.
DOUBTS: Current number of untransliterated CHAR symbols on this page. This variable is updated by the "build" step.
CLASSES: Current number of classes on this page.
FACT: Quotient between the number of symbols and the number of classes.
RECOG: Quotient between (symbols-doubts) and symbols, where "symbols" is the number of symbols and "doubts" is the number of doubts as defined above.
PROGRESS: difference between the current recog rate and the recog rate for the previous run.
| 3.12 Upgrading Clara OCR (to be written) |
| 4. Reference of the Clara GUI |
In this section, the Clara application window will be described in detail, both to document all its features and to define the terminology.
| 4.1 The application window |
The application window is divided into three major areas: the buttons ("zoom", "OCR", "stop", etc) the "plate" (right), including the tabs ("page", "symbol" and "font"), and one or more "document windows" inside the plate.
We say "document window" because each window is exhibiting one "document". This "document" may be the scanned page (PAGE window), the current OCR output for this page (PAGE OUTPUT window), the symbol form (PAGE SYMBOL window), the GPL (GPL window) and so on. However, we'll refer the document windows merely as "windows".
Around each window there are two scrollbars. On the botton of the application window there is a status line. On the top there is a menu bar (fully documented on the section "Reference of the menus").
+-----------------------------------------------+
| File Edit OCR ... |
+-----------------------------------------------+
| +--------+ +----+ +--------+ +-------+ |
| | zoom | |page| |patterns| | tune | |
| +--------+ +-+ +-+ +-+ +-+ |
| +--------+ | +-------------------------+ | |
| | zone | | | | | |
| +--------+ | | | | |
| +--------+ | | | | |
| | OCR | | | WELCOME TO | | |
| +--------+ | | | | |
| +--------+ | | C L A R A O C R | | |
| | stop | | | | | |
| +--------+ | | | | |
| . | | | | |
| . | | | | |
| | | | | |
| | | | | |
| | +-------------------------+ | |
| +-----------------------------+ |
| |
| (status line) |
+-----------------------------------------------+
|
| 4.2 Tabs and windows |
Three tabs are oferred, and each one may operate in one or more "modes". For instance, pressing the PATTERN tab many times will circulate two modes: one presenting the windows "pattern" and "pattern (props)" and another with the window "pattern (list)".
On each tab, Clara OCR displays on the plate one or more windows. Each such window is called a "document window" to distinguish them from the application window. Each such window is supposed to be displaying a portion of a larger document, for instance
The scanned page (graphic)
The OCR output (text)
The list of pages (text)
The list of patterns (text)
The symbol description (text)
|
All available tabs and the modes for each one are listed below. The numbers (1, 2, etc) are only to make easier to distinguish one mode from the others. There is no effective association between the modes and the numbers.
tab mode windows
-------------------------------
1 WELCOME
2 GPL
3 PATTERN_ACTION
page 4 PAGE_LIST
5 PAGE
PAGE_OUTPUT
PAGE_SYMBOL
6 PAGE_FATBITS
PAGE_MATCHES
pattern 7 PATTERN
8 PATTERN_LIST
9 PATTERN_TYPES
tune 10 TUNE
11 TUNE_PATTERN
TUNE_SKEL
11 TUNE_ACTS
|
# cd /home/httpd/cgi-bin
# ln -sf /home/clara/www/bin/clara.pl clara
|
1. Apache expects to be explicitly allowed to follow symlinks. The file access.conf should contain, in our case, a section similar to the following:
|
# ls -ld /home/clara
drwxr-xr-x 4 clara clara 1024 Sep 17 09:56 /home/clara
|
$ cd /home/clara/www/bin
$ ./clara.pl -p
$ ./clara.pl -s book1
|
| 3.10 Revision acts maintenance |
Types of revision acts (to be written).
Discarding deduced data (to be written).
| 3.11 Analysing the statistics |
The "page (list)" tab offers recognition statistics on a per-page basis. The contents of each column on this tab is described below:
POS: The sequential position on the list. The current page is informed by an asterisk on this column.
FILE: The name of the file that contains the PBM image of the document.
RUNS: The number of OCR runs on this page. Partial OCR runs, like classification (started by the "classify" button also count as one run.
TIME: Total CPU time wasted with OCR operations on this page. I/O time (reading and saving session files) is not included.
WORDS: Current number of words on this page. This variable is updated by the "build" step.
SYMBOLS: Current number of symbols on this page. This variable is updated by the "build" step.
DOUBTS: Current number of untransliterated CHAR symbols on this page. This variable is updated by the "build" step.
CLASSES: Current number of classes on this page.
FACT: Quotient between the number of symbols and the number of classes.
RECOG: Quotient between (symbols-doubts) and symbols, where "symbols" is the number of symbols and "doubts" is the number of doubts as defined above.
PROGRESS: difference between the current recog rate and the recog rate for the previous run.
| 3.12 Upgrading Clara OCR (to be written) |
| 4. Reference of the Clara GUI |
In this section, the Clara application window will be described in detail, both to document all its features and to define the terminology.
| 4.1 The application window |
The application window is divided into three major areas: the buttons ("zoom", "OCR", "stop", etc) the "plate" (right), including the tabs ("page", "symbol" and "font"), and one or more "document windows" inside the plate.
We say "document window" because each window is exhibiting one "document". This "document" may be the scanned page (PAGE window), the current OCR output for this page (PAGE OUTPUT window), the symbol form (PAGE SYMBOL window), the GPL (GPL window) and so on. However, we'll refer the document windows merely as "windows".
Around each window there are two scrollbars. On the botton of the application window there is a status line. On the top there is a menu bar (fully documented on the section "Reference of the menus").
+-----------------------------------------------+
| File Edit OCR ... |
+-----------------------------------------------+
| +--------+ +----+ +--------+ +-------+ |
| | zoom | |page| |patterns| | tune | |
| +--------+ +-+ +-+ +-+ +-+ |
| +--------+ | +-------------------------+ | |
| | zone | | | | | |
| +--------+ | | | | |
| +--------+ | | | | |
| | OCR | | | WELCOME TO | | |
| +--------+ | | | | |
| +--------+ | | C L A R A O C R | | |
| | stop | | | | | |
| +--------+ | | | | |
| . | | | | |
| . | | | | |
| | | | | |
| | | | | |
| | +-------------------------+ | |
| +-----------------------------+ |
| |
| (status line) |
+-----------------------------------------------+
|
| 4.2 Tabs and windows |
Three tabs are oferred, and each one may operate in one or more "modes". For instance, pressing the PATTERN tab many times will circulate two modes: one presenting the windows "pattern" and "pattern (props)" and another with the window "pattern (list)".
On each tab, Clara OCR displays on the plate one or more windows. Each such window is called a "document window" to distinguish them from the application window. Each such window is supposed to be displaying a portion of a larger document, for instance
The scanned page (graphic)
The OCR output (text)
The list of pages (text)
The list of patterns (text)
The symbol description (text)
|
All available tabs and the modes for each one are listed below. The numbers (1, 2, etc) are only to make easier to distinguish one mode from the others. There is no effective association between the modes and the numbers.
tab mode windows
-------------------------------
1 WELCOME
2 GPL
3 PATTERN_ACTION
page 4 PAGE_LIST
5 PAGE
PAGE_OUTPUT
PAGE_SYMBOL
6 PAGE_FATBITS
PAGE_MATCHES
pattern 7 PATTERN
8 PATTERN_LIST
9 PATTERN_TYPES
tune 10 TUNE
11 TUNE_PATTERN
TUNE_SKEL
11 TUNE_ACTS
|
# cd /home/httpd/cgi-bin
# ln -sf /home/clara/www/bin/clara.pl clara
|
1. Apache expects to be explicitly allowed to follow symlinks. The file access.conf should contain, in our case, a section similar to the following:
|
# ls -ld /home/clara
drwxr-xr-x 4 clara clara 1024 Sep 17 09:56 /home/clara
|
$ cd /home/clara/www/bin
$ ./clara.pl -p
$ ./clara.pl -s book1
|
| 3.10 Revision acts maintenance |
Types of revision acts (to be written).
Discarding deduced data (to be written).
| 3.11 Analysing the statistics |
The "page (list)" tab offers recognition statistics on a per-page basis. The contents of each column on this tab is described below:
POS: The sequential position on the list. The current page is informed by an asterisk on this column.
FILE: The name of the file that contains the PBM image of the document.
RUNS: The number of OCR runs on this page. Partial OCR runs, like classification (started by the "classify" button also count as one run.
TIME: Total CPU time wasted with OCR operations on this page. I/O time (reading and saving session files) is not included.
WORDS: Current number of words on this page. This variable is updated by the "build" step.
SYMBOLS: Current number of symbols on this page. This variable is updated by the "build" step.
DOUBTS: Current number of untransliterated CHAR symbols on this page. This variable is updated by the "build" step.
CLASSES: Current number of classes on this page.
FACT: Quotient between the number of symbols and the number of classes.
RECOG: Quotient between (symbols-doubts) and symbols, where "symbols" is the number of symbols and "doubts" is the number of doubts as defined above.
PROGRESS: difference between the current recog rate and the recog rate for the previous run.
| 3.12 Upgrading Clara OCR (to be written) |
| 4. Reference of the Clara GUI |
In this section, the Clara application window will be described in detail, both to document all its features and to define the terminology.
| 4.1 The application window |
The application window is divided into three major areas: the buttons ("zoom", "OCR", "stop", etc) the "plate" (right), including the tabs ("page", "symbol" and "font"), and one or more "document windows" inside the plate.
We say "document window" because each window is exhibiting one "document". This "document" may be the scanned page (PAGE window), the current OCR output for this page (PAGE OUTPUT window), the symbol form (PAGE SYMBOL window), the GPL (GPL window) and so on. However, we'll refer the document windows merely as "windows".
Around each window there are two scrollbars. On the botton of the application window there is a status line. On the top there is a menu bar (fully documented on the section "Reference of the menus").
+-----------------------------------------------+
| File Edit OCR ... |
+-----------------------------------------------+
| +--------+ +----+ +--------+ +-------+ |
| | zoom | |page| |patterns| | tune | |
| +--------+ +-+ +-+ +-+ +-+ |
| +--------+ | +-------------------------+ | |
| | zone | | | | | |
| +--------+ | | | | |
| +--------+ | | | | |
| | OCR | | | WELCOME TO | | |
| +--------+ | | | | |
| +--------+ | | C L A R A O C R | | |
| | stop | | | |