ocrad-0.22/AUTHORS 0000644 0000764 0000144 00000000157 10164067322 012153 0 ustar yo users GNU Ocrad was written by Antonio Diaz Diaz.
Thanks to Klaas Freitag for his ideas about the ORF file feature.
ocrad-0.22/COPYING 0000644 0000764 0000144 00000104374 10641002347 012140 0 ustar yo users
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
ocrad-0.22/ChangeLog 0000644 0000764 0000144 00000016114 12166633570 012665 0 ustar yo users 2013-07-09 Antonio Diaz Diaz
* Version 0.22 released.
* Scaling and smoothing are now made before thresholding.
* Improvements in character recognition.
* ocradlib.h: Added new function OCRAD_set_utf8_format.
* Small improvements have been made in manual and man page.
* Changed quote characters in messages as advised by GNU Standards.
* configure: Options now accept a separate argument.
* configure: 'datadir' renamed to 'datarootdir'.
* Makefile.in: Added new target 'install-bin'.
2011-01-10 Antonio Diaz Diaz
* Version 0.21 released.
* Fixed some internal errors triggered by noisy input.
* ocrad.texinfo: Added chapter 'OCR Results File'.
* main.cc: Set stdin/stdout in binary mode on MSVC and OS2.
2010-07-16 Antonio Diaz Diaz
* Version 0.20 released.
* ocradlib.h: Added new function OCRAD_scale.
* ocradlib.h: Added new function OCRAD_result_chars_total.
* ocradlib.h: Added new function OCRAD_result_chars_block.
* ocradlib.h: Added new function OCRAD_result_chars_line.
2010-01-27 Antonio Diaz Diaz
* Version 0.19 released.
* Added library interface (ocradlib.h).
* Option '--crop' replaced with similar but different option
'--cut', which can accept coordinates taken from the ORF file.
* Recognition of files with a single character and without white
space at the edges has been fixed.
* testsuite/check.sh: Added new tests for the library interface
and for single character images.
* New files ocradlib.h, ocradlib.cc, ocrcheck.cc.
* Makefile.in: Added '--name' option to help2man invocation.
2009-05-08 Antonio Diaz Diaz
* Version 0.18 released.
* Added a layout analyser able to process arbitrary pages.
* Added new option '--quiet'.
* The '--layout' option no more accepts an argument.
* The '--crop' option now accepts negative coordinates.
* New recognized letter; 'a' with ring above.
* Fixed recognition on files with a single big character.
* Fixed bug that didn't write maxval when saving pgm or ppm.
* Fixed some includes that prevented compilation with GCC 4.3.0.
* 'make install-info' should now work on Debian and OS X.
* Makefile.in: Man page is now installed by default.
* New file testsuite/check.sh.
* Arg_parser updated to 1.2.
* Verbosity control of messages has been modified.
2007-06-29 Antonio Diaz Diaz
* Version 0.17 released.
* License updated to GPL version 3 or later.
* '--scale' no more suppresses ORF output.
* Improved removal of thick frames.
* Changed 'Textline' to accept more than one big initial.
* Class 'Block' renamed to 'Blob'.
* 'configure' and 'Makefile.in' have been modified to be more
GNU-standards compliant.
2006-10-20 Antonio Diaz Diaz
* Version 0.16 released.
* Added new option '--filter'.
* Better algorithm for vertical space detection (blank lines).
* Some fixes made to 'configure' script.
* Added two new debug levels.
* Improvements in character recognition.
2006-04-03 Antonio Diaz Diaz
* Version 0.15 released.
* Added new argument parser that replaces 'getopt_long'.
* Fixed a bug that prevented compilation with GCC 4.1.
2006-02-15 Antonio Diaz Diaz
* Version 0.14 released.
* Ocrad is now able to read ppm files.
* Added new class 'Page_image' (256-level greymap).
* Added automatic and adaptive binarization by Otsu's method.
* Added new option '--crop'.
* Added two new chapters 'Image Format Conversion' and
'Algorithm' to the texinfo file.
* Target 'check' added to Makefile.
* Changed 'ocrad.png' icon to color, one line.
2005-10-10 Antonio Diaz Diaz
* Version 0.13 released.
* Ocrad is now able to read pgm files.
* Added new rational number class.
* Use rationals instead of integers in space detection algorithm.
* Better algorithm for space detection in tables.
* 'vector' replaced by 'vector' in bitmap (faster).
* Variable-size arrays replaced by vectors in block.cc.
* Fixed sizeof(size_t) != sizeof(int) on some 64 bit systems.
* Improved number recognition (mainly in textline_r2.cc).
* Overflow detection when loading or scaling file.
* Fixed a miscompilation with GCC 3.3.1.
* Class 'Vrhomboid' merged into files 'track.h' and 'track.cc'.
2005-06-07 Antonio Diaz Diaz
* Version 0.12 released.
* Change in internal representation; Blockmap has been eliminated.
* Text inside tables of solid lines is now recognized.
* Improvements in character recognition.
* Fixed possible integer overflow when loading pbm file.
2005-02-12 Antonio Diaz Diaz
* Version 0.11 released.
* Added new option '--scale'.
* Improvements in character recognition.
* Fixed bug in '--transform' (introduced in 0.10).
2004-12-09 Antonio Diaz Diaz
* Version 0.10 released.
* Added new suboption '-D7X'.
* Change in internal representation; only 1 Blockmap per Textpage.
* Use of absolute coordinates in ORF file.
* Improved space detection algorithm.
* Improvements in character recognition and separation.
2004-10-23 Antonio Diaz Diaz
* Version 0.9 released.
* Added new option '--transform'.
* 'DESTDIR' now works as expected.
* New class 'Textpage' is top of internal representation.
2004-05-23 Antonio Diaz Diaz
* Version 0.8 released.
* Better algorithm for line detection.
* New feature '-x -' (export ORF file to stdout).
* Small improvements in picture elimination.
2004-02-09 Antonio Diaz Diaz
* Version 0.7 released.
* Internal change to UCS instead of ISO 8859-1.
* Default charset is now ISO 8859-15 (latin9).
* Ocrad now recognizes Turkish characters (ISO 8859-9).
* Added new output format (UTF-8).
* Added new options '--charset' and '--format'.
* Added man page.
2003-12-18 Antonio Diaz Diaz
* Version 0.6 released.
* 'configure' is now compatible with 'sh'.
* Better algorithm for lowercase-uppercase decision.
* Small changes to line detector.
* Fixed bug (output of char 0 when separating some merged chars).
2003-10-18 Antonio Diaz Diaz
* Version 0.5 released.
* Corrected bug when creating ORF file from stdin.
* Added the ability to read multiple files from stdin.
* Use 'vector' instead of 'list' due to problem with GCC 3.3.1.
* Faster 'processing' of pictures.
2003-09-03 Antonio Diaz Diaz
* Version 0.4 released.
* More standard configure and Makefile.
* Added info file.
* Small changes to layout detector.
* Character codes > 127 now in ISO_8859_1:: format.
* Added new option '--invert'.
2003-07-19 Antonio Diaz Diaz
* Version 0.3 released.
* ORF file feature added.
* Recursive 'layout detector' added.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
2013 Antonio Diaz Diaz.
This file is a collection of facts, and thus it is not copyrightable,
but just in case, you have unlimited permission to copy, distribute and
modify it.
ocrad-0.22/INSTALL 0000644 0000764 0000144 00000003365 12154113151 012131 0 ustar yo users Requirements
------------
You will need a C++ compiler.
I use gcc 4.8.1 and 3.3.6, but the code should compile with any
standards compliant compiler.
Gcc is available at http://gcc.gnu.org.
Procedure
---------
1. Unpack the archive if you have not done so already:
lzip -cd ocrad[version].tar.lz | tar -xf -
or
gzip -cd ocrad[version].tar.gz | tar -xf -
This creates the directory ./ocrad[version] containing the source from
the main archive.
2. Change to ocrad directory and run configure.
(Try 'configure --help' for usage instructions).
cd ocrad[version]
./configure
3. Run make.
make
4. Optionally, type 'make check' to run the tests that come with ocrad.
5. Type 'make install' to install the program, the library and any data
files and documentation.
You can install only the program, the info manual or the man page
typing 'make install-bin', 'make install-info' or 'make install-man'
respectively.
Another way
-----------
You can also compile ocrad into a separate directory. To do this, you
must use a version of 'make' that supports the 'VPATH' variable, such
as GNU 'make'. 'cd' to the directory where you want the object files
and executables to go and run the 'configure' script. 'configure'
automatically checks for the source code in '.', in '..' and in the
directory that 'configure' is in.
'configure' recognizes the option '--srcdir=DIR' to control where to
look for the sources. Usually 'configure' can determine that directory
automatically.
After running 'configure', you can run 'make' and 'make install' as
explained above.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
2013 Antonio Diaz Diaz.
This file is free documentation: you have unlimited permission to copy,
distribute and modify it.
ocrad-0.22/Makefile.in 0000644 0000764 0000144 00000012634 12150250067 013150 0 ustar yo users
DISTNAME = $(pkgname)-$(pkgversion)
AR = ar
INSTALL = install
INSTALL_PROGRAM = $(INSTALL) -p -m 755
INSTALL_DATA = $(INSTALL) -p -m 644
INSTALL_DIR = $(INSTALL) -d -m 755
SHELL = /bin/sh
lib_objs = ocradlib.o
ocr_objs = common.o segment.o mask.o rational.o rectangle.o track.o \
ucs.o page_image.o page_image_io.o \
bitmap.o blob.o profile.o feats.o feats_test0.o feats_test1.o \
character.o character_r11.o character_r12.o character_r13.o \
textline.o textline_r2.o textblock.o textpage.o
objs = arg_parser.o main.o
.PHONY : all install install-bin install-info install-man install-strip \
uninstall uninstall-bin uninstall-info uninstall-man \
doc info man check dist clean distclean
all : $(progname) lib$(libname).a
lib$(libname).a: $(ocr_objs) $(lib_objs)
$(AR) -rcs $@ $(ocr_objs) $(lib_objs)
$(progname) : $(ocr_objs) $(objs)
$(CXX) $(LDFLAGS) -o $@ $(ocr_objs) $(objs)
$(progname)_profiled : $(ocr_objs) $(objs)
$(CXX) $(LDFLAGS) -pg -o $@ $(ocr_objs) $(objs)
ocrcheck : ocrcheck.o lib$(libname).a
$(CXX) $(LDFLAGS) -o $@ ocrcheck.o lib$(libname).a
ocrcheck.o : ocrcheck.cc
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -DPROGVERSION=\"$(pkgversion)\" -c -o $@ $<
main.o : main.cc
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -DPROGVERSION=\"$(pkgversion)\" -c -o $@ $<
%.o : %.cc
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
$(lib_objs) : Makefile ocradlib.h
$(ocr_objs) : Makefile bitmap.h blob.h common.h rectangle.h ucs.h
$(objs) : Makefile arg_parser.h
character.o : character.h
character_r11.o : segment.h character.h profile.h feats.h
character_r12.o : segment.h character.h profile.h feats.h
character_r13.o : segment.h character.h profile.h feats.h
feats.o : segment.h profile.h feats.h
feats_test0.o : segment.h profile.h feats.h
feats_test1.o : segment.h profile.h feats.h
main.o : common.h rational.h rectangle.h page_image.h textpage.h
mask.o : segment.h mask.h
ocradlib.o : common.h rectangle.h ucs.h track.h bitmap.h blob.h character.h page_image.h textline.h textblock.h textpage.h
page_image.o : ocradlib.h rational.h segment.h mask.h track.h page_image.h
page_image_io.o : rational.h page_image.h
profile.o : profile.h
rational.o : rational.h
segment.o : segment.h
textblock.o : rational.h track.h character.h page_image.h textline.h textblock.h
textline.o : rational.h track.h character.h page_image.h textline.h
textline_r2.o : track.h character.h textline.h
textpage.o : segment.h mask.h track.h character.h page_image.h textline.h textblock.h textpage.h
track.o : track.h
ocrcheck.o : Makefile ocradlib.h
doc : info man
info : $(VPATH)/doc/$(pkgname).info
$(VPATH)/doc/$(pkgname).info : $(VPATH)/doc/$(pkgname).texinfo
cd $(VPATH)/doc && makeinfo $(pkgname).texinfo
man : $(VPATH)/doc/$(progname).1
$(VPATH)/doc/$(progname).1 : $(progname)
help2man -n 'command line text recognition tool' \
-o $@ ./$(progname)
Makefile : $(VPATH)/configure $(VPATH)/Makefile.in
./config.status
check : all ocrcheck
@$(VPATH)/testsuite/check.sh $(VPATH)/testsuite $(pkgversion)
install : install-bin install-info install-man
install-bin : all
if [ ! -d "$(DESTDIR)$(bindir)" ] ; then $(INSTALL_DIR) "$(DESTDIR)$(bindir)" ; fi
if [ ! -d "$(DESTDIR)$(includedir)" ] ; then $(INSTALL_DIR) "$(DESTDIR)$(includedir)" ; fi
if [ ! -d "$(DESTDIR)$(libdir)" ] ; then $(INSTALL_DIR) "$(DESTDIR)$(libdir)" ; fi
$(INSTALL_PROGRAM) ./$(progname) "$(DESTDIR)$(bindir)/$(progname)"
$(INSTALL_DATA) $(VPATH)/$(libname)lib.h "$(DESTDIR)$(includedir)/$(libname)lib.h"
$(INSTALL_DATA) ./lib$(libname).a "$(DESTDIR)$(libdir)/lib$(libname).a"
install-info :
if [ ! -d "$(DESTDIR)$(infodir)" ] ; then $(INSTALL_DIR) "$(DESTDIR)$(infodir)" ; fi
$(INSTALL_DATA) $(VPATH)/doc/$(pkgname).info "$(DESTDIR)$(infodir)/$(pkgname).info"
-install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$(pkgname).info"
install-man :
if [ ! -d "$(DESTDIR)$(mandir)/man1" ] ; then $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" ; fi
$(INSTALL_DATA) $(VPATH)/doc/$(progname).1 "$(DESTDIR)$(mandir)/man1/$(progname).1"
install-strip : all
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
uninstall : uninstall-bin uninstall-info uninstall-man
uninstall-bin :
-rm -f "$(DESTDIR)$(bindir)/$(progname)"
-rm -f "$(DESTDIR)$(includedir)/$(libname)lib.h"
-rm -f "$(DESTDIR)$(libdir)/lib$(libname).a"
uninstall-info :
-install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$(pkgname).info"
-rm -f "$(DESTDIR)$(infodir)/$(pkgname).info"
uninstall-man :
-rm -f "$(DESTDIR)$(mandir)/man1/$(progname).1"
dist : doc
ln -sf $(VPATH) $(DISTNAME)
tar -cvf $(DISTNAME).tar \
$(DISTNAME)/AUTHORS \
$(DISTNAME)/COPYING \
$(DISTNAME)/ChangeLog \
$(DISTNAME)/INSTALL \
$(DISTNAME)/Makefile.in \
$(DISTNAME)/NEWS \
$(DISTNAME)/README \
$(DISTNAME)/configure \
$(DISTNAME)/doc/$(progname).1 \
$(DISTNAME)/doc/$(pkgname).info \
$(DISTNAME)/doc/$(pkgname).texinfo \
$(DISTNAME)/testsuite/check.sh \
$(DISTNAME)/testsuite/test.pbm \
$(DISTNAME)/testsuite/test.txt \
$(DISTNAME)/testsuite/test_utf8.txt \
$(DISTNAME)/ocrad.png \
$(DISTNAME)/*.h \
$(DISTNAME)/*.cc
rm -f $(DISTNAME)
lzip -v -9 $(DISTNAME).tar
clean :
-rm -f $(progname) $(progname)_profiled $(objs)
-rm -f ocrcheck ocrcheck.o $(ocr_objs) $(lib_objs) *.a
distclean : clean
-rm -f Makefile config.status *.tar *.tar.lz
ocrad-0.22/NEWS 0000644 0000764 0000144 00000001074 12160310700 011566 0 ustar yo users Changes in version 0.22:
Scaling and smoothing are now made before thresholding.
Character recognition has been improved. (D - O, H - N, O - Q, V - Y, merged TT).
New library function OCRAD_set_utf8_format.
Small improvements have been made in the manual and in the man page.
Quote characters in messages have been changed as advised by GNU Coding
Standards.
"configure" now accepts options with a separate argument.
Configure option "--datadir" has been renamed to "--datarootdir" to
follow GNU Standards.
The target "install-bin" has been added to the Makefile.
ocrad-0.22/README 0000644 0000764 0000144 00000004025 12166633570 011771 0 ustar yo users Description
GNU Ocrad is an OCR (Optical Character Recognition) program and library
based on a feature extraction method. It reads images in pbm (bitmap),
pgm (greyscale) or ppm (color) formats and produces text in byte (8-bit)
or UTF-8 formats. The pbm, pgm and ppm formats are collectively known as
pnm.
Ocrad includes a layout analyser able to separate the columns or blocks
of text normally found on printed pages.
See the file INSTALL for compilation and installation instructions.
Try "ocrad --help" for usage instructions.
Caveats.
For better results the characters should be at least 20 pixels high. If
they are smaller, try the --scale option.
Merged characters are always a problem. Try to avoid them.
Very bold or very light (broken) characters are also a problem.
Always see with your own eyes the pnm file before blaming ocrad for the
results. Remember the saying, "garbage in, garbage out".
Ideas, comments, patches, donations (hardware, money, etc), etc, are welcome.
---------------------------
Debug levels ( option -D )
100 - Show raw block list.
99 - Show recursive block list.
98 - Show main block list.
96..97 - reserved.
95 - Show all blocks from every character before recognition.
94 - Show main black blocks from every character before recognition.
90..93 - reserved.
89 - Show all blocks from every character.
88 - Show main black blocks from every character.
87 - Show guess list for every character.
86 - Show best guess for every character.
80..85 - reserved.
78..79 - reserved.
7X - X = 0 Show page as bitmap.
X = 1 Show page as bitmap with marked zones.
X = 2 Show page as bitmap with marked lines.
X = 4 Show page as bitmap with marked characters.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
2013 Antonio Diaz Diaz.
This file is free documentation: you have unlimited permission to copy,
distribute and modify it.
The file Makefile.in is a data file used by configure to produce the
Makefile. It has the same copyright owner and permissions that configure
itself.
ocrad-0.22/configure 0000755 0000764 0000144 00000014221 12166635101 013007 0 ustar yo users #! /bin/sh
# configure script for GNU Ocrad - Optical Character Recognition program
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
# 2012, 2013 Antonio Diaz Diaz.
#
# This configure script is free software: you have unlimited permission
# to copy, distribute and modify it.
pkgname=ocrad
pkgversion=0.22
progname=ocrad
libname=ocrad
srctrigger=${libname}lib.h
# clear some things potentially inherited from environment.
LC_ALL=C
export LC_ALL
srcdir=
prefix=/usr/local
exec_prefix='$(prefix)'
bindir='$(exec_prefix)/bin'
datarootdir='$(prefix)/share'
includedir='${prefix}/include'
infodir='$(datarootdir)/info'
libdir='${exec_prefix}/lib'
mandir='$(datarootdir)/man'
CXX=g++
CPPFLAGS=
CXXFLAGS='-Wall -W -O2'
LDFLAGS=
# checking whether we are using GNU C++.
${CXX} --version > /dev/null 2>&1
if [ $? != 0 ] ; then
CXX=c++
CXXFLAGS='-W -O2'
fi
# Loop over all args
args=
no_create=
while [ $# != 0 ] ; do
# Get the first arg, and shuffle
option=$1 ; arg2=no
shift
# Add the argument quoted to args
args="${args} \"${option}\""
# Split out the argument for options that take them
case ${option} in
*=*) optarg=`echo ${option} | sed -e 's,^[^=]*=,,;s,/$,,'` ;;
esac
# Process the options
case ${option} in
--help | -h)
echo "Usage: configure [options]"
echo
echo "Options: [defaults in brackets]"
echo " -h, --help display this help and exit"
echo " -V, --version output version information and exit"
echo " --srcdir=DIR find the sources in DIR [. or ..]"
echo " --prefix=DIR install into DIR [${prefix}]"
echo " --exec-prefix=DIR base directory for arch-dependent files [${exec_prefix}]"
echo " --bindir=DIR user executables directory [${bindir}]"
echo " --datarootdir=DIR base directory for doc and data [${datarootdir}]"
echo " --includedir=DIR C header files [${includedir}]"
echo " --infodir=DIR info files directory [${infodir}]"
echo " --libdir=DIR object code libraries [${libdir}]"
echo " --mandir=DIR man pages directory [${mandir}]"
echo " CXX=COMPILER C++ compiler to use [g++]"
echo " CPPFLAGS=OPTIONS command line options for the preprocessor [${CPPFLAGS}]"
echo " CXXFLAGS=OPTIONS command line options for the C++ compiler [${CXXFLAGS}]"
echo " LDFLAGS=OPTIONS command line options for the linker [${LDFLAGS}]"
echo
exit 0 ;;
--version | -V)
echo "Configure script for GNU ${pkgname} version ${pkgversion}"
exit 0 ;;
--srcdir) srcdir=$1 ; arg2=yes ;;
--prefix) prefix=$1 ; arg2=yes ;;
--exec-prefix) exec_prefix=$1 ; arg2=yes ;;
--bindir) bindir=$1 ; arg2=yes ;;
--datarootdir) datarootdir=$1 ; arg2=yes ;;
--includedir) includedir=$1 ; arg2=yes ;;
--infodir) infodir=$1 ; arg2=yes ;;
--libdir) libdir=$1 ; arg2=yes ;;
--mandir) mandir=$1 ; arg2=yes ;;
--srcdir=*) srcdir=${optarg} ;;
--prefix=*) prefix=${optarg} ;;
--exec-prefix=*) exec_prefix=${optarg} ;;
--bindir=*) bindir=${optarg} ;;
--datarootdir=*) datarootdir=${optarg} ;;
--includedir=*) includedir=${optarg} ;;
--infodir=*) infodir=${optarg} ;;
--libdir=*) libdir=${optarg} ;;
--mandir=*) mandir=${optarg} ;;
--no-create) no_create=yes ;;
CXX=*) CXX=${optarg} ;;
CPPFLAGS=*) CPPFLAGS=${optarg} ;;
CXXFLAGS=*) CXXFLAGS=${optarg} ;;
LDFLAGS=*) LDFLAGS=${optarg} ;;
--*)
echo "configure: WARNING: unrecognized option: '${option}'" 1>&2 ;;
*=* | *-*-*) ;;
*)
echo "configure: unrecognized option: '${option}'" 1>&2
echo "Try 'configure --help' for more information." 1>&2
exit 1 ;;
esac
# Check if the option took a separate argument
if [ "${arg2}" = yes ] ; then
if [ $# != 0 ] ; then args="${args} \"$1\"" ; shift
else echo "configure: Missing argument to '${option}'" 1>&2
exit 1
fi
fi
done
# Find the source files, if location was not specified.
srcdirtext=
if [ -z "${srcdir}" ] ; then
srcdirtext="or . or .." ; srcdir=.
if [ ! -r "${srcdir}/${srctrigger}" ] ; then srcdir=.. ; fi
if [ ! -r "${srcdir}/${srctrigger}" ] ; then
## the sed command below emulates the dirname command
srcdir=`echo $0 | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
fi
fi
if [ ! -r "${srcdir}/${srctrigger}" ] ; then
echo "configure: Can't find sources in ${srcdir} ${srcdirtext}" 1>&2
echo "configure: (At least ${srctrigger} is missing)." 1>&2
exit 1
fi
# Set srcdir to . if that's what it is.
if [ "`pwd`" = "`cd "${srcdir}" ; pwd`" ] ; then srcdir=. ; fi
echo
if [ -z "${no_create}" ] ; then
echo "creating config.status"
rm -f config.status
cat > config.status << EOF
#! /bin/sh
# This file was generated automatically by configure. Do not edit.
# Run this file to recreate the current configuration.
#
# This script is free software: you have unlimited permission
# to copy, distribute and modify it.
exec /bin/sh $0 ${args} --no-create
EOF
chmod +x config.status
fi
echo "creating Makefile"
echo "VPATH = ${srcdir}"
echo "prefix = ${prefix}"
echo "exec_prefix = ${exec_prefix}"
echo "bindir = ${bindir}"
echo "datarootdir = ${datarootdir}"
echo "includedir = ${includedir}"
echo "infodir = ${infodir}"
echo "libdir = ${libdir}"
echo "mandir = ${mandir}"
echo "CXX = ${CXX}"
echo "CPPFLAGS = ${CPPFLAGS}"
echo "CXXFLAGS = ${CXXFLAGS}"
echo "LDFLAGS = ${LDFLAGS}"
rm -f Makefile
cat > Makefile << EOF
# Makefile for GNU Ocrad - Optical Character Recognition program
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
# 2012, 2013 Antonio Diaz Diaz.
# This file was generated automatically by configure. Do not edit.
#
# This Makefile is free software: you have unlimited permission
# to copy, distribute and modify it.
pkgname = ${pkgname}
pkgversion = ${pkgversion}
progname = ${progname}
libname = ${libname}
VPATH = ${srcdir}
prefix = ${prefix}
exec_prefix = ${exec_prefix}
bindir = ${bindir}
datarootdir = ${datarootdir}
includedir = ${includedir}
infodir = ${infodir}
libdir = ${libdir}
mandir = ${mandir}
CXX = ${CXX}
CPPFLAGS = ${CPPFLAGS}
CXXFLAGS = ${CXXFLAGS}
LDFLAGS = ${LDFLAGS}
EOF
cat "${srcdir}/Makefile.in" >> Makefile
echo "OK. Now you can run make."
ocrad-0.22/doc/ocrad.1 0000644 0000764 0000144 00000005507 12166635142 013033 0 ustar yo users .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
.TH OCRAD "1" "July 2013" "Ocrad 0.22" "User Commands"
.SH NAME
Ocrad \- command line text recognition tool
.SH SYNOPSIS
.B ocrad
[\fIoptions\fR] [\fIfiles\fR]
.SH DESCRIPTION
GNU Ocrad is an OCR (Optical Character Recognition) program based on a
feature extraction method. It reads images in pbm (bitmap), pgm
(greyscale) or ppm (color) formats and produces text in byte (8\-bit) or
UTF\-8 formats. The pbm, pgm and ppm formats are collectively known as pnm.
.PP
Ocrad includes a layout analyser able to separate the columns or blocks
of text normally found on printed pages.
.SH OPTIONS
.TP
\fB\-h\fR, \fB\-\-help\fR
display this help and exit
.TP
\fB\-V\fR, \fB\-\-version\fR
output version information and exit
.TP
\fB\-a\fR, \fB\-\-append\fR
append text to output file
.TP
\fB\-c\fR, \fB\-\-charset=\fR
try '\-\-charset=help' for a list of names
.TP
\fB\-e\fR, \fB\-\-filter=\fR
try '\-\-filter=help' for a list of names
.TP
\fB\-f\fR, \fB\-\-force\fR
force overwrite of output file
.TP
\fB\-F\fR, \fB\-\-format=\fR
output format (byte, utf8)
.TP
\fB\-i\fR, \fB\-\-invert\fR
invert image levels (white on black)
.TP
\fB\-l\fR, \fB\-\-layout\fR
perform layout analysis
.TP
\fB\-o\fR, \fB\-\-output=\fR
place the output into
.TP
\fB\-q\fR, \fB\-\-quiet\fR
suppress all messages
.TP
\fB\-s\fR, \fB\-\-scale\fR=\fI[\-]\fR
scale input image by [1/]
.TP
\fB\-t\fR, \fB\-\-transform=\fR
try '\-\-transform=help' for a list of names
.TP
\fB\-T\fR, \fB\-\-threshold=\fR
threshold for binarization (0\-100%)
.TP
\fB\-u\fR, \fB\-\-cut=\fR
cut input image by given rectangle
.TP
\fB\-v\fR, \fB\-\-verbose\fR
be verbose
.TP
\fB\-x\fR, \fB\-\-export=\fR
export results in ORF format to
.PP
If no files are specified, ocrad reads the image from standard input.
If the \fB\-o\fR option is not specified, ocrad sends text to standard output.
.PP
Exit status: 0 for a normal exit, 1 for environmental problems (file
not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or
invalid input file, 3 for an internal consistency error (eg, bug) which
caused ocrad to panic.
.SH "REPORTING BUGS"
Report bugs to bug\-ocrad@gnu.org
.br
Ocrad home page: http://www.gnu.org/software/ocrad/ocrad.html
.br
General help using GNU software: http://www.gnu.org/gethelp
.SH COPYRIGHT
Copyright \(co 2013 Antonio Diaz Diaz.
License GPLv3+: GNU GPL version 3 or later
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
The full documentation for
.B Ocrad
is maintained as a Texinfo manual. If the
.B info
and
.B Ocrad
programs are properly installed at your site, the command
.IP
.B info Ocrad
.PP
should give you access to the complete manual.
ocrad-0.22/doc/ocrad.info 0000644 0000764 0000144 00000051673 12166633572 013640 0 ustar yo users This is ocrad.info, produced by makeinfo version 4.13 from
ocrad.texinfo.
INFO-DIR-SECTION GNU Packages
START-INFO-DIR-ENTRY
* Ocrad: (ocrad). The GNU OCR program
END-INFO-DIR-ENTRY
File: ocrad.info, Node: Top, Next: Character sets, Up: (dir)
GNU Ocrad Manual
****************
This manual is for GNU Ocrad (version 0.22, 9 July 2013).
GNU Ocrad is an OCR (Optical Character Recognition) program and
library based on a feature extraction method. It reads images in pbm
(bitmap), pgm (greyscale) or ppm (color) formats and produces text in
byte (8-bit) or UTF-8 formats. The pbm, pgm and ppm formats are
collectively known as pnm.
Ocrad includes a layout analyser able to separate the columns or
blocks of text normally found on printed pages.
* Menu:
* Character sets:: Input charsets and output formats
* Invoking ocrad:: Command line interface
* Library version:: Checking library version
* Library functions:: Descriptions of the library functions
* Library error codes:: Meaning of codes returned by functions
* Image format conversion:: How to convert other formats to pnm
* Algorithm:: How ocrad does its job
* OCR results file:: Description of the ORF file format
* Problems:: Reporting bugs
* Concept index:: Index of concepts
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
2012, 2013 Antonio Diaz Diaz.
This manual is free documentation: you have unlimited permission to
copy, distribute and modify it.
File: ocrad.info, Node: Character sets, Next: Invoking ocrad, Prev: Top, Up: Top
1 Character sets
****************
The character set internally used by ocrad is ISO 10646, also known as
UCS (Universal Character Set), which can represent over two thousand
million characters (2^31).
As it is unpractical to try to recognize one among so many different
characters, you can tell ocrad what character sets to recognize. You do
this with the `--charset' option.
If the input page contains characters from only one character set,
say `ISO-8859-15', you can use the default `byte' output format. But in
a page with `ISO-8859-9' and `ISO-8859-15' characters, you can't tell
if a code of 0xFD represents a 'latin small letter i dotless' or a
'latin small letter y with acute'. You should use `--format=utf8'
instead.
Of course, you may request UTF-8 output in any case.
NOTE: 10^9 is a thousand millions, a billion is a million millions
(million^2), a trillion is a million million millions (million^3), and
so on. Please, don't "embrace and extend" the meaning of prefixes,
making communication among all people difficult. Thanks.
File: ocrad.info, Node: Invoking ocrad, Next: Library version, Prev: Character sets, Up: Top
2 Invoking ocrad
****************
The format for running ocrad is:
ocrad [OPTIONS] [FILES]
Ocrad supports the following options:
`-h'
`--help'
Print an informative help message describing the options and exit.
`ocrad --verbose --help' describes also hidden options.
`-V'
`--version'
Print the version number of ocrad on the standard output and exit.
`-a'
`--append'
Append generated text to the output file instead of overwriting it.
`-c NAME'
`--charset=NAME'
Enable recognition of the characters belonging to the given
character set. You can repeat this option multiple times with
different names for processing a page with characters from
different character sets.
If no charset is specified, `iso-8859-15' (latin9) is assumed.
Try `--charset=help' for a list of valid charset names.
`-e NAME'
`--filter=NAME'
Pass the output text through the given postprocessing filter.
`--filter=letters' forces every character that resembles a letter
to be recognized as a letter. Other characters will be output
without change.
`--filter=letters_only', same as `--filter=letters', but other
characters will be discarded.
`--filter=numbers' forces every character that resembles a number
to be recognized as a number. Other characters will be output
without change.
`--filter=numbers_only', same as `--filter=numbers' but other
characters will be discarded.
Try `--filter=help' for a list of valid filter names.
`-f'
`--force'
Force overwrite of output files.
`-F NAME'
`--format=NAME'
Select the output format. The valid names are `byte' and `utf8'.
If no output format is specified, `byte' (8 bit) is assumed.
`-i'
`--invert'
Invert image levels (white on black).
`-l'
`--layout'
Enable page layout analysis. Ocrad is able to separate blocks of
text of arbitrary shape as long as they are clearly delimited by
white space.
`-o FILE'
`--output=FILE'
Place the output into FILE instead of into the standard output.
`-q'
`--quiet'
Quiet operation.
`-s VALUE'
`--scale=VALUE'
Scale up the input image by VALUE before layout analysis and
recognition. If VALUE is negative, the input image is scaled down
by -VALUE.
`-t NAME'
`--transform=NAME'
Perform given transformation (rotation or mirroring) on the input
image before scaling, layout analysis and recognition.
Try `--transform=help' for a list of valid transformation names.
`-T VALUE'
`--threshold=VALUE'
Set binarization threshold for pgm or ppm files or for `--scale'
option (only for scaled down images). VALUE should be a rational
number between 0 and 1, and may be given as a percentage (50%), a
fraction (1/2), or a decimal value (0.5). Image values greater than
threshold are converted to white. The default value is 0.5.
`-u LEFT,TOP,WIDTH,HEIGHT'
`--cut=LEFT,TOP,WIDTH,HEIGHT'
Cut the input image by the rectangle defined by LEFT, TOP, WIDTH
and HEIGHT. Values may be relative to the image size
(-1.0 <= value <= +1.0), or absolute (abs( value ) > 1). Negative
values of LEFT, TOP are relative to the right-bottom corner of the
image. Values of WIDTH and HEIGHT must be positive. Absolute and
relative values can be mixed. For example
`ocrad --cut 700,960,1,1' will extract from `700,960' to the
right-bottom corner of the image.
The cutting is performed before any other transformation (rotation
or mirroring) on the input image, and before scaling, layout
analysis and recognition.
`-v'
`--verbose'
Verbose mode.
`-x FILE'
`--export=FILE'
Write (export) OCR results file to FILE (*note OCR results file::).
`-x -' writes to stdout, overriding text output except if output
has been also redirected with the `-o' option.
Exit status: 0 for a normal exit, 1 for environmental problems (file
not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or
invalid input file, 3 for an internal consistency error (eg, bug) which
caused ocrad to panic.
File: ocrad.info, Node: Library version, Next: Library functions, Prev: Invoking ocrad, Up: Top
3 Library version
*****************
-- Function: const char * OCRAD_version ( void )
Returns the library version as a string.
-- Constant: const char * OCRAD_version_string
This constant is defined in the header file `ocradlib.h'.
The application should compare OCRAD_version and OCRAD_version_string
for consistency. If the first character differs, the library code
actually used may be incompatible with the `ocradlib.h' header file
used by the application.
if( OCRAD_version()[0] != OCRAD_version_string[0] )
error( "bad library version" );
File: ocrad.info, Node: Library functions, Next: Library error codes, Prev: Library version, Up: Top
4 Library functions
*******************
These are the OCRAD library functions. In case of error, all of them
return -1 or a null pointer, except `OCRAD_open' whose return value
must be verified by calling `OCRAD_get_errno' before using it.
-- Function: struct OCRAD_Descriptor * OCRAD_open ( void )
Initializes the internal library state and returns a pointer that
can only be used as the OCRDES argument for the other OCRAD
functions, or a null pointer if the descriptor could not be
allocated.
The returned pointer must be verified by calling `OCRAD_get_errno'
before using it. If `OCRAD_get_errno' does not return `OCRAD_ok',
the returned pointer must not be used and should be freed with
`OCRAD_close' to avoid memory leaks.
-- Function: int OCRAD_close ( struct OCRAD_Descriptor * const OCRDES )
Frees all dynamically allocated data structures for this
descriptor. After a call to `OCRAD_close', OCRDES can no more be
used as an argument to any OCRAD function.
-- Function: enum OCRAD_Errno OCRAD_get_errno ( struct
OCRAD_Descriptor * const OCRDES )
Returns the current error code for OCRDES (*note Library error
codes::).
-- Function: int OCRAD_set_image ( struct OCRAD_Descriptor * const
OCRDES, const struct OCRAD_Pixmap * const IMAGE, const bool
INVERT )
Loads IMAGE into the internal buffer. If INVERT is true, image
levels are inverted (white on black). Loading a new image deletes
any previous text results.
-- Function: int OCRAD_set_image_from_file ( struct OCRAD_Descriptor *
const OCRDES, const char * const FILENAME, const bool INVERT )
Loads a image from the file FILENAME into the internal buffer. If
INVERT is true, image levels are inverted (white on black).
Loading a new image deletes any previous text results.
-- Function: int OCRAD_set_utf8_format ( struct OCRAD_Descriptor *
const OCRDES, const bool UTF8 )
Set the output format to `byte' (if UTF8=false) or to `utf8'. By
default ocrad produces `byte' (8 bit) output.
-- Function: int OCRAD_set_threshold ( struct OCRAD_Descriptor * const
OCRDES, const int THRESHOLD )
Set binarization threshold for greymap or RGB images. THRESHOLD
values between 0 and 255 set a fixed threshold. A value of -1 sets
an automatic threshold. Pixel values greater than the resulting
threshold are converted to white. The default threshold value if
this function is not called is 127.
-- Function: int OCRAD_scale ( struct OCRAD_Descriptor * const OCRDES,
const int VALUE )
Scale up the image in the internal buffer by VALUE. If VALUE is
negative, the image is scaled down by -VALUE.
-- Function: int OCRAD_recognize ( struct OCRAD_Descriptor * const
OCRDES, const bool LAYOUT )
Recognize the image loaded in the internal buffer and produce text
results which can be later retrieved with the `OCRAD_result'
functions. The same image can be recognized as many times as
desired, for example setting a new threshold each time for 3D
greymap recognition. Every time this function is called, the
produced text results replace any previous ones. If LAYOUT is
true, page layout analysis is enabled, probably producing more
than one text block.
-- Function: int OCRAD_result_blocks ( struct OCRAD_Descriptor * const
OCRDES )
Returns the number of text blocks found in the image by the layout
analyser or 1 if no layout analysis was requested.
-- Function: int OCRAD_result_lines ( struct OCRAD_Descriptor * const
OCRDES, const int BLOCKNUM )
Returns the number of text lines contained in the given text block.
-- Function: int OCRAD_result_chars_total ( struct OCRAD_Descriptor *
const OCRDES )
Returns the total number of text characters contained in the
recognized image.
-- Function: int OCRAD_result_chars_block ( struct OCRAD_Descriptor *
const OCRDES, const int BLOCKNUM )
Returns the number of text characters contained in the given text
block.
-- Function: int OCRAD_result_chars_line ( struct OCRAD_Descriptor *
const OCRDES, const int BLOCKNUM, const int LINENUM )
Returns the number of text characters contained in the given text
line.
-- Function: const char * OCRAD_result_line ( struct OCRAD_Descriptor
* const OCRDES, const int BLOCKNUM, const int LINENUM )
Returns the line of text specified by BLOCKNUM and LINENUM.
-- Function: int OCRAD_result_first_character ( struct
OCRAD_Descriptor * const OCRDES )
Returns the byte result for the first character in the image.
Returns 0 if the image has no characters or if the first character
could not be recognized. This function is a convenient short cut
to the result for images containing a single character.
File: ocrad.info, Node: Library error codes, Next: Image format conversion, Prev: Library functions, Up: Top
5 Library error codes
*********************
Most library functions return -1 or a null pointer to indicate that they
have failed. But this return value only tells you that an error has
occurred. To find out what kind of error it was, you need to verify the
error code by calling `OCRAD_get_errno'.
Library functions do not change the value returned by
`OCRAD_get_errno' when they succeed; thus, the value returned by
`OCRAD_get_errno' after a successful call is not necessarily OCRAD_ok,
and you should not use `OCRAD_get_errno' to determine whether a call
failed. If the call failed, then you can examine `OCRAD_get_errno'.
The error codes are defined in the header file `ocradlib.h'.
-- Constant: enum OCRAD_Errno OCRAD_ok
The value of this constant is 0 and is used to indicate that there
is no error.
-- Constant: enum OCRAD_Errno OCRAD_bad_argument
At least one of the arguments passed to the library function was
invalid.
-- Constant: enum OCRAD_Errno OCRAD_mem_error
No memory available. The system cannot allocate more virtual memory
because its capacity is full.
-- Constant: enum OCRAD_Errno OCRAD_sequence_error
A library function was called in the wrong order. For example
`OCRAD_result_line' was called before `OCRAD_recognize'.
-- Constant: enum OCRAD_Errno OCRAD_library_error
A bug was detected in the library. Please, report it (*note
Problems::).
File: ocrad.info, Node: Image format conversion, Next: Algorithm, Prev: Library error codes, Up: Top
6 Image format conversion
*************************
There are a lot of image formats, but ocrad is able to decode only three
of them; pbm, pgm and ppm. In this chapter you will find command
examples and advice about how to convert image files to a format that
ocrad can manage.
`.png'
Portable Network Graphics file. Use the command
`pngtopnm filename.png | ocrad'.
In some cases, like the ocrad.png icon, you have to invert the
image with the `-i' option: `pngtopnm filename.png | ocrad -i'.
`.ps'
`.pdf'
Postscript or Portable Document Format file. Use the command
`gs -sPAPERSIZE=a4 -sDEVICE=pnmraw -r300 -dNOPAUSE -dBATCH -sOutputFile=- -q filename.ps | ocrad'.
You may also use the command
`pstopnm -stdout -dpi=300 -pgm filename.ps | ocrad',
but it seems not to work with pdf files. Also old versions of
`pstopnm' don't recognize the `-dpi' option and produce an image
too small for OCR.
`.tiff'
TIFF file. Use the command
`tifftopnm filename.tiff | ocrad'.
`.jpg'
JPEG file. Use the command
`djpeg -greyscale -pnm filename.jpg | ocrad'.
JPEG is a lossy format and is in general not recommended for text
images.
`.pnm.gz'
Pnm file compressed with gzip. Use the command
`gzip -cd filename.pnm.gz | ocrad'
`.pnm.lz'
Pnm file compressed with lzip. Use the command
`lzip -cd filename.pnm.lz | ocrad'
File: ocrad.info, Node: Algorithm, Next: OCR results file, Prev: Image format conversion, Up: Top
7 Algorithm
***********
Ocrad is mainly a research project. Many of the algorithms ocrad uses
are ad hoc, and will change in successive releases as I myself gain
understanding about OCR issues.
The overall working of ocrad may be described as follows:
1) read the image.
2) optionally, perform some transformations (cut, rotate, scale, etc).
3) optionally, perform layout detection.
4) remove frames and pictures.
5) detect characters and group them in lines.
6) recognize characters (very ad hoc; one algorithm per character).
7) correct some errors (transform l.OOO into 1.000, etc).
8) output result.
Ocrad recognizes characters by its shape, and the reason it is so
fast is that it does not compare the shape of every character against
some sort of database of shapes and then chooses the best match.
Instead of this, ocrad only compares the shape differences that are
relevant to choose between two character categories, mostly like a
binary search.
As there is no such thing as a free lunch, this approach has some
drawbacks. It makes ocrad very sensitive to character defects, and makes
difficult to modify ocrad to recognize new characters.
File: ocrad.info, Node: OCR results file, Next: Problems, Prev: Algorithm, Up: Top
8 OCR results file
******************
Calling ocrad with option `-x' produces an OCR results file (ORF), that
is, a parsable file containing the OCR results. The ORF format is as
follows:
- Any line beginning with `#' is a comment line.
- The first non-comment line has the form `source file FILENAME',
where FILENAME is the name of the file being processed (`-' for
stdin). This is the only line guaranteed to exist for every input
file read without errors. If the file, or any block or line, has
no text, the corresponding part in the ORF file will be missing.
- The second non-comment line has the form `total text blocks N',
where N is the total number of text blocks in the source image.
For each text block in the source image, the following data follows:
- A line in the form `text block I X Y W H'. Where I is the block
number and X Y W H are the block position and size as described
below for character boxes.
- A line in the form `lines N'. Where N is the number of lines in
this block.
For each line in every text block, the following data follows:
- A line in the form `line I chars N height H', where I is the line
number, N is the number of characters in this line, and H is the
mean height of the characters in this line (in pixels).
- N lines (one for every character) in the form
`X Y W H; G[, 'C'V]...', where:
X is the left border (x-coordinate) of the char bounding box in the
source image (in pixels).
Y is the top border (y-coordinate).
W is the width of the bounding box.
H is the height of the bounding box.
G is the number of different recognition guesses for this
character.
The result characters follow after the number of guesses in the
form of a comma-separated list of pairs. Every pair is formed by
the actual recognised char C enclosed in single quotes, followed
by the confidence value V, without space between them. The higher
the value of confidence, the more confident is the result.
Running `./ocrad -x test.orf examples/test.pbm' in the source
directory will give you an example ORF file.
File: ocrad.info, Node: Problems, Next: Concept index, Prev: OCR results file, Up: Top
9 Reporting Bugs
****************
There are probably bugs in ocrad. There are certainly errors and
omissions in this manual. If you report them, they will get fixed. If
you don't, no one will ever know about them and they will remain unfixed
for all eternity, if not longer.
If you find a bug in GNU Ocrad, please send electronic mail to
. Include the version number, which you can find by
running `ocrad --version'.
File: ocrad.info, Node: Concept index, Prev: Problems, Up: Top
Concept index
*************
[index ]
* Menu:
* algorithm: Algorithm. (line 6)
* bugs: Problems. (line 6)
* getting help: Problems. (line 6)
* image format conversion: Image format conversion.
(line 6)
* input charsets: Character sets. (line 6)
* invoking: Invoking ocrad. (line 6)
* library error codes: Library error codes. (line 6)
* library functions: Library functions. (line 6)
* library version: Library version. (line 6)
* OCR results file: OCR results file. (line 6)
* options: Invoking ocrad. (line 6)
* output format: Character sets. (line 6)
* usage: Invoking ocrad. (line 6)
* version: Invoking ocrad. (line 6)
Tag Table:
Node: Top198
Node: Character sets1598
Node: Invoking ocrad2743
Node: Library version6972
Node: Library functions7651
Node: Library error codes12716
Node: Image format conversion14267
Node: Algorithm15791
Node: OCR results file17060
Node: Problems19328
Node: Concept index19864
End Tag Table
Local Variables:
coding: iso-8859-15
End:
ocrad-0.22/doc/ocrad.texinfo 0000644 0000764 0000144 00000050344 12166633570 014351 0 ustar yo users \input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename ocrad.info
@documentencoding ISO-8859-15
@settitle GNU Ocrad Manual
@finalout
@c %**end of header
@set UPDATED 9 July 2013
@set VERSION 0.22
@dircategory GNU Packages
@direntry
* Ocrad: (ocrad). The GNU OCR program
@end direntry
@ifnothtml
@titlepage
@title GNU Ocrad
@subtitle The GNU OCR Program
@subtitle for GNU Ocrad version @value{VERSION}, @value{UPDATED}
@author by Antonio Diaz Diaz
@page
@vskip 0pt plus 1filll
@end titlepage
@contents
@end ifnothtml
@node Top
@top
This manual is for GNU Ocrad (version @value{VERSION}, @value{UPDATED}).
@sp 1
GNU Ocrad is an OCR (Optical Character Recognition) program and library
based on a feature extraction method. It reads images in pbm (bitmap),
pgm (greyscale) or ppm (color) formats and produces text in @w{byte
(8-bit)} or UTF-8 formats. The pbm, pgm and ppm formats are collectively
known as pnm.
Ocrad includes a layout analyser able to separate the columns or blocks
of text normally found on printed pages.
@menu
* Character sets:: Input charsets and output formats
* Invoking ocrad:: Command line interface
* Library version:: Checking library version
* Library functions:: Descriptions of the library functions
* Library error codes:: Meaning of codes returned by functions
* Image format conversion:: How to convert other formats to pnm
* Algorithm:: How ocrad does its job
* OCR results file:: Description of the ORF file format
* Problems:: Reporting bugs
* Concept index:: Index of concepts
@end menu
@sp 1
Copyright @copyright{} 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013 Antonio Diaz Diaz.
This manual is free documentation: you have unlimited permission
to copy, distribute and modify it.
@node Character sets
@chapter Character sets
@cindex input charsets
@cindex output format
The character set internally used by ocrad is ISO 10646, also known as
UCS (Universal Character Set), which can represent over two thousand
million characters (2^31).
As it is unpractical to try to recognize one among so many different
characters, you can tell ocrad what character sets to recognize. You do
this with the @samp{--charset} option.
If the input page contains characters from only one character set, say
@w{@samp{ISO-8859-15}}, you can use the default @samp{byte} output
format. But in a page with @w{@samp{ISO-8859-9}} and
@w{@samp{ISO-8859-15}} characters, you can't tell if a code of 0xFD
represents a 'latin small letter i dotless' or a 'latin small letter y
with acute'. You should use @w{@samp{--format=utf8}} instead.@*
Of course, you may request UTF-8 output in any case.
@sp 1
NOTE: 10^9 is a thousand millions, a billion is a million millions
(million^2), a trillion is a million million millions (million^3), and
so on. Please, don't "embrace and extend" the meaning of prefixes,
making communication among all people difficult. Thanks.
@node Invoking ocrad
@chapter Invoking ocrad
@cindex invoking
@cindex options
@cindex usage
@cindex version
The format for running ocrad is:
@example
ocrad [@var{options}] [@var{files}]
@end example
Ocrad supports the following options:
@table @samp
@item -h
@itemx --help
Print an informative help message describing the options and exit.
@w{@samp{ocrad --verbose --help}} describes also hidden options.
@item -V
@itemx --version
Print the version number of ocrad on the standard output and exit.
@item -a
@itemx --append
Append generated text to the output file instead of overwriting it.
@item -c @var{name}
@itemx --charset=@var{name}
Enable recognition of the characters belonging to the given character set.
You can repeat this option multiple times with different names for
processing a page with characters from different character sets.@*
If no charset is specified, @w{@samp{iso-8859-15}} (latin9) is assumed.@*
Try @w{@samp{--charset=help}} for a list of valid charset names.
@item -e @var{name}
@itemx --filter=@var{name}
Pass the output text through the given postprocessing filter.@*
@w{@samp{--filter=letters}} forces every character that resembles a
letter to be recognized as a letter. Other characters will be output
without change.@*
@w{@samp{--filter=letters_only}}, same as @w{@samp{--filter=letters}},
but other characters will be discarded.@*
@w{@samp{--filter=numbers}} forces every character that resembles a
number to be recognized as a number. Other characters will be output
without change.@*
@w{@samp{--filter=numbers_only}}, same as @w{@samp{--filter=numbers}}
but other characters will be discarded.@*
Try @w{@samp{--filter=help}} for a list of valid filter names.
@item -f
@itemx --force
Force overwrite of output files.
@item -F @var{name}
@itemx --format=@var{name}
Select the output format. The valid names are @samp{byte} and @samp{utf8}.@*
If no output format is specified, @samp{byte} (8 bit) is assumed.
@item -i
@itemx --invert
Invert image levels (white on black).
@item -l
@itemx --layout
Enable page layout analysis. Ocrad is able to separate blocks of text of
arbitrary shape as long as they are clearly delimited by white space.
@item -o @var{file}
@itemx --output=@var{file}
Place the output into @var{file} instead of into the standard output.
@item -q
@itemx --quiet
Quiet operation.
@item -s @var{value}
@itemx --scale=@var{value}
Scale up the input image by @var{value} before layout analysis and
recognition. If @var{value} is negative, the input image is scaled down
by @var{-value}.
@item -t @var{name}
@itemx --transform=@var{name}
Perform given transformation (rotation or mirroring) on the input image
before scaling, layout analysis and recognition.@*
Try @w{@samp{--transform=help}} for a list of valid transformation names.
@item -T @var{value}
@itemx --threshold=@var{value}
Set binarization threshold for pgm or ppm files or for @samp{--scale}
option (only for scaled down images). @var{value} should be a rational
number between 0 and 1, and may be given as a percentage (50%), a
fraction (1/2), or a decimal value (0.5). Image values greater than
threshold are converted to white. The default value is 0.5.
@item -u @var{left},@var{top},@var{width},@var{height}
@itemx --cut=@var{left},@var{top},@var{width},@var{height}
Cut the input image by the rectangle defined by @var{left}, @var{top},
@var{width} and @var{height}. Values may be relative to the image size
@w{(-1.0 <= value <= +1.0)}, or absolute @w{(abs( value ) > 1)}.
Negative values of @var{left}, @var{top} are relative to the
right-bottom corner of the image. Values of @var{width} and @var{height}
must be positive. Absolute and relative values can be mixed. For example
@w{@samp{ocrad --cut 700,960,1,1}} will extract from @samp{700,960} to
the right-bottom corner of the image.@*
The cutting is performed before any other transformation (rotation or
mirroring) on the input image, and before scaling, layout analysis and
recognition.
@item -v
@itemx --verbose
Verbose mode.
@item -x @var{file}
@itemx --export=@var{file}
Write (export) OCR results file to @var{file} (@pxref{OCR results file}).
@w{@samp{-x -}} writes to stdout, overriding text output except if
output has been also redirected with the @samp{-o} option.
@end table
Exit status: 0 for a normal exit, 1 for environmental problems (file not
found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or
invalid input file, 3 for an internal consistency error (eg, bug) which
caused ocrad to panic.
@node Library version
@chapter Library version
@cindex library version
@deftypefun {const char *} OCRAD_version ( void )
Returns the library version as a string.
@end deftypefun
@deftypevr Constant {const char *} OCRAD_version_string
This constant is defined in the header file @samp{ocradlib.h}.
@end deftypevr
The application should compare OCRAD_version and OCRAD_version_string
for consistency. If the first character differs, the library code
actually used may be incompatible with the @samp{ocradlib.h} header file
used by the application.
@example
if( OCRAD_version()[0] != OCRAD_version_string[0] )
error( "bad library version" );
@end example
@node Library functions
@chapter Library functions
@cindex library functions
These are the OCRAD library functions. In case of error, all of them
return -1 or a null pointer, except @samp{OCRAD_open} whose return value
must be verified by calling @samp{OCRAD_get_errno} before using it.
@deftypefun {struct OCRAD_Descriptor *} OCRAD_open ( void )
Initializes the internal library state and returns a pointer that can
only be used as the @var{ocrdes} argument for the other OCRAD functions,
or a null pointer if the descriptor could not be allocated.
The returned pointer must be verified by calling @samp{OCRAD_get_errno}
before using it. If @samp{OCRAD_get_errno} does not return
@samp{OCRAD_ok}, the returned pointer must not be used and should be
freed with @samp{OCRAD_close} to avoid memory leaks.
@end deftypefun
@deftypefun int OCRAD_close ( struct OCRAD_Descriptor * const @var{ocrdes} )
Frees all dynamically allocated data structures for this descriptor.
After a call to @samp{OCRAD_close}, @var{ocrdes} can no more be used as
an argument to any OCRAD function.
@end deftypefun
@deftypefun {enum OCRAD_Errno} OCRAD_get_errno ( struct OCRAD_Descriptor * const @var{ocrdes} )
Returns the current error code for @var{ocrdes} (@pxref{Library error codes}).
@end deftypefun
@deftypefun int OCRAD_set_image ( struct OCRAD_Descriptor * const @var{ocrdes}, const struct OCRAD_Pixmap * const @var{image}, const bool @var{invert} )
Loads @var{image} into the internal buffer. If @var{invert} is true,
image levels are inverted (white on black). Loading a new image deletes
any previous text results.
@end deftypefun
@deftypefun int OCRAD_set_image_from_file ( struct OCRAD_Descriptor * const @var{ocrdes}, const char * const @var{filename}, const bool @var{invert} )
Loads a image from the file @var{filename} into the internal buffer. If
@var{invert} is true, image levels are inverted (white on black).
Loading a new image deletes any previous text results.
@end deftypefun
@deftypefun int OCRAD_set_utf8_format ( struct OCRAD_Descriptor * const @var{ocrdes}, const bool @var{utf8} )
Set the output format to @samp{byte} (if @var{utf8}=false) or to
@samp{utf8}. By default ocrad produces @samp{byte} (8 bit) output.
@end deftypefun
@deftypefun int OCRAD_set_threshold ( struct OCRAD_Descriptor * const @var{ocrdes}, const int @var{threshold} )
Set binarization threshold for greymap or RGB images. @var{threshold}
values between 0 and 255 set a fixed threshold. A value of -1 sets an
automatic threshold. Pixel values greater than the resulting threshold
are converted to white. The default threshold value if this function is
not called is 127.
@end deftypefun
@deftypefun int OCRAD_scale ( struct OCRAD_Descriptor * const @var{ocrdes}, const int @var{value} )
Scale up the image in the internal buffer by @var{value}. If @var{value}
is negative, the image is scaled down by @var{-value}.
@end deftypefun
@deftypefun int OCRAD_recognize ( struct OCRAD_Descriptor * const @var{ocrdes}, const bool @var{layout} )
Recognize the image loaded in the internal buffer and produce text
results which can be later retrieved with the @samp{OCRAD_result}
functions. The same image can be recognized as many times as desired,
for example setting a new threshold each time for 3D greymap
recognition. Every time this function is called, the produced text
results replace any previous ones. If @var{layout} is true, page layout
analysis is enabled, probably producing more than one text block.
@end deftypefun
@deftypefun int OCRAD_result_blocks ( struct OCRAD_Descriptor * const @var{ocrdes} )
Returns the number of text blocks found in the image by the layout
analyser or 1 if no layout analysis was requested.
@end deftypefun
@deftypefun int OCRAD_result_lines ( struct OCRAD_Descriptor * const @var{ocrdes}, const int @var{blocknum} )
Returns the number of text lines contained in the given text block.
@end deftypefun
@deftypefun int OCRAD_result_chars_total ( struct OCRAD_Descriptor * const @var{ocrdes} )
Returns the total number of text characters contained in the recognized
image.
@end deftypefun
@deftypefun int OCRAD_result_chars_block ( struct OCRAD_Descriptor * const @var{ocrdes}, const int @var{blocknum} )
Returns the number of text characters contained in the given text block.
@end deftypefun
@deftypefun int OCRAD_result_chars_line ( struct OCRAD_Descriptor * const @var{ocrdes}, const int @var{blocknum}, const int @var{linenum} )
Returns the number of text characters contained in the given text line.
@end deftypefun
@deftypefun {const char *} OCRAD_result_line ( struct OCRAD_Descriptor * const @var{ocrdes}, const int @var{blocknum}, const int @var{linenum} )
Returns the line of text specified by @var{blocknum} and @var{linenum}.
@end deftypefun
@deftypefun int OCRAD_result_first_character ( struct OCRAD_Descriptor * const @var{ocrdes} )
Returns the byte result for the first character in the image. Returns 0
if the image has no characters or if the first character could not be
recognized. This function is a convenient short cut to the result for
images containing a single character.
@end deftypefun
@node Library error codes
@chapter Library error codes
@cindex library error codes
Most library functions return -1 or a null pointer to indicate that they
have failed. But this return value only tells you that an error has
occurred. To find out what kind of error it was, you need to verify the
error code by calling @samp{OCRAD_get_errno}.
Library functions do not change the value returned by
@samp{OCRAD_get_errno} when they succeed; thus, the value returned by
@samp{OCRAD_get_errno} after a successful call is not necessarily
OCRAD_ok, and you should not use @samp{OCRAD_get_errno} to determine
whether a call failed. If the call failed, then you can examine
@samp{OCRAD_get_errno}.
The error codes are defined in the header file @samp{ocradlib.h}.
@deftypevr Constant {enum OCRAD_Errno} OCRAD_ok
The value of this constant is 0 and is used to indicate that there is no
error.
@end deftypevr
@deftypevr Constant {enum OCRAD_Errno} OCRAD_bad_argument
At least one of the arguments passed to the library function was
invalid.
@end deftypevr
@deftypevr Constant {enum OCRAD_Errno} OCRAD_mem_error
No memory available. The system cannot allocate more virtual memory
because its capacity is full.
@end deftypevr
@deftypevr Constant {enum OCRAD_Errno} OCRAD_sequence_error
A library function was called in the wrong order. For example
@samp{OCRAD_result_line} was called before @samp{OCRAD_recognize}.
@end deftypevr
@deftypevr Constant {enum OCRAD_Errno} OCRAD_library_error
A bug was detected in the library. Please, report it (@pxref{Problems}).
@end deftypevr
@node Image format conversion
@chapter Image format conversion
@cindex image format conversion
There are a lot of image formats, but ocrad is able to decode only three
of them; pbm, pgm and ppm. In this chapter you will find command
examples and advice about how to convert image files to a format that
ocrad can manage.
@table @samp
@item .png
Portable Network Graphics file. Use the command
@w{@code{pngtopnm filename.png | ocrad}}.@*
In some cases, like the ocrad.png icon, you have to invert the image
with the @samp{-i} option: @w{@code{pngtopnm filename.png | ocrad -i}}.
@item .ps
@itemx .pdf
Postscript or Portable Document Format file. Use the command
@w{@code{gs -sPAPERSIZE=a4 -sDEVICE=pnmraw -r300 -dNOPAUSE -dBATCH -sOutputFile=- -q filename.ps | ocrad}}.@*
You may also use the command
@w{@code{pstopnm -stdout -dpi=300 -pgm filename.ps | ocrad}},@*
but it seems not to work with pdf files. Also old versions of
@code{pstopnm} don't recognize the @samp{-dpi} option and produce an
image too small for OCR.
@item .tiff
TIFF file. Use the command@*
@w{@code{tifftopnm filename.tiff | ocrad}}.
@item .jpg
JPEG file. Use the command
@w{@code{djpeg -greyscale -pnm filename.jpg | ocrad}}.@*
JPEG is a lossy format and is in general not recommended for text images.
@item .pnm.gz
Pnm file compressed with gzip. Use the command
@w{@code{gzip -cd filename.pnm.gz | ocrad}}
@item .pnm.lz
Pnm file compressed with lzip. Use the command
@w{@code{lzip -cd filename.pnm.lz | ocrad}}
@end table
@node Algorithm
@chapter Algorithm
@cindex algorithm
Ocrad is mainly a research project. Many of the algorithms ocrad uses
are ad hoc, and will change in successive releases as I myself gain
understanding about OCR issues.
The overall working of ocrad may be described as follows:@*
1) read the image.@*
2) optionally, perform some transformations (cut, rotate, scale, etc).@*
3) optionally, perform layout detection.@*
4) remove frames and pictures.@*
5) detect characters and group them in lines.@*
6) recognize characters (very ad hoc; one algorithm per character).@*
7) correct some errors (transform l.OOO into 1.000, etc).@*
8) output result.
@sp 1
Ocrad recognizes characters by its shape, and the reason it is so fast
is that it does not compare the shape of every character against some
sort of database of shapes and then chooses the best match. Instead of
this, ocrad only compares the shape differences that are relevant to
choose between two character categories, mostly like a binary search.
As there is no such thing as a free lunch, this approach has some
drawbacks. It makes ocrad very sensitive to character defects, and makes
difficult to modify ocrad to recognize new characters.
@node OCR results file
@chapter OCR results file
@cindex OCR results file
Calling ocrad with option @samp{-x} produces an OCR results file (ORF),
that is, a parsable file containing the OCR results. The ORF format is
as follows:
@itemize @minus
@item
Any line beginning with @samp{#} is a comment line.
@item
The first non-comment line has the form
@w{@samp{source file @var{filename}}}, where @var{filename} is the name
of the file being processed (@samp{-} for stdin). This is the only line
guaranteed to exist for every input file read without errors. If the
file, or any block or line, has no text, the corresponding part in the
ORF file will be missing.
@item
The second non-comment line has the form
@w{@samp{total text blocks @var{n}}}, where @var{n} is the total number
of text blocks in the source image.
@end itemize
@noindent
For each text block in the source image, the following data follows:
@itemize @minus
@item
A line in the form @w{@samp{text block @var{i} @var{x y w h}}}. Where
@var{i} is the block number and @var{x y w h} are the block position and
size as described below for character boxes.
@item
A line in the form @samp{lines @var{n}}. Where @var{n} is the number of
lines in this block.
@end itemize
@noindent
For each line in every text block, the following data follows:
@itemize @minus
@item
A line in the form @samp{line @var{i} chars @var{n} height @var{h}},
where @var{i} is the line number, @var{n} is the number of characters in
this line, and @var{h} is the mean height of the characters in this line
(in pixels).
@item
N lines (one for every character) in the form
@w{@samp{@var{x} @var{y} @var{w} @var{h}; @var{g}[, '@var{c}'@var{v}]...}},
where:@*
@var{x} is the left border (x-coordinate) of the char bounding box in the
source image (in pixels).@*
@var{y} is the top border (y-coordinate).@*
@var{w} is the width of the bounding box.@*
@var{h} is the height of the bounding box.@*
@var{g} is the number of different recognition guesses for this character.@*
The result characters follow after the number of guesses in the form of
a comma-separated list of pairs. Every pair is formed by the actual
recognised char @var{c} enclosed in single quotes, followed by the
confidence value @var{v}, without space between them. The higher the
value of confidence, the more confident is the result.
@end itemize
Running @code{./ocrad -x test.orf examples/test.pbm} in the source directory
will give you an example ORF file.
@node Problems
@chapter Reporting Bugs
@cindex bugs
@cindex getting help
There are probably bugs in ocrad. There are certainly errors and
omissions in this manual. If you report them, they will get fixed. If
you don't, no one will ever know about them and they will remain unfixed
for all eternity, if not longer.
If you find a bug in GNU Ocrad, please send electronic mail to
@email{bug-ocrad@@gnu.org}. Include the version number, which you can
find by running @w{@samp{ocrad --version}}.
@node Concept index
@unnumbered Concept index
@printindex cp
@bye
ocrad-0.22/testsuite/check.sh 0000755 0000764 0000144 00000010410 12150373664 014547 0 ustar yo users #! /bin/sh
# check script for GNU Ocrad - Optical Character Recognition program
# Copyright (C) 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
#
# This script is free software: you have unlimited permission
# to copy, distribute and modify it.
LC_ALL=C
export LC_ALL
objdir=`pwd`
testdir=`cd "$1" ; pwd`
OCRAD="${objdir}"/ocrad
OCRCHECK="${objdir}"/ocrcheck
framework_failure() { echo "failure in testing framework" ; exit 1 ; }
if [ ! -x "${OCRAD}" ] ; then
echo "${OCRAD}: cannot execute"
exit 1
fi
if [ -d tmp ] ; then rm -rf tmp ; fi
mkdir tmp
cd "${objdir}"/tmp
in="${testdir}"/test.pbm
txt="${testdir}"/test.txt
utxt="${testdir}"/test_utf8.txt
fail=0
printf "testing ocrad-%s..." "$2"
"${OCRAD}" -q -T-0.1 ${in} > /dev/null
if [ $? != 1 ] ; then fail=1 ; printf - ; else printf . ; fi
"${OCRAD}" -q -T 1.1 ${in} > /dev/null
if [ $? != 1 ] ; then fail=1 ; printf - ; else printf . ; fi
"${OCRAD}" -q -u -2,-1,1,1 ${in} > /dev/null
if [ $? != 1 ] ; then fail=1 ; printf - ; else printf . ; fi
"${OCRAD}" -q -u 1,1,1,1 ${in} > /dev/null
if [ $? != 1 ] ; then fail=1 ; printf - ; else printf . ; fi
"${OCRAD}" -q ${in} > out || fail=1
cmp ${txt} out || fail=1
printf .
"${OCRAD}" -q -u 0,0,1,1 ${in} > out
cmp ${txt} out || fail=1
printf .
"${OCRAD}" -q -u -1,-1,1,1 ${in} > out
cmp ${txt} out || fail=1
printf .
test_chars()
{
for coord in ${coords} ; do
produced_chars="${produced_chars}`"${OCRAD}" -q -u${coord} ${in}`" || fail=1
done
if [ "${produced_chars}" != "${expected_chars}" ] ; then
echo
echo "expected \"${expected_chars}\""
echo "produced \"${produced_chars}\""
fail=1
fi
printf .
}
coords=' 71,109,17,26 92,109,17,26 114,109,15,26 132,109,17,26
152,109,18,26 172,109,19,26 193,109,17,26 214,109,17,26
234,108,17,27 253,109,18,26 274,109,17,26 68,153,29,27
97,153,24,27 126,153,23,27 153,153,27,27 183,153,24,27
210,153,23,27 237,153,27,27 266,153,30,27 298,153,13,27
313,153,20,27 335,153,29,27 365,153,23,27 391,153,34,27
426,153,30,27 69,189,30,35 102,197,26,27 132,197,24,27
159,197,26,34 188,197,26,27 217,197,20,27 241,197,24,27
266,197,30,27 297,197,28,27 326,197,37,27 364,197,27,27
390,197,28,27 420,197,21,27'
expected_chars="0ol23456789ABcDEFGHIJKLMNÑopQRsTuvwxYz"
produced_chars=
test_chars
coords=' 71,250,18,18 90,240,20,28 112,250,15,18 131,240,19,28
152,250,17,18 170,241,16,27 183,249,20,27 204,240,23,28
227,241,11,27 236,241,11,35 251,240,22,28 274,240,11,28
287,250,32,18 321,250,22,18 70,288,22,25 92,295,17,18
111,295,19,26 132,295,20,26 152,295,16,18 169,295,14,18
185,288,13,25 200,295,22,18 221,295,20,18 242,295,27,18
270,295,20,18 289,295,20,26 310,295,16,18'
expected_chars="abcdefghijklmnñopqrstuvwxyz"
produced_chars=
test_chars
coords=' 68,366,29,36 97,366,24,36 124,366,13,36 140,366,26,36
168,366,30,36 208,366,29,36 237,366,24,36 265,366,13,36
281,366,26,36 308,366,30,36 349,368,29,34 378,368,24,34
405,368,13,34 421,368,26,34 449,368,30,34 68,410,29,36
97,410,24,36 124,410,13,36 140,410,26,36 167,410,30,36
71,463,18,27 91,463,17,27 109,463,11,27 123,463,17,27
142,463,22,27 177,463,18,27 198,463,17,27 216,463,11,27
229,463,17,27 249,463,22,27 284,466,18,24 305,466,17,24
323,466,12,24 336,466,17,24 356,466,22,24 391,463,18,27
411,463,17,27 431,463,10,27 443,463,17,27 462,463,22,27'
expected_chars="ÁÉÍóúÀÈÌòùÄËÏöüÂÊÎôûáéíóúàèìòùäëïöüâêîôû"
produced_chars=
test_chars
coords='137,516,19,19 174,508,15,15 192,508,11,27 245,509,19,26
268,505,17,35 322,508,27,27 353,508,10,31 367,508,9,31
70,558,15,29 86,552,14,27 104,552,9,31 128,552,15,27
158,552,9,31 173,552,17,15 195,552,8,31 215,552,3,27
228,552,9,31 252,560,19,19 275,560,19,19 347,561,15,26
364,552,23,35 391,552,25,27 72,612,18,6 94,613,19,11
114,602,19,22 134,597,12,15 150,597,11,15'
expected_chars="+*/#$&()¿?[\\]^{|}<>çÇ@~¬±ªº"
produced_chars=
test_chars
"${OCRCHECK}" ${in} > out || fail=1
cmp ${txt} out || fail=1
printf .
"${OCRCHECK}" ${in} --utf8 > out || fail=1
cmp ${utxt} out || fail=1
printf .
echo
if [ ${fail} = 0 ] ; then
echo "tests completed successfully."
cd "${objdir}" && rm -r tmp
else
echo "tests failed."
fi
exit ${fail}
ocrad-0.22/testsuite/test.pbm 0000644 0000764 0000144 00000154233 10214362660 014617 0 ustar yo users P4
560 792
@ € À > p ø à€ðÿàÀø ð ÿ€àÿÀþ àÿ üÿà?ðþ