yagf-0.9.5+repack1/000755 001750 001750 00000000000 12470517140 015426 5ustar00boradminboradmin000000 000000 yagf-0.9.5+repack1/CMakeLists.txt.user000755 001750 001750 00000027025 12470517140 021154 0ustar00boradminboradmin000000 000000 ProjectExplorer.Project.ActiveTarget 0 ProjectExplorer.Project.EditorSettings true false true Cpp CppGlobal QmlJS QmlJSGlobal 2 UTF-8 false 4 false true 1 true 0 true 0 8 true 1 true true true false ProjectExplorer.Project.PluginSettings ProjectExplorer.Project.Target.0 Desktop Qt 5.1.1 GCC 64bit Desktop Qt 5.1.1 GCC 64bit qt.511.gcc_64.essentials_kit 0 0 0 /home/parallels/Downloads/qtcreator-build false false false true Make CMakeProjectManager.MakeStep 1 Build ProjectExplorer.BuildSteps.Build clean true false true Make CMakeProjectManager.MakeStep 1 Clean ProjectExplorer.BuildSteps.Clean 2 false all CMakeProjectManager.CMakeBuildConfiguration 1 0 Deploy ProjectExplorer.BuildSteps.Deploy 1 No deployment ProjectExplorer.DefaultDeployConfiguration 1 true false false false false true 0.01 10 true 25 true valgrind 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 yagf false 2 yagf CMakeProjectManager.CMakeRunConfiguration. 3768 true false false false false 1 ProjectExplorer.Project.TargetCount 1 ProjectExplorer.Project.Updater.EnvironmentId {9297e906-2f13-4f4f-bc7a-67ac7e469d22} ProjectExplorer.Project.Updater.FileVersion 14 yagf-0.9.5+repack1/TODO000755 001750 001750 00000000041 12470517140 016114 0ustar00boradminboradmin000000 000000 Check recognition without polish yagf-0.9.5+repack1/DESCRIPTION000755 001750 001750 00000001627 12470517140 017145 0ustar00boradminboradmin000000 000000 YAGF is a graphical front-end for cuneiform and tesseract OCR tools. With YAGF you can open already scanned image files or obtain new images via XSane (scanning results are automatically passed to YAGF). Once you have a scanned image you can prepare it for recognition, select particular image areas for recognition, set the recognition language and so no. Recognized text is displayed in a editor window where it can be corrected, saved to disk or copied to clipboard. YAGF also provides some facilities for a multi-page recognition (see the online help for more details). Building YAGF requires: qt4 development tools version > 4.5 libaspell development package Running YAGF requires: Qt 4.5 or later, aspell Of course it is desirable to have xsane installed. PDFimport is done using either pdftoppm or gs utilities. Make sure at least one of these is installed if you are going to recognize text from PDFs. yagf-0.9.5+repack1/yagf.png000755 001750 001750 00000023324 12470517140 017071 0ustar00boradminboradmin000000 000000 PNG  IHDR``w8sRGBbKGD pHYs ^tIME #<= IDATxyeWy[Þ|s߾oꖺ5R,!`zXI ]8S;6v'eaC0’h!jVÝs|Ξc!@Tw~UޮZZm2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2d}7_F~2îcsjE{">T}5RB~z.^f O?zf%| Uz:=V.n$8Z 足@u58}xU}FΟ-n8 = `bmIX[b38 (*,oe J(n&I/$?w|@ r4W07i,\΄qm#à6ZgWuGU=qkP.CV S|Dppj#D̍C^QIl5a} 4LMfcپc/︓ͯ}V97Q]3Pp ? ^ZN"vlCa &!J%C\ 7T&F.<j5mT|ػ S#p^Madfn\&T,+c~mR榱̰_^nR4JDqv~G_^mU\77ͯ&wi@h ۠®mHa#DA4WŒM85ZVP!ٷtrUPH^h7a0&&jUnp oӏ|{{K4]Csp^5&1#c$rʥyey4Hb6_@D)"d^ z0R@?83bnz?|k'js]!Lµ0_tXcē;!&H*\ ,`BIDZ PBQp aqEIi7ʙ#Gɕs8tf}8n+BF}p,9\D$$(xЕ`bPH, KbLD$4DL2zz)3gΓ_*Y̹G XNyAqdl;bĤ2>y鲁A p _%q<b\Z~ NJIF^Za^:?k>M8cw_ɕr^@Ai!ZE;eZJ!5N) HӔ8tE*hI q]8(d?@cgNzIfե [C` G$#.H7M\!g@ UjDG$Tq  Da/$A16N::2耑˜N*9.-/Dދ{oX[nt {0:-VG3 l)o 1TiH JL]X T&%"QP"Mb&jc Y]˹ݷpQo<&P*p>3c0:N&&G"/[HZ9?PTvɩ"](, lJ8MVbME  趩 Kx _Vop?_f3m}2] Zi0F]KQ$4 \LBl,Qo1֢%mE+6 pH;nDavN|Y>rœtȚõ ˮ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 Q\#hFFc'`7PN: /'gPߌn_oG%~dRAyK9[xZJHĕh/d@*$G%ˆ:HIDAT#r&N{ |v-x,aD򧓳{6N.6Ys#fmdmFTP!F=7@ Eb$&FU "O^U)]TP&M"r8kKǐM8'gd9|ǿW}}\ꆸ*!6cr5Qm=IDlcGx~?$C}Sp| N-edee˟F}ͽ{ }{XVGK*8l[\GֳTBG"<>E8i*•8qz/po<D>};WT`v7o/erZ.|Y>0E edR@K ë#)JE*+*NIح%Q-r6 l4ZNАry'x/z)>4H3|Qc#`ԙ`|4"lצ .:wnepiQ,oh'? kYw)4ri>\AM*_nXLWvp}!T"۶tцc:YV6`#[|~el-ѽ^gdV'R Q+hm( R{ O^5sHB"+Gq.ZZp#0VF#$EEc8ʂZ \3͹53sp`{4LN`GY9A lJ`q+_LƋ,T|2 WoƹfƋGhNFffƲS+ vLabwm&b"ڝ'NZ'3~6eg& t<ɟS?97orR˰@,L 6BaE6Togg 03BWe^257m-\3qi 3~ݬ-gxg|) deܬq#Ho{(C~w88>O7hcNVA5Q ف*: lo$bĤɡ ޾Omflރ0zI֕*(jzթ )o6Y?xӜ׫ n}/PfmT*o}d!ѕρhZ=X;qm%+dkwpw._@jqn6EF~ĆCs?>y$kWGaBq,}ޜ'pNAZxm^_*׵ /}5Q\ؠ ᫡"ūBf/$*j_Iu,}a ?=r 7Q0|?#0dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ6c[IENDB`yagf-0.9.5+repack1/COPYING000755 001750 001750 00000104513 12470517140 016470 0ustar00boradminboradmin000000 000000 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 . yagf-0.9.5+repack1/YAGF.appdata.xml000755 001750 001750 00000004042 12470517140 020312 0ustar00boradminboradmin000000 000000 YAGF.desktop CC0-1.0 GPL-3.0+ YAGF Graphics front-end for Tesseract OCR and Cuneiform

YAGF is a program used to control image scanning and text recognition operations from a single control center. Apart from th scanner almost any graphics file may be used as a source. Also YAGF possesses some image-enhancement capabilities like the auto-contrast adjustement and noise removal that make the scanned pages recognition less error-prone.

Other features include:

  • PDF and multi-page TIFF export with the subsequent text recognition
  • Recognizing text typed in very small letters
  • Spellchecker-assisted optional correction
  • Text is split into blocks automatically
  • Recognizing text written in two languages (like texts in textbooks or technical texts written in one language and containing some terms in other language.

Once installed, YAGF inspects its environment and automatically finds required external programs (like Tesseract OCR and its data files) if they are present so that there is no need to configure it manually by finding and entering program paths. If some required tools are not present in the system the user will be notified of this.

YAGF's Intended audience includes everybody who needs to recognize scanned text, but the people who should benefit most are translators, teachers, digitized text libraries makers and those who switch their business from paper-based to paperless workflow.

http://symmetrica.net/cuneiform-linux/yagf-main.png http://symmetrica.net/cuneiform-linux/yagf-en.html anb@symmetrica.net
yagf-0.9.5+repack1/AUTHORS000755 001750 001750 00000001222 12470517140 016476 0ustar00boradminboradmin000000 000000 Developers: Andrei Borovsky Vadim Arutyunov Icon designers: More Air for YAGF: Nastya Bekassova Crystal Project theme: Everaldo Coelho Oxygen theme: Oxygen Team Human-O2 theme: Schollidesign Translators: German: Stefan Garthe Lithuanian: Donatas Glodenis Polish: Andrzej Januszkiewicz Russian: Andrei Borovsky Ukrainian: Olexa Stasevych yagf-0.9.5+repack1/src/000755 001750 001750 00000000000 13631520722 016215 5ustar00boradminboradmin000000 000000 yagf-0.9.5+repack1/src/BlockAnalysis.cpp000755 001750 001750 00000030341 13631520722 021463 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009 Andrei Borovsky 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 . */ #include "BlockAnalysis.h" #include #include #include #include #include //#define DEBUG BlockAnalysis::BlockAnalysis(QPixmap *pixmap) { m_image = new QImage((pixmap->toImage().convertToFormat(QImage::Format_RGB32))); badImage = m_image->isNull(); this->m_coords = new QRect(m_image->rect()); m_blockMap = NULL; } BlockAnalysis::~BlockAnalysis() { deleteBlock(); delete m_image; } void BlockAnalysis::newBlock() { /*deleteBlock(); m_blockMap = new char * [m_coords->height() - m_coords->top()]; for (int i = 0; i < m_coords->height() - m_coords->top(); i++) m_blockMap[i] = new char[m_coords->width() - m_coords->left()]; for (int i = m_coords->top(); i < m_coords->height(); i++) { QRgb * line = (QRgb *) m_image->scanLine(i); for (int j = m_coords->left(); j < m_coords->width(); j++) { if ((qRed(line[j]) + qGreen(line[j]) + qBlue(line[j])) < treshold) m_blockMap[i-m_coords->top()][j-m_coords->left()] = 0; else m_blockMap[i-m_coords->top()][j-m_coords->left()] = 128; } }*/ } void BlockAnalysis::deleteBlock() { if (m_blockMap != NULL) { for (int i = 0; i < m_coords->height() - m_coords->top(); i++) delete m_blockMap[i]; delete m_blockMap; m_blockMap = NULL; } } void BlockAnalysis::countLinesInImg(int factor, int d) { int ftmp = factor; if (m_image->isNull()) return; for (int i = m_coords->top(); i < m_coords->height(); i++) { int l = i; linesInfo[i] = 0; ftmp = factor; for (int j = m_coords->left(); j < m_coords->width(); j++) { int k = qRed(lines[l][j]) + qGreen(lines[l][j]) + qBlue(lines[l][j]); if (k >= mtreshold - 1) { linesInfo[i]++; #ifdef DEBUG if (d != 0) m_image->setPixel(j, l, (1 << 32) + 1); #endif } else break; ftmp--; if (ftmp == 0) { ftmp = factor; l -= d; if ((l < m_coords->top()) || (l == m_coords->height())) break; } } } longestLine[2] = longestLine[1]; longestLine[1] = longestLine[0]; longestLine[0] = linesInfo[0]; for (int i = m_coords->top(); i < m_coords->height() ; i++) if (linesInfo[i] > longestLine[0]) longestLine[0] = linesInfo[i]; longestCount[2] = longestCount[1]; longestCount[1] = longestCount[0]; longestCount[0] = 0; for (int i = m_coords->top(); i < m_coords->height(); i++) { if (longestLine[0] - linesInfo[i] < 5) longestCount[0]++; } #ifdef DEBUG QImage im = m_image->copy(*m_coords); im.save("/home/andrei/ttt.jpg", "JPEG"); #endif } void BlockAnalysis::countLinesInImg(QImage *_image) { mtreshold = 0; linesInfo = new quint16[_image->rect().height() + _image->rect().top()]; for (int i = 0; i < _image->rect().height() + _image->rect().top(); i++) linesInfo[i] = 0; lines = new QRgb * [_image->rect().height() + _image->rect().top()]; for (int i = _image->rect().top() + _image->rect().height() / 8; i < _image->rect().height() - _image->rect().height() / 8; i++) { QRgb *line = (QRgb *)(m_image->scanLine(i)); lines[i] = line; for (int j = _image->rect().left() + _image->rect().width() / 8; j < _image->rect().width() - _image->rect().width() / 8; j++) { mtreshold = mtreshold + qRed(line[j]) + qGreen(line[j]) + qBlue(line[j]); } } int div = (_image->rect().height() - _image->rect().top()) * (_image->rect().width() - _image->rect().left()); mtreshold = mtreshold / div; if (_image->isNull()) return; for (int i = _image->rect().top() + _image->rect().height() / 8; i < _image->rect().height() - _image->rect().height() / 8; i++) { for (int j = _image->rect().left() + _image->rect().width() / 8; j < _image->rect().width() - _image->rect().width() / 8; j++) { int k = qRed(lines[i][j]) + qGreen(lines[i][j]) + qBlue(lines[i][j]); if (k >= mtreshold - 1) { linesInfo[i]++; #ifdef DEBUG if (d != 0) m_image->setPixel(j, l, (1 << 32) + 1); #endif } else break; } } longestLine[2] = longestLine[1]; longestLine[1] = longestLine[0]; longestLine[0] = linesInfo[0]; for (int i = _image->rect().top(); i < _image->rect().height() ; i++) if (linesInfo[i] > longestLine[0]) longestLine[0] = linesInfo[i]; longestCount[2] = longestCount[1]; longestCount[1] = longestCount[0]; longestCount[0] = 0; for (int i = _image->rect().top(); i < _image->rect().height(); i++) { if (longestLine[0] - linesInfo[i] < 5) longestCount[0]++; } #ifdef DEBUG QImage im = m_image->copy(*m_coords); im.save("/home/andrei/ttt.jpg", "JPEG"); #endif delete lines; delete linesInfo; } int BlockAnalysis::getSkew2() { int ll[7], lc[7]; for (int i = 0; i < 7; i++) { QMatrix m; m.rotate((i - 3) * 2); QImage img = m_image->transformed(m, Qt::SmoothTransformation).convertToFormat(QImage::Format_RGB32); img = img.copy(img.rect()); countLinesInImg(&img); ll[i] = longestLine[0]; lc[i] = longestCount[0]; } int imax = 0; for (int i = 0; i < 7; i++) { if ((ll[i] > ll[imax]) && (lc[i] > lc[imax])) { imax = i; } } int result = (imax - 3) * 2; return result; } int BlockAnalysis::getSkew1() { createLinesInfo(); preScan1(); int ll, lc; int ll1, lc1, div1, dir1; int ll2, lc2, div2, dir2; if (m_coords->width() > 1024) m_coords->setWidth(1024); if (m_coords->height() > m_coords->width() / 2) m_coords->setHeight(m_coords->width() / 2); countLinesInImg(m_coords->width(), 0); ll = longestLine[0]; lc = longestCount[0]; int div = 2; int direction = 1; countLinesInImg(m_coords->width() / div, direction); int safe = 0; while ((longestLine[0] >= longestLine[1]) && (longestCount[0] >= longestCount[1]) && (safe < 512)) { div++; countLinesInImg(m_coords->width() / div, direction); safe++; } ll1 = longestLine[0]; lc1 = longestCount[0]; div1 = div; dir1 = direction; longestLine[0] = ll; longestCount[0] = lc; div = 2; direction = - direction; countLinesInImg(m_coords->width() / div, direction); safe = 0; while ((longestLine[0] >= longestLine[1]) && (longestCount[0] >= longestCount[1]) && (safe < 512)) { div++; countLinesInImg(m_coords->width() / div, direction); safe++; } ll2 = longestLine[0]; lc2 = longestCount[0]; div2 = div; dir2 = direction; int rdir; int rdiv; if ((ll1 > ll2) && (lc1 > lc2)) { rdir = dir1; rdiv = div1; } else { rdir = dir2; rdiv = div2; } float result = atan(((float)(rdiv - 1)) / ((float)m_coords->width()) * rdir) / M_2_PI * 360; QMatrix m; m.rotate(result); QImage *tmp = m_image; m_image = new QImage(tmp->transformed(m, Qt::SmoothTransformation).convertToFormat(QImage::Format_RGB32)); delete tmp; tmp = m_image; m_image = new QImage(tmp->scaled(QSize(tmp->width(), tmp->height()) * 1.1).convertToFormat(QImage::Format_RGB32)); delete tmp; *m_coords = m_image->rect(); delete linesInfo; delete lines; createLinesInfo(); preScan1(); countLinesInImg(m_coords->width(), 0); if ((ll > longestLine[0]) && (lc > longestCount[0])) { result = 0; } // if (((float)longestLine[0])/((float)m_coords->width()) < 0.8) // result = 0; delete linesInfo; delete lines; return result; } int BlockAnalysis::getSkew() { createLinesInfo(); preScan1(); int ll, lc; if (m_coords->width() > 1536) m_coords->setWidth(1536); if (m_coords->height() > m_coords->width() / 2) m_coords->setHeight(m_coords->width() / 2); countLinesInImg(m_coords->width(), 0); ll = longestLine[0]; lc = longestCount[0]; countLinesInImg(m_coords->width() / 4, -1); countLinesInImg(m_coords->width() / 4, 1); int maxRes = 0; if ((longestLine[1] >= longestLine[maxRes]) && (longestCount[1] > longestCount[maxRes])) maxRes = 1; if ((longestLine[2] >= longestLine[maxRes]) && (longestCount[2] > longestCount[maxRes])) maxRes = 2; int direction = 0; if (maxRes == 0) direction = 1; else if (maxRes == 1) direction = -1; else return 0; int div = 4; countLinesInImg(m_coords->width() / div, direction); int safe = 0; while ((longestLine[0] >= longestLine[1]) && (longestCount[0] >= longestCount[1]) && (safe < 512)) { div++; countLinesInImg(m_coords->width() / div, direction); direction = - direction; safe++; } float result = atan(((float)(div - 1)) / ((float)m_coords->width()) * (direction)) / M_2_PI * 360; QMatrix m; m.rotate(result); QImage *tmp = m_image; m_image = new QImage(tmp->transformed(m, Qt::SmoothTransformation).convertToFormat(QImage::Format_RGB32)); *m_coords = m_image->rect(); delete linesInfo; delete lines; delete tmp; createLinesInfo(); preScan1(); countLinesInImg(m_coords->width(), 0); if ((ll > longestLine[0]) && (lc > longestCount[0])) result = 0; if (((float)longestLine[0]) / ((float)m_coords->width()) < 0.8) result = 0; delete linesInfo; delete lines; return result; } void BlockAnalysis::preScan1() { mtreshold = 0; for (int i = m_coords->top(); i < m_coords->height(); i++) { QRgb *line = (QRgb *)(m_image->scanLine(i)); lines[i] = line; for (int j = m_coords->left(); j < m_coords->width(); j++) { mtreshold = mtreshold + qRed(line[j]) + qGreen(line[j]) + qBlue(line[j]); } } int div = (m_coords->height() - m_coords->top()) * (m_coords->width() - m_coords->left()); mtreshold = mtreshold / div; for (int i = m_coords->top(); i < m_coords->height(); i++) { //qint16 pixel1 = qRed(lines[i][m_coords->left()]) + qGreen(lines[i][m_coords->left()]) + qBlue(lines[i][m_coords->left()]); //qint16 pixel2 = qRed(lines[i][m_coords->left() + 1]) + qGreen(lines[i][m_coords->left() + 1]) + qBlue(lines[i][m_coords->left() + 1]); for (int j = m_coords->left() + 2; j < m_coords->width(); j++) { qint16 pixel3 = qRed(lines[i][j]) + qGreen(lines[i][j]) + qBlue(lines[i][j]); if (pixel3 >= mtreshold) { lines[i][j-1] = lines[i][j]; lines[i][j-2] = lines[i][j]; } //pixel1 = pixel2; //pixel2 = pixel3; } lines[i][m_coords->width()-1] = lines[i][m_coords->width()-2]; } for (int i = m_coords->height() - 1; i >= 0; i--) { if (longestLine[0] - linesInfo[i] > 2) { m_coords->setHeight(i + 1); break; } } for (int i = m_coords->top(); i < m_coords->height(); i++) { if (longestLine[0] - linesInfo[i] > 2) { m_coords->setTop(i); break; } } } void BlockAnalysis::createLinesInfo() { linesInfo = new quint16[m_coords->height() + m_coords->top()]; for (int i = 0; i < m_coords->height() + m_coords->top(); i++) linesInfo[i] = 0; lines = new QRgb * [m_coords->height() + m_coords->top()]; } yagf-0.9.5+repack1/src/isrc/000755 001750 001750 00000000000 12470517140 017155 5ustar00boradminboradmin000000 000000 yagf-0.9.5+repack1/src/isrc/MAFY/000755 001750 001750 00000000000 12470517140 017711 5ustar00boradminboradmin000000 000000 yagf-0.9.5+repack1/src/isrc/MAFY/open.svg000755 001750 001750 00000007760 12470517140 021410 0ustar00boradminboradmin000000 000000 Open image/svg+xml Open Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/ZoomOut.svg000755 001750 001750 00000026555 12470517140 022066 0ustar00boradminboradmin000000 000000 Zoom Out image/svg+xml Zoom Out Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/eye.svg000755 001750 001750 00000007323 12470517140 021224 0ustar00boradminboradmin000000 000000 image/svg+xml yagf-0.9.5+repack1/src/isrc/MAFY/sand_clock.svg000755 001750 001750 00000007720 12470517140 022543 0ustar00boradminboradmin000000 000000 Sand Clockimage/svg+xmlSand ClockAnastasiya Bekassovayagf-0.9.5+repack1/src/isrc/MAFY/table-1.svg000755 001750 001750 00000014036 12470517140 021666 0ustar00boradminboradmin000000 000000 Table image/svg+xml Table Anastassiya Bekassova yagf-0.9.5+repack1/src/isrc/MAFY/Project.svg000755 001750 001750 00000007635 12470517140 022056 0ustar00boradminboradmin000000 000000 projectimage/svg+xmlprojectAnastassiya Bekassova Y yagf-0.9.5+repack1/src/isrc/MAFY/Flip.svg000755 001750 001750 00000031460 12470517140 021333 0ustar00boradminboradmin000000 000000 Rotate at -90 image/svg+xml Rotate at -90 Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/save.svg000755 001750 001750 00000007775 12470517140 021413 0ustar00boradminboradmin000000 000000 Save image/svg+xml Save Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/warning.svg000755 001750 001750 00000010106 12470517140 022100 0ustar00boradminboradmin000000 000000 Lines of Text image/svg+xml Lines of Text Nastya Bekassova ! yagf-0.9.5+repack1/src/isrc/MAFY/folder_nempty.svg000755 001750 001750 00000011301 12470517140 023300 0ustar00boradminboradmin000000 000000 Folderimage/svg+xmlFolderAnastassiya Bekassovayagf-0.9.5+repack1/src/isrc/MAFY/COPYING000755 001750 001750 00000104513 12470517140 020753 0ustar00boradminboradmin000000 000000 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 . yagf-0.9.5+repack1/src/isrc/MAFY/Rotateatminus90.svg000755 001750 001750 00000017327 12470517140 023457 0ustar00boradminboradmin000000 000000 Rotate at -90 image/svg+xml Rotate at -90 Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/question.svg000755 001750 001750 00000011005 12470517140 022301 0ustar00boradminboradmin000000 000000 Lines of Text image/svg+xml Lines of Text Nastya Bekassova ? yagf-0.9.5+repack1/src/isrc/MAFY/Recognize.svg000755 001750 001750 00000012360 12470517140 022364 0ustar00boradminboradmin000000 000000 Recognize image/svg+xml Recognize Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/disc.svg000755 001750 001750 00000013375 12470517140 021370 0ustar00boradminboradmin000000 000000 Disc image/svg+xml Disc Nastya Bekassova yagf-0.9.5+repack1/src/isrc/MAFY/SingleBlock.svg000755 001750 001750 00000006022 12470517140 022631 0ustar00boradminboradmin000000 000000 Single Block image/svg+xml Single Block Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/information.svg000755 001750 001750 00000010774 12470517140 022773 0ustar00boradminboradmin000000 000000 Lines of Text image/svg+xml Lines of Text Nastya Bekassova i yagf-0.9.5+repack1/src/isrc/MAFY/split.svg000755 001750 001750 00000017555 12470517140 021605 0ustar00boradminboradmin000000 000000 Spli image/svg+xml Spli Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/save2.svg000755 001750 001750 00000007112 12470517140 021456 0ustar00boradminboradmin000000 000000 Save image/svg+xml Save Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/Settings.svg000755 001750 001750 00000032467 12470517140 022251 0ustar00boradminboradmin000000 000000 Settings image/svg+xml Settings Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/scanner.svg000755 001750 001750 00000014561 12470517140 022075 0ustar00boradminboradmin000000 000000 Scanner image/svg+xml Scanner Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/up_arrow.svg000755 001750 001750 00000004315 12470517140 022276 0ustar00boradminboradmin000000 000000 image/svg+xml yagf-0.9.5+repack1/src/isrc/MAFY/README000755 001750 001750 00000000444 12470517140 020576 0ustar00boradminboradmin000000 000000 This is YAGF branch of my "More Air" icon set. (C) 2014 Nastya Bekassova, nastya.bekassova@yandex.ru This material is distributed under GPL licence. See COPYING for more detail. Important note: you don't need these SVG sources to build YAGF itself. They are here only to keep the GPL happy. yagf-0.9.5+repack1/src/isrc/MAFY/Earth.svg000755 001750 001750 00000034101 12470517140 021477 0ustar00boradminboradmin000000 000000 Earthimage/svg+xmlEarthAnastassiaya Bekassovayagf-0.9.5+repack1/src/isrc/MAFY/Trashcan.svg000755 001750 001750 00000010452 12470517140 022202 0ustar00boradminboradmin000000 000000 Trashcan image/svg+xml Trashcan Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/table1.svg000755 001750 001750 00000013116 12470517140 021607 0ustar00boradminboradmin000000 000000 Table image/svg+xml Table Nastya Bekassova yagf-0.9.5+repack1/src/isrc/MAFY/check.svg000755 001750 001750 00000004466 12470517140 021524 0ustar00boradminboradmin000000 000000 image/svg+xmlyagf-0.9.5+repack1/src/isrc/MAFY/folder.svg000755 001750 001750 00000007751 12470517140 021722 0ustar00boradminboradmin000000 000000 Folderimage/svg+xmlFolderAnastassiya Bekassovayagf-0.9.5+repack1/src/isrc/MAFY/twicks.svg000755 001750 001750 00000007520 12470517140 021745 0ustar00boradminboradmin000000 000000 Settings image/svg+xml Settings Anastassiaya Bekassova yagf-0.9.5+repack1/src/isrc/MAFY/ZoomIn.svg000755 001750 001750 00000016423 12470517140 021656 0ustar00boradminboradmin000000 000000 ZoomIn image/svg+xml ZoomIn Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/Align.svg000755 001750 001750 00000014045 12470517140 021473 0ustar00boradminboradmin000000 000000 Align image/svg+xml Align Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/upscale.svg000755 001750 001750 00000007446 12470517140 022104 0ustar00boradminboradmin000000 000000 Upscale image/svg+xml Upscale Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ A yagf-0.9.5+repack1/src/isrc/MAFY/Paste.svg000755 001750 001750 00000006700 12470517140 021514 0ustar00boradminboradmin000000 000000 Paste image/svg+xml Paste Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/table.svg000755 001750 001750 00000005532 12470517140 021531 0ustar00boradminboradmin000000 000000 Table image/svg+xml Table Nastya Bekassova yagf-0.9.5+repack1/src/isrc/MAFY/Spellcheck.svg000755 001750 001750 00000020110 12470517140 022504 0ustar00boradminboradmin000000 000000 Spellcheck image/svg+xml Spellcheck Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/Copy.svg000755 001750 001750 00000006002 12470517140 021345 0ustar00boradminboradmin000000 000000 Copy image/svg+xml Copy Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/languages.svg000755 001750 001750 00000022452 12470517140 022410 0ustar00boradminboradmin000000 000000 Languages image/svg+xml Languages Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/Rotateat90.svg000755 001750 001750 00000021230 12470517140 022367 0ustar00boradminboradmin000000 000000 Rotate at -90 image/svg+xml Rotate at -90 Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/back_arrow.svg000755 001750 001750 00000004344 12470517140 022554 0ustar00boradminboradmin000000 000000 image/svg+xml yagf-0.9.5+repack1/src/isrc/MAFY/lines.svg000755 001750 001750 00000012274 12470517140 021555 0ustar00boradminboradmin000000 000000 Lines of Text image/svg+xml Lines of Text Nastya Bekassova Keep linesseparated as inthe scanningoutput ratherthan remove all the line breaks. yagf-0.9.5+repack1/src/isrc/MAFY/critical.svg000755 001750 001750 00000011026 12470517140 022227 0ustar00boradminboradmin000000 000000 Lines of Text image/svg+xml Lines of Text Nastya Bekassova - yagf-0.9.5+repack1/src/isrc/MAFY/cogs.svg000755 001750 001750 00000016116 12470517140 021375 0ustar00boradminboradmin000000 000000 Engine image/svg+xml Engine Anastassiya Bekassova yagf-0.9.5+repack1/src/isrc/MAFY/Cut.svg000755 001750 001750 00000016666 12470517140 021207 0ustar00boradminboradmin000000 000000 Cut image/svg+xml Cut Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/box.svg000755 001750 001750 00000022766 12470517140 021242 0ustar00boradminboradmin000000 000000 Lines of Text image/svg+xml Lines of Text Nastya Bekassova yagf-0.9.5+repack1/src/isrc/MAFY/open2.svg000755 001750 001750 00000017117 12470517140 021467 0ustar00boradminboradmin000000 000000 Open image/svg+xml Open Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/RemoveBlock.svg000755 001750 001750 00000011545 12470517140 022653 0ustar00boradminboradmin000000 000000 Remove Block image/svg+xml Remove Block Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/isrc/MAFY/RemoveBlocks.svg000755 001750 001750 00000015205 12470517140 023033 0ustar00boradminboradmin000000 000000 Remove Blocks image/svg+xml Remove Blocks Nastya Bekassova Nastya Bekassova More Air for YAGF icon set symmetrica.net/~bekassova/ yagf-0.9.5+repack1/src/recognizerwrapper.h000755 001750 001750 00000002307 13631520722 022143 0ustar00boradminboradmin000000 000000 /* 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. */ #ifndef RECOGNIZERWRAPPER_H #define RECOGNIZERWRAPPER_H #include #include "tblock.h" class QString; class RecognizerWrapperInternal; class RecognizerWrapper : public QObject { Q_OBJECT public: explicit RecognizerWrapper(QObject *parent = 0); ~RecognizerWrapper(); static bool findEngine(bool selected = false); signals: void started(); void finished(int); void error(const QString &text); void blockRecognized(int n); void readOutput(QString text, QChar separator); public slots: void start(); void startSingleBlock(); void cancel(); private slots: void onError(); private: RecognizerWrapperInternal * rwi; }; #endif // RECOGNIZERWRAPPER_H yagf-0.9.5+repack1/src/projectmanager.h000755 001750 001750 00000003511 13631520722 021372 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2011 Andrei Borovsky 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 . */ #include #include class QXmlStreamWriter; class QXmlStreamReader; class ProjectSaver : public QObject { Q_OBJECT public: explicit ProjectSaver(QObject *parent = 0); bool save(const QString &dir); signals: public slots: private: void writePages(); void writeBlocks(); void writeSettings(); QString copyFile(const QString &source); private: QXmlStreamWriter *stream; QString directory; QStringList imagesSaved; private: void deleteGarbageFiles(); }; class ProjectLoader : public QObject { Q_OBJECT public: explicit ProjectLoader(QObject *parent = 0); bool load(const QString &dir); signals: void languageChanged(); void engineChanged(); public slots: private: bool readPages(); bool readBlocks(); bool readSettings(); void loadPage(); bool readNextElement(); private: QXmlStreamReader *stream; QString directory; QString version; QStringList filesLoaded; private: bool loadInternal(const QString &dir, const QString &fn); void deleteGarbageFiles(); }; yagf-0.9.5+repack1/src/globallock.h000755 001750 001750 00000000624 13631520722 020504 0ustar00boradminboradmin000000 000000 #ifndef GLOBALLOCK_H #define GLOBALLOCK_H class Unlocker { public: explicit Unlocker(bool locked); ~Unlocker(); private: bool unlock; }; class GlobalLock { public: static GlobalLock *instance(); bool lock(); void unlock(); bool isLocked(); private: GlobalLock(); GlobalLock(const GlobalLock &); private: static GlobalLock *m_instance; }; #endif // GLOBALLOCK_H yagf-0.9.5+repack1/src/extprocessdialog.ui000755 001750 001750 00000005617 13631520722 022147 0ustar00boradminboradmin000000 000000 ExtProcessDialog 0 0 281 138 Dialog 6 Qt::Horizontal 40 20 60 60 Qt::Horizontal 40 20 Qt::Horizontal 40 20 Cancel Qt::Horizontal 40 20 Qt::Vertical 20 4 QBusyIndicator QWidget
QBusyIndicator.h
1
yagf-0.9.5+repack1/src/qsnippet.h000755 001750 001750 00000002435 13631520722 020240 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2010 Andrei Borovsky 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 . */ #ifndef QSNIPPET_H #define QSNIPPET_H #include #include #include #include #include class QSnippet : public QListWidgetItem { public: explicit QSnippet(QListWidget *parent = 0); bool setPage(int id, const QString &name, const QImage &image = QImage()); QString getName(); int pageID(); int imageHeight(); int imageWidth(); signals: public slots: private: QString name; int pid; int ih; int iw ; }; #endif // QSNIPPET_H yagf-0.9.5+repack1/src/qxtgraphicsproxywidget.h000755 001750 001750 00000002434 13631520722 023237 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #ifndef QXTGRAPHICSPROXYWIDGET_H #define QXTGRAPHICSPROXYWIDGET_H #include class QXtGraphicsView; class QXtGraphicsProxyWidget : public QGraphicsProxyWidget { Q_OBJECT public: QXtGraphicsProxyWidget(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); void setView(QXtGraphicsView *view); public slots: void viewScrolled(); protected: QVariant itemChange(GraphicsItemChange change, const QVariant &value); private: QXtGraphicsView *mview; }; #endif // QXTGRAPHICSPROXYWIDGET_H yagf-0.9.5+repack1/src/configdialog.ui000755 001750 001750 00000046357 13631520722 021223 0ustar00boradminboradmin000000 000000 ConfigDialog 0 0 686 388 YAGF Settings 1.000000000000000 0 0 210 16777215 11 false QAbstractItemView::DragDrop 48 48 Qt::ElideNone QListView::Snap QListView::TopToBottom true QListView::Fixed QListView::SinglePass 5 QListView::IconMode true 190 false OCR and Languages 11 AlignHCenter|AlignVCenter|AlignCenter :/isrc/MAFY/cogs.svg:/isrc/MAFY/cogs.svg ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled Image Processing AlignHCenter|AlignVCenter|AlignCenter :/isrc/MAFY/eye.svg:/isrc/MAFY/eye.svg ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled Program Behavoir AlignHCenter|AlignVCenter|AlignCenter :/isrc/MAFY/twicks.svg:/isrc/MAFY/twicks.svg ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled 1 0 2 OCR Engine Cuneiform true Tesseract Path to Tesseract Data Files false 30 16777215 ... Recognize Languages Use Single Language: true 190 16777215 Choose Among Several Languages 0 0 190 16777215 Languages to Use... Qt::Vertical 20 35 0 200 Enhance Image Quality Crop Image When Loaded true Deskew Loaded Images true 6 Qt::Horizontal 40 20 1 0 Process after Deskew Preprocess Images When Loaded Qt::Vertical 20 121 Interface Language Force English Locale Default Font Size 48 0 6 48 11 Qt::Horizontal 40 20 11 75 true Enable Autosave true Autosave interval (minutes) 5 60 5 15 Qt::Horizontal 40 20 Remember 2 16 1 8 Recent Projects Qt::Horizontal 40 20 Qt::Vertical 20 97 Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() ConfigDialog accept() 248 254 157 274 buttonBox rejected() ConfigDialog reject() 316 260 286 274 listWidget itemClicked(QListWidgetItem*) ConfigDialog itemClicked(QListWidgetItem*) 109 167 401 184 itemClicked(QListWidgetItem*) yagf-0.9.5+repack1/src/scanimage.h000755 001750 001750 00000000326 13631520722 020321 0ustar00boradminboradmin000000 000000 #ifndef SCANIMAGE_H #define SCANIMAGE_H #include class ScanImage : public QObject { Q_OBJECT public: explicit ScanImage(QObject *parent = 0); signals: public slots: }; #endif // SCANIMAGE_H yagf-0.9.5+repack1/src/qxtgraphicsproxywidget.cpp000755 001750 001750 00000003263 13631520722 023573 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #include "qxtgraphicsproxywidget.h" #include "qxtgraphicsview.h" #include #include #include QXtGraphicsProxyWidget::QXtGraphicsProxyWidget(QGraphicsItem *parent, Qt::WindowFlags wFlags) : QGraphicsProxyWidget(parent, wFlags) { setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); } void QXtGraphicsProxyWidget::setView(QXtGraphicsView *view) { mview = view; QPointF p = mview->mapToScene(0,0); setPos(p.x(), p.y()); //setPos(0,0); connect(mview, SIGNAL(scrolled()), this, SLOT(viewScrolled())); } void QXtGraphicsProxyWidget::viewScrolled() { QPointF p = mview->mapToScene(0,0); setPos(p.x(), p.y()); } QVariant QXtGraphicsProxyWidget::itemChange(GraphicsItemChange change, const QVariant &value) { QVariant v; matrix().reset(); if (change == QGraphicsItem::ItemTransformChange) { v = QVariant(matrix()); return v; } return value; } yagf-0.9.5+repack1/src/tblock.h000755 001750 001750 00000003013 13631520722 017644 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2012 Andrei Borovsky 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 . */ #ifndef TBLOCK_H #define TBLOCK_H #include #include #include class Block : public QRect { public: explicit Block( int x, int y, int width, int height ); Block(const QRect &r); Block(); int blockNumber(); void setBlockNumber(const int value); void setLanguage(const QString &lang); void setTableCell(const bool value); bool isTableCell(); void setRowEnd(bool value); bool isRowEnd(); QString getLanguage(); QPoint getCenter(); private: int number; QPoint center; bool tableCell; bool rowEnd; QString language; }; typedef QList TableRow; typedef QList TableBlocks; typedef QList Blocks; void sortBlocks(Blocks &blocks); #endif // TBLOCK_H yagf-0.9.5+repack1/src/scanner.h000755 001750 001750 00000003604 13631520722 020025 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2012 Andrei Borovsky 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 . */ #ifndef SCANNER_H #define SCANNER_H #include #include #include class ScannerBase : public QObject { Q_OBJECT public: explicit ScannerBase(QObject *parent = 0); ~ScannerBase(); void addParameter(const QString &s); void addEnvironmentVar(const QString &s); void setOutputFile(const QString &s); QString programName(); virtual void exec() = 0; signals: void processFinished(); public slots: private slots: void finished( int, QProcess::ExitStatus ); protected: void waitFor(); void execInternal(const QString &s); void setProgramName(const QString &s); void setPreloadLibrary(const QString &s); private: QProcess scanProcess; QStringList parameters; QStringList environment; QString outputFile; QString pName; QString preloadLibrary; }; class ScannerFactory { public: ScannerFactory(); QStringList frontEnds(); ScannerBase *createScannerFE(const QString &name); private: QString findPreloadLibrary(); void findFEs(); private: QString preloadPath; QStringList fes; }; #endif // SCANNERBASE_H yagf-0.9.5+repack1/src/waitwindow.h000755 001750 001750 00000000443 13631520722 020566 0ustar00boradminboradmin000000 000000 #ifndef WAITWINDOW_H #define WAITWINDOW_H #include namespace Ui { class WaitWindow; } class WaitWindow : public QWidget { Q_OBJECT public: explicit WaitWindow(QWidget *parent = 0); ~WaitWindow(); private: Ui::WaitWindow *ui; }; #endif // WAITWINDOW_H yagf-0.9.5+repack1/src/qgraphicsinput.h000755 001750 001750 00000007044 13631520722 021437 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #ifndef QGRAPHICSINPUT_H #define QGRAPHICSINPUT_H #include "sidebar.h" #include #include #include #include #include #include typedef QList ActionList; class Block; class QGraphicsPixmapItem; class QGraphicsRectItem; class QPixmap; class QCursor; class QRectF; class QCursor; class QToolBar; class QActions; enum SelectStates { NoSelect = 0, StartSelect, Selecting }; class QGraphicsInput : public QGraphicsScene { Q_OBJECT public: explicit QGraphicsInput(const QRectF &sceneRect, QGraphicsView *view = 0); ~QGraphicsInput(); void setView(QGraphicsView *view); QRect getActiveBlock(); QRect getCurrentBlock(); void deleteBlock(int index); void deleteCurrentBlock(); void deleteActiveBlock(); void clearBlocks(); bool addBlock(const QRectF &rect, bool removeObstacles = true); void addBlockColliding(Block block); void drawLine(int x1, int y1, int x2, int y2); void imageOrigin(QPoint &p); QPixmap getCurrentImage(); void cropWhiteFrame(); void setMagnifierCursor(QCursor *cursor); QGraphicsRectItem *newBlock(QRectF rect); bool loadImage(const QPixmap &pixmap); void setDeskewMode(bool value); bool getDeskewMode(); QLineF getDeskData(); void clearDeskLine(); //setMagnifierCursor(QCursor * cursor = ); protected: virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent); virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent); virtual void wheelEvent(QGraphicsSceneWheelEvent *wheelEvent); virtual void keyReleaseEvent(QKeyEvent *keyEvent); virtual void keyPressEvent(QKeyEvent *keyEvent); signals: void leftMouseClicked(int x, int y, bool blockSelected); void rightMouseClicked(int x, int y, bool inTheBlock); void keyPressed(int key); void increaseMe(); void decreaseMe(); void blockCreated(QRect rect); void deleteBlock(QRect rect); void clickMeAgain(); private slots: private: void leftMouseRelease(qreal x, qreal y); void rightMouseRelease(qreal x, qreal y); int nearActiveBorder(qreal x, qreal y); void clearTransform(); void deleteBlockRect(QGraphicsRectItem *item); void setDeskLine(int x, int y); QGraphicsView *m_view; QGraphicsPixmapItem *m_image; QGraphicsRectItem *m_CurrentBlockRect; QGraphicsRectItem *m_LastSelected; QGraphicsLineItem *deskLine; SelectStates selecting; QRectF blockRect; QRectF selBlockRect; bool hasImage; Qt::MouseButton buttonPressed; QCursor *magnifierCursor; int near_res; QRect redRect; bool xred; bool deskewMode; bool deskewing; QLineF desData; }; #endif // QGRAPHICSINPUT_H yagf-0.9.5+repack1/src/mainform.ui000755 001750 001750 00000134772 13631520722 020405 0ustar00boradminboradmin000000 000000 MainWindow 0 0 1920 1138 Qt::CustomContextMenu MainWindow :/yagf.png:/yagf.png 2 2 QFrame::StyledPanel QFrame::Raised 1 1 1 0 0 1 120 0 120 2048 94 94 94 94 94 94 255 255 255 1 Qt::ScrollBarAlwaysOff true 100 128 Qt::ElideNone QListView::LeftToRight 4 QListView::IconMode 120 60 120 60 76 76 76 94 94 94 94 94 94 60 60 60 94 94 94 76 76 76 94 94 94 94 94 94 94 94 94 94 94 94 76 76 76 94 94 94 94 94 94 60 60 60 94 94 94 76 76 76 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 :/images/Trashcan.png Qt::AlignCenter 1 0 Qt::Horizontal 4 Qt::NoContextMenu Times New Roman Qt::ScrollBarAlwaysOn selectLangsBox->setStyleSheet("border: 1px solid blue; padding: 2px 2px 2px 18px; min-width: 6em; background-color: white; selection-background-color:blue; QComboBox::drop-down: { width: 0px; border-style: none}"); 0 0 1920 25 &File &Help &Edit 0 0 0 0 toolBar Image acquisition background-color: rgb(218, 218, 208); 32 32 TopToolBarArea false toolBar_2 Image manpulation background-color: rgb(208, 218, 208); TopToolBarArea false toolBar_3 Recognition background-color: rgb(218, 208, 208); QComboBox { border: 1px solid gray; border-radius: 3px; padding: 1px 18px 1px 3px; min-width: 6em; } QComboBox:editable { background: white; } QComboBox:!editable, QComboBox::drop-down:editable { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #E1E1E1, stop: 0.4 #DDDDDD, stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3); } /* QComboBox gets the "on" state when the popup is open */ QComboBox:!editable:on, QComboBox::drop-down:editable:on { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D3D3D3, stop: 0.4 #D8D8D8, stop: 0.5 #DDDDDD, stop: 1.0 #E1E1E1); } QComboBox:on { /* shift the text when the popup opens */ padding-top: 3px; padding-left: 4px; } QComboBox::drop-down { subcontrol-origin: padding; subcontrol-position: top right; width: 15px; border-left-width: 1px; border-left-color: darkgray; border-left-style: solid; /* just a single line */ border-top-right-radius: 3px; /* same radius as the QComboBox */ border-bottom-right-radius: 3px; } QComboBox::down-arrow { image: url(/usr/share/icons/crystalsvg/16x16/actions/1downarrow.png); } QComboBox::down-arrow:on { /* shift the arrow when popup is open */ top: 1px; left: 1px; } TopToolBarArea false toolBar_6 TopToolBarArea false toolBar_4 Text manipulation background-color: rgb(218, 218, 208); TopToolBarArea false toolBar_5 background-color: rgb(208, 218, 218); TopToolBarArea false :/images/scanner.png:/images/scanner.png S&can... Scanning images using XSane... Ctrl+N :/images/save.png:/images/save.png &Save All Text... Ctrl+X :/images/disc.png:/images/disc.png &Open Image... Open Image Ctrl+O :/images/Recognize.png:/images/Recognize.png &Recognize Recognizing text... Ctrl+R Choose &Language Quit Ctrl+Q :/images/back.png:/images/back.png Previous page Move to previous image :/images/forward.png:/images/forward.png Next page Move to next image Online Help About... Online Help :/images/Copy.png:/images/Copy.png Copy Text to Clipboard Copy recognized text to clipboard :/batch.png:/batch.png Recognize &All Pages Recognize All Pages Ctrl+A :/images/RemoveBlocks.png:/images/RemoveBlocks.png Clear all blocks Clear all blocks :/images/RemoveBlock.png:/images/RemoveBlock.png Delete the current block Delete the current block :/images/recblocks.png:/images/recblocks.png Recognize block Recognize this block Clear numbers Crear block numbering true :/images/Spellcheck.png:/images/Spellcheck.png Check spelling :/images/save.png:/images/save.png Save current image... Save currently opened image in its real size :/images/saveblock.png:/images/saveblock.png Save block Save the current block to the image file true :/images/upscale.png:/images/upscale.png Enlarge Page Script Enlarge Page Script true :/images/stock_new_html.png:/images/stock_new_html.png Select HTML format Select HTML format as recognition output :/images/ZoomIn.png:/images/ZoomIn.png Larger view (Ctrl + Mouse Wheel) Larger view (Ctrl + Mouse Wheel) :/images/ZoomOut.png:/images/ZoomOut.png Smaller view (Ctrl + Mouse Wheel) Smaller view (Ctrl + Mouse Wheel) :/images/Rotatem90.png:/images/Rotatem90.png Rotate 90 CCW Rotate 90 CCW :/images/Flip.png:/images/Flip.png Rotate 180 Rotate 180 :/images/Rotateat90.png:/images/Rotateat90.png Rotate 90 CW Rotate 90 CW :/images/Align.png:/images/Align.png Align Page by Guideline Align Page by Guideline :/images/Settings.png:/images/Settings.png Settings :/images/Paste.png:/images/Paste.png Paste Image Paste image from clipboard :/images/SingleBlock.png:/images/SingleBlock.png Select Text Area Select Text Area Deskew Block Deskew the current block :/images/split.png:/images/split.png Select multiple blocks Splits text into several blocks Toggle Large/Small Icons :/images/system_config_language.png:/images/system_config_language.png Select Recognition Language Select Recognition Language Save Project As... :/isrc/MAFY/open.svg:/isrc/MAFY/open.svg Load Project... :/images/languages.png:/images/languages.png Select Recognition Languages... Select Recognition Languages Select All Text Select all the recognized text Ctrl+A :/images/languages.png:/images/languages.png Select languages for recognition Select languages for recognition true :/images/lines.png:/images/lines.png Keep Lines Keep line-breaks in the scanned text :/images/table.png:/images/table.png Select Table Select Table Recent Projects Close All :/isrc/MAFY/save.svg:/isrc/MAFY/save.svg Save Project Ctrl+S :/images/recblocks.png:/images/recblocks.png TestAction Save Text on the Page... QXtGraphicsView QGraphicsView
qxtgraphicsview.h
SideBar QListWidget
sidebar.h
DropLabel QLabel
droplabel.h
TextEditor QTextEdit
texteditor.h
actionTBLV triggered() MainWindow enlargeButtonClicked() -1 -1 959 568 actionSmaller_view triggered() MainWindow decreaseButtonClicked() -1 -1 959 568 actionRotate_90_CCW triggered() MainWindow rotateCCWButtonClicked() -1 -1 959 568 actionRotate_180 triggered() MainWindow rotate180ButtonClicked() -1 -1 959 568 actionRotate_90_CW triggered() MainWindow rotateCWButtonClicked() -1 -1 959 568 actionAlign_Page_by_Guideline triggered() MainWindow deskewByLine() -1 -1 959 568 actionOCR_Settings triggered() MainWindow showConfigDlg() -1 -1 959 568 actionPaste_Image triggered() MainWindow pasteimage() -1 -1 959 568 actionSelect_Text_Area triggered() MainWindow selectTextArea() -1 -1 959 568 actionDeskew_by_Block triggered() MainWindow deskewByBlock() -1 -1 959 568 actionSelect_multiple_blocks triggered() MainWindow selectBlocks() -1 -1 959 568 actionSave_Project_As triggered() MainWindow saveProjectAs() -1 -1 959 568 actionLoad_Project triggered() MainWindow loadProject() -1 -1 959 568 actionSelect_Recognition_Languages triggered() MainWindow SelectRecognitionLanguages() -1 -1 959 568 actionUpscale toggled(bool) MainWindow upscale() -1 -1 959 568 actionSelect_Table triggered() MainWindow splitTable() -1 -1 959 568 actionSave_Project triggered() MainWindow saveProject() -1 -1 959 568 actionClose_All triggered() MainWindow closeAll() -1 -1 959 568 actionTestAction triggered() MainWindow testslot() -1 -1 959 568 actionSave_Text_on_the_Page triggered() MainWindow saveCurrentText() -1 -1 959 568 rotateCWButtonClicked() rotateCCWButtonClicked() rotate180ButtonClicked() enlargeButtonClicked() decreaseButtonClicked() showConfigDlg() pasteimage() blockAllText() deskewByBlock() showAdvancedSettings() selectTextArea() selectBlocks() setSmallIcons() preprocessPage() saveProjectAs() loadProject() SelectRecognitionLanguages() deskewByLine() upscale() splitTable() saveProject() closeAll() testslot() saveCurrentText()
yagf-0.9.5+repack1/src/proginfowindow.h000755 001750 001750 00000000503 13631520722 021442 0ustar00boradminboradmin000000 000000 #ifndef PROGINFOWINDOW_H #define PROGINFOWINDOW_H #include namespace Ui { class ProgInfoWindow; } class ProgInfoWindow : public QDialog { Q_OBJECT public: explicit ProgInfoWindow(QWidget *parent = 0); ~ProgInfoWindow(); private: Ui::ProgInfoWindow *ui; }; #endif // PROGINFOWINDOW_H yagf-0.9.5+repack1/src/menuaction.h000755 001750 001750 00000002317 13631520722 020536 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #ifndef MENUACTION_H #define MENUACTION_H #include class MenuAction : public QAction { Q_OBJECT public: MenuAction(const QString &text, QObject * parent = 0) :QAction(text, parent) { connect (this, SIGNAL(triggered()), this, SLOT(emitTriggered())); } signals: void triggered(const QString &text); private slots: void emitTriggered() { emit triggered(text()); } }; #endif // MENUACTION_H yagf-0.9.5+repack1/src/autosaver.h000755 001750 001750 00000001455 13631520722 020407 0ustar00boradminboradmin000000 000000 #ifndef AUTOSAVER_H #define AUTOSAVER_H #include #include #include class AutoSaver : public QObject { Q_OBJECT //QThread workerThread; public: explicit AutoSaver(QObject *parent = 0); public slots: void save(const QString &path); signals: void reportError(const QString &path); void saved(); public slots: }; class AutoSaveManager : public QObject { Q_OBJECT QThread workerThread; public: explicit AutoSaveManager(QObject *parent = 0); ~AutoSaveManager(); void startAutoSave(); signals: void startedAutoSave(); // queued void startJob(const QString &path); void finishedAutoSave(); void saved(); void reportError(const QString &path); public slots: void work(const QString &path); }; #endif // AUTOSAVER_H yagf-0.9.5+repack1/src/popplerdialog.cpp000755 001750 001750 00000003620 13631520722 021566 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #include "popplerdialog.h" #include "ui_popplerdialog.h" #include PopplerDialog::PopplerDialog(QWidget *parent) : QDialog(parent), ui(new Ui::PopplerDialog) { ui->setupUi(this); } PopplerDialog::~PopplerDialog() { delete ui; } void PopplerDialog::setPDFFile(const QString fileName) { ui->lineEdit->setText(fileName); } void PopplerDialog::on_checkBox_toggled(bool checked) { ui->spinBox->setEnabled(!checked); ui->spinBox_2->setEnabled(!checked); } void PopplerDialog::on_pushButton_clicked() { QString fileName = QFileDialog::getOpenFileName(this, trUtf8("Open PDF File"), "", trUtf8("PDF Files (*.pdf)")); if (!fileName.isEmpty()) ui->lineEdit->setText(fileName); } QString PopplerDialog::getPDFFile() { return ui->lineEdit->text(); } QString PopplerDialog::getStartPage() { return QString::number(ui->spinBox->value()); } QString PopplerDialog::getStopPage() { if (ui->checkBox->isChecked()) return "-1"; return QString::number(ui->spinBox_2->value()); } bool PopplerDialog::getDeskew() { return !(ui->checkBox_2->isChecked()); } yagf-0.9.5+repack1/src/scanner.cpp000755 001750 001750 00000005546 13631520722 020367 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2012 Andrei Borovsky 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 . */ #include "scanner.h" #include "utils.h" #include class XSaneScannerFE : public ScannerBase { public: XSaneScannerFE(const QString &PLL, QObject *parent = 0) : ScannerBase(parent) { addParameter("-s"); addParameter("-n"); addParameter("-N"); setProgramName("XSane"); setPreloadLibrary(PLL); addEnvironmentVar("LD_PRELOAD=" + PLL); } void exec() { waitFor(); execInternal("xsane"); } }; ScannerBase::ScannerBase(QObject *parent) : QObject(parent), scanProcess(this) { environment.append(QProcess::systemEnvironment()); } ScannerBase::~ScannerBase() { waitFor(); } void ScannerBase::addParameter(const QString &s) { parameters.append(s); } void ScannerBase::addEnvironmentVar(const QString &s) { environment.append(s); } void ScannerBase::setOutputFile(const QString &s) { outputFile = s; } QString ScannerBase::programName() { return pName; } void ScannerBase::waitFor() { scanProcess.terminate(); scanProcess.waitForFinished(10000); } void ScannerBase::execInternal(const QString &s) { scanProcess.setEnvironment(environment); QStringList sl; sl.append(parameters); sl.append(outputFile); connect(&scanProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(finished(int,QProcess::ExitStatus))); scanProcess.start(s, sl); } void ScannerBase::setProgramName(const QString &s) { pName = s; } void ScannerBase::setPreloadLibrary(const QString &s) { preloadLibrary = s; } QString ScannerFactory::findPreloadLibrary() { QString path = QString(PRILIBRARY_PATH); return path + QString("libxspreload.so"); } void ScannerFactory::findFEs() { if (findProgram("xsane")) fes << "xsane"; } ScannerFactory::ScannerFactory() { preloadPath = findPreloadLibrary(); findFEs(); } ScannerBase *ScannerFactory::createScannerFE(const QString &name) { if (fes.contains(name)) return new XSaneScannerFE(preloadPath); return NULL; } void ScannerBase::finished(int, QProcess::ExitStatus) { emit processFinished(); } yagf-0.9.5+repack1/src/waitwindow.cpp000755 001750 001750 00000000421 13631520722 021115 0ustar00boradminboradmin000000 000000 #include "waitwindow.h" #include "ui_waitwindow.h" WaitWindow::WaitWindow(QWidget *parent) : QWidget(parent), ui(new Ui::WaitWindow) { ui->setupUi(this); setWindowFlags(Qt::Window | Qt::FramelessWindowHint); } WaitWindow::~WaitWindow() { delete ui; } yagf-0.9.5+repack1/src/scanimage.cpp000755 001750 001750 00000000130 13631520722 020645 0ustar00boradminboradmin000000 000000 #include "scanimage.h" ScanImage::ScanImage(QObject *parent) : QObject(parent) { } yagf-0.9.5+repack1/src/droplabel.cpp000755 001750 001750 00000003554 13631520722 020677 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #include "droplabel.h" #include #include #include #include #include #include #include #include DropLabel::DropLabel(QWidget *parent, Qt::WindowFlags f) : QLabel(parent, f) { setAcceptDrops(true); } void DropLabel::dragEnterEvent(QDragEnterEvent *event) { //event->setDropAction(Qt::IgnoreAction); const QMimeData *md = event->mimeData(); QStringList sl = md->formats(); if (!md->formats().contains("text/uri-list")) { setCursor(Qt::ForbiddenCursor); } else { event->setDropAction(Qt::MoveAction); event->accept(); //QCursor cur(lw->selectedItems().at(0)->icon().pixmap(96, 128)); //setCursor(cur); } } void DropLabel::dragLeaveEvent(QDragLeaveEvent *event) { setCursor(Qt::ArrowCursor); event->accept(); } void DropLabel::dropEvent(QDropEvent *event) { if (event->dropAction() == Qt::MoveAction) event->ignore(); else event->accept(); } void DropLabel::setListWidget(QListWidget *w) { lw = 0; } yagf-0.9.5+repack1/src/loadprojectdialog.cpp000755 001750 001750 00000003657 13631520722 022425 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2015 Andrei Borovsky 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 . */ #include "loadprojectdialog.h" #include LoadProjectDialog::LoadProjectDialog(const QString &path, QWidget *parent) : SaveProjectDialog(path, parent) { setWindowTitle(trUtf8("Load Project")); lineEdit()->setStyleSheet("color: rgb(0, 0, 0)"); connect(this, SIGNAL(projectClicked(QString,QString)), this, SLOT(onProjectClicked(QString,QString))); } QString LoadProjectDialog::projectPath() { return pPath; } QString LoadProjectDialog::projectName() { return pName; } void LoadProjectDialog::accept() { if (lineEdit()->text() != "") { if (isProjectDir(lineEdit()->text())) { pPath = lineEdit()->text(); QDialog::accept(); } else cd(lineEdit()->text()); return; } if (pPath != "") { QDialog::accept(); } } void LoadProjectDialog::reject() { pPath = ""; pName = ""; QDialog::reject(); } void LoadProjectDialog::onProjectClicked(const QString &path, const QString &name) { pPath = path; pName = name; QDialog::accept(); } void LoadProjectDialog::onLineEditTextChanged(QLineEdit *le, const QString &arg1) { le->setStyleSheet(""); } yagf-0.9.5+repack1/src/autosaver.cpp000755 001750 001750 00000002423 13631520722 020736 0ustar00boradminboradmin000000 000000 #include "autosaver.h" #include "projectmanager.h" #include "settings.h" #include "globallock.h" AutoSaver::AutoSaver(QObject *parent) : QObject(parent) { } void AutoSaver::save(const QString &path) { ProjectSaver ps; if (!ps.save(path)) emit reportError(trUtf8("failed to save the project")); else emit saved(); } AutoSaveManager::AutoSaveManager(QObject *parent): QObject(parent) { } AutoSaveManager::~AutoSaveManager() { workerThread.quit(); workerThread.wait(); } void AutoSaveManager::startAutoSave() { emit startedAutoSave(); } void AutoSaveManager::work(const QString &path) { AutoSaver * autoSaver= new AutoSaver; autoSaver->moveToThread(&workerThread); connect(&workerThread, SIGNAL(finished()), autoSaver, SLOT(deleteLater())); connect(this, SIGNAL(startJob(QString)), autoSaver, SLOT(save(QString))); connect(autoSaver, SIGNAL(saved()), this, SIGNAL(finishedAutoSave())); connect(autoSaver, SIGNAL(reportError(QString)), this, SIGNAL(reportError(QString))); workerThread.start(); // workerThread.setPriority(QThread::LowPriority); if (path != "") emit startJob(path); else { QString npath = Settings::instance()->workingDir() + "autosave"; emit startJob(npath); } } yagf-0.9.5+repack1/src/tiffimporter.cpp000755 001750 001750 00000005355 13631520722 021446 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #include "tiffimporter.h" #include "settings.h" #include #include #include TiffImporter::TiffImporter(const QString &fileName, QObject *parent) : QObject(parent), tiffName(fileName) { } void TiffImporter::exec() { QString wd = Settings::instance()->workingDir(); QDir dir; dir.setPath(wd); QStringList sl, pf, nf; sl << "t*_out*.jpg"; pf = dir.entryList(sl); QProcess proc; proc.setEnvironment(QProcess::systemEnvironment()); proc.setWorkingDirectory(wd); QString size = Settings::instance()->tiffPageSize(); QString density = Settings::instance()->tiffDensity(); QString cmd = QString("convert %1 -units PixelsPerInch -resize %2x%3 -units PixelsPerInch -density %4 t%5_out.jpg").arg(tiffName).arg(size).arg(size).arg(density).arg(Settings::instance()->uniqueSeed()); proc.start(cmd); proc.waitForFinished(); if (proc.exitStatus() != QProcess::NormalExit) { emit error(); return; } nf = dir.entryList(sl); foreach(QString s, nf) { if (!pf.contains(s)) files.append(wd+s); } if (files.count()) emit finished(files); else { QImageReader ir(tiffName); if (!ir.read().isNull()) files.append(tiffName); else { const QString ppmFile = QString::fromAscii("input.ppm"); if (dir.exists(ppmFile)) { dir.remove(ppmFile); QProcess proc; proc.setEnvironment(QProcess::systemEnvironment()); proc.setWorkingDirectory(wd); proc.start("tifftopnm > " + ppmFile); proc.waitForFinished(); QImageReader ir(wd+ppmFile); if (!ir.read().isNull()) files.append(wd + ppmFile); } } } if (files.count()) emit finished(files); else emit error(); } QStringList TiffImporter::extractedFiles() { return files; } yagf-0.9.5+repack1/src/qxtgraphicsview.h000755 001750 001750 00000002601 13631520722 021620 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #ifndef QXTGRAPHICSVIEW_H #define QXTGRAPHICSVIEW_H #include #include class QXtGraphicsView : public QGraphicsView { Q_OBJECT public: QXtGraphicsView(QWidget *parent = 0):QGraphicsView(parent) { connect(this, SIGNAL(scrolledDeferred()), this, SIGNAL(scrolled()), Qt::QueuedConnection); } void sendScrollSignal() { emit scrolledDeferred(); } signals: void scrolled(); void scrolledDeferred(); protected: void scrollContentsBy (int dx, int dy) { QGraphicsView::scrollContentsBy(dx, dy); emit scrolled(); } }; #endif // QXTGRAPHICSVIEW_H yagf-0.9.5+repack1/src/popplerdialog.ui000755 001750 001750 00000016762 13631520722 021434 0ustar00boradminboradmin000000 000000 PopplerDialog 0 0 320 257 Import from PDF :/images/application_pdf.png:/images/application_pdf.png File Name 1 0 Select... Pages 2 From spinBox false 1 1 1 999 12 2 4 2 To spinBox_2 false 0 0 1 999 Qt::Horizontal 40 20 0 1 Entire Document true Don't Deskew Pages true Qt::Vertical 20 40 Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox rejected() PopplerDialog reject() 316 260 286 274 buttonBox accepted() PopplerDialog accept() 248 254 157 274 yagf-0.9.5+repack1/src/ycommon.h000755 001750 001750 00000002131 13631520722 020047 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2010 Andrei Borovsky 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 . */ #ifndef YCOMMMON_H #define YCOMMMON_H #include #include #include #include typedef QList QPointList; inline QRect QRectF2Rect(const QRectF &rf) { QRect r; r.setX(rf.x()); r.setY(rf.y()); r.setWidth(rf.width()); r.setHeight(rf.height()); return r; } #endif yagf-0.9.5+repack1/src/qxtunixscinternal.h000755 001750 001750 00000001632 13631520722 022176 0ustar00boradminboradmin000000 000000 /* 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. */ #ifndef QXTUNIXSCINTERNAL_H #define QXTUNIXSCINTERNAL_H #include class QXtUnixSignalCatcherInternal : public QObject { Q_OBJECT public: QXtUnixSignalCatcherInternal(QObject *parent = 0) : QObject(parent) {} void emitSignal(int sig_num) { emit unixSignalInternal(sig_num); } signals: void unixSignalInternal(int sig_num); }; #endif // QXTUNIXSCINTERNAL_H yagf-0.9.5+repack1/src/langselectdialog.cpp000755 001750 001750 00000007323 13631520722 022232 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #include "langselectdialog.h" #include "ui_langselectdialog.h" #include "settings.h" #include #include #include const int max_lang = 48; LangSelectDialog::LangSelectDialog(QWidget *parent) : QDialog(parent), ui(new Ui::LangSelectDialog) { ui->setupUi(this); fillLangs(); connect (ui->listWidgetCuneiform, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(onItemClicked(QListWidgetItem *))); connect (ui->listWidgetTesseract, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(onItemClicked(QListWidgetItem *))); } LangSelectDialog::~LangSelectDialog() { delete ui; } QStringList LangSelectDialog::getRecognitionLanguages() const { QStringList res; foreach(QListWidgetItem * item, items) { if (item->checkState() == Qt::Checked) res.append(item->text()); } res.removeDuplicates(); return res; } void LangSelectDialog::accept() { QStringList sl = getRecognitionLanguages(); if (sl.count() == 0) return; Settings::instance()->setSelectedLanguages(sl); QDialog::accept(); } void LangSelectDialog::onItemClicked(QListWidgetItem *item) { foreach(QListWidgetItem *it, items) { if (it->text() == item->text()) it->setCheckState(item->checkState()); } } void LangSelectDialog::fillLangs() { QStringList sl = Settings::instance()->languagesAvailableTo("cuneiform"); sl.sort(); foreach (QString s, sl) { QListWidgetItem *item = new QListWidgetItem(ui->listWidgetCuneiform); item->setFlags(Qt::ItemIsUserCheckable|Qt::ItemIsEnabled); item->setText(s); items.append(item); item->setCheckState(Qt::Unchecked); if (Settings::instance()->selectedLanguagesAvailableTo("cuneiform").contains(s)) item->setCheckState(Qt::Checked); } sl.clear(); ui->listWidgetTesseract->setIconSize(QSize(18, 18)); sl = Settings::instance()->languagesAvailableTo("tesseract"); foreach (QString s, sl) { if (s.contains("+")) continue; QListWidgetItem *item = new QListWidgetItem(ui->listWidgetTesseract); item->setFlags(Qt::ItemIsUserCheckable|Qt::ItemIsEnabled); item->setText(s); items.append(item); item->setCheckState(Qt::Unchecked); if (Settings::instance()->selectedLanguagesAvailableTo("tesseract").contains(s)) item->setCheckState(Qt::Checked); if (Settings::instance()->installedTesseractLanguages().contains(s)) { item->setIcon(QIcon(QPixmap(":/images/box.png"))); item->setToolTip(trUtf8("Installed")); } else { item->setIcon(QIcon(QPixmap(":/images/notinst.png"))); item->setToolTip(trUtf8("Not installed")); } if (s == trUtf8("Digits Only")) { item->setCheckState(Qt::Checked); item->setIcon(QIcon(QPixmap(":/images/box.png"))); item->setToolTip(trUtf8("Installed")); } } } yagf-0.9.5+repack1/src/make_style.sh000755 001750 001750 00000000201 12470517140 020702 0ustar00boradminboradmin000000 000000 #!/bin/sh astyle --style=k\&r -l --convert-tabs --pad-header --indent-switches --align-pointer=name --indent=spaces=4 *.cpp *.h yagf-0.9.5+repack1/src/busyform.ui000755 001750 001750 00000004646 13631520722 020437 0ustar00boradminboradmin000000 000000 BusyForm 0 0 493 326 Form QFrame::StyledPanel QFrame::Raised Qt::Horizontal 194 20 50 50 50 50 Qt::Horizontal 193 20 background-color: darkgray; color: rgb(255, 255, 255); QSplashScreen QWidget
qsplashscreen.h
1
QBusyIndicator QWidget
QBusyIndicator.h
1
yagf-0.9.5+repack1/src/recognizerwrapper.cpp000755 001750 001750 00000003165 13631520722 022501 0ustar00boradminboradmin000000 000000 /* 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. */ #include "recognizerwrapper.h" #include "recognizerwrapperinternal.h" RecognizerWrapper::RecognizerWrapper(QObject *parent) : QObject(parent) { rwi = new RecognizerWrapperInternal(this); rwi->init(); connect(rwi, SIGNAL(error(QString)), this, SIGNAL(error(QString))); connect(rwi, SIGNAL(finished(int)), this, SIGNAL(finished(int))); connect(rwi, SIGNAL(error(QProcess::ProcessError)), this, SLOT(onError())); connect(rwi, SIGNAL(blockRecognized(int)), this, SIGNAL(blockRecognized(int))); connect(rwi, SIGNAL(readOutput(QString, QChar)), this, SIGNAL(readOutput(QString, QChar))); } RecognizerWrapper::~RecognizerWrapper() { delete rwi; } bool RecognizerWrapper::findEngine(bool selected) { return RecognizerWrapperInternal::findEngine(selected); } void RecognizerWrapper::start() { rwi->recognize(); } void RecognizerWrapper::startSingleBlock() { rwi->recognizeInternal(); } void RecognizerWrapper::cancel() { rwi->supressErros = true; rwi->proc.kill(); } void RecognizerWrapper::onError() { if (!rwi->supressErros) emit error(trUtf8("Recognizer error.")); } yagf-0.9.5+repack1/src/configdialog.cpp000755 001750 001750 00000010740 13631520722 021353 0ustar00boradminboradmin000000 000000 #include "configdialog.h" #include "ui_configdialog.h" #include "settings.h" #include "langselectdialog.h" #include #include #include ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent), ui(new Ui::ConfigDialog) { ui->setupUi(this); ui->stackedWidget->setCurrentIndex(0); ui->listWidget->setCurrentRow(0); //ui->listWidget->setMinimumWidth(ui->listWidget->sizeHintForColumn(0)); for (int i = 0; i < ui->listWidget->count(); i++) ui->listWidget->item(i)->setToolTip(ui->listWidget->item(i)->text()); init(); } ConfigDialog::~ConfigDialog() { delete ui; } void ConfigDialog::accept() { Settings *settings = Settings::instance(); if (ui->radioButtonCuneiform->isChecked()) settings->setSelectedEngine(UseCuneiform); else settings->setSelectedEngine(UseTesseract); settings->setTessdataPath(ui->lineEditTessData->text()); if (ui->checkBoxSingleLang->isChecked()) { QStringList sl; sl << ui->comboBoxSingleLang->currentText(); settings->setSelectedLanguages(sl); settings->setLanguage(settings->getShortLanguageName(sl[0])); } settings->setCropLoaded(ui->checkBoxCrop->isChecked()); settings->setAutoDeskew(ui->checkBoxDeskew->isChecked()); settings->setPreprocessed(ui->checkBoxPreprocess->isChecked()); settings->setDoublePreprocessed(ui->checkBoxProcessAfterDeskew->isChecked()); settings->setNoLocale(false); if (ui->checkBox->isChecked()) { settings->setNoLocale(true); } else { settings->setNoLocale(false); } if (ui->checkBox_2->isChecked()) settings->setAutosaveInterval(ui->spinBox_2->value()); else settings->setAutosaveInterval(30000); settings->setFontSize(ui->fontSizeSpinBox->value()); settings->setMaxRecentProjects(ui->recentProjectsSpinBox->value()); QDialog::accept(); } void ConfigDialog::init() { Settings *settings = Settings::instance(); ui->radioButtonCuneiform->setChecked(settings->getSelectedEngine() == UseCuneiform); ui->radioButtonTesseract->setChecked(settings->getSelectedEngine() == UseTesseract); ui->lineEditTessData->setText(settings->getTessdataPath()); QStringList sl = settings->getSelectedLanguages(); ui->checkBoxSingleLang->setChecked(sl.count() == 1); QStringList sl2 = settings->fullLanguageNames(); sl2.prepend(settings->getFullLanguageName(settings->getLanguage())); sl2.removeDuplicates(); ui->comboBoxSingleLang->clear(); ui->comboBoxSingleLang->addItems(sl2); ui->checkBoxCrop->setChecked(settings->getCropLoaded()); ui->checkBoxDeskew->setChecked(settings->getAutoDeskew()); ui->checkBoxPreprocess->setChecked(settings->getPreprocessed()); ui->checkBoxProcessAfterDeskew->setChecked(settings->getDoublePreprocessed()); if (settings->getAutosaveInterval() > 60) { ui->checkBox_2->setChecked(false); ui->spinBox_2->setValue(15); ui->spinBox_2->setEnabled(false); } else{ ui->spinBox_2->setValue(settings->getAutosaveInterval()); ui->spinBox_2->setEnabled(true); } QStringList sl3; if (settings->useNoLocale()) sl3 << "English"; sl3 << QLocale::languageToString(QLocale::system().language()) << "English" << "Russian"; sl3.removeDuplicates(); //ui->comboBoxInterfaceLang->addItems(sl3); ui->fontSizeSpinBox->setValue(settings->getFontSize()); ui->recentProjectsSpinBox->setValue(settings->getMaxRecentProjects()); } void ConfigDialog::on_pushButtonTessData_clicked() { QString dir = QFileDialog::getExistingDirectory(this, trUtf8("Tesseract Data Directory"), "/"); if (dir != "") { if (dir.endsWith("tessdata/")) dir.truncate(dir.length()-9); if (dir.endsWith("tessdata")) dir.truncate(dir.length()-8); if (!dir.endsWith("/")) dir = dir + "/"; ui->lineEditTessData->setText(dir); } } void ConfigDialog::on_pushButtonLangs_clicked() { ui->checkBoxSingleLang->setChecked(false); LangSelectDialog lsd; lsd.exec(); } void ConfigDialog::itemClicked(QListWidgetItem *item) { ui->stackedWidget->setCurrentIndex(ui->listWidget->row(item)); } void ConfigDialog::on_checkBoxProcessAfterDeskew_toggled(bool checked) { if (ui->checkBoxProcessAfterDeskew->isChecked()) ui->checkBoxDeskew->setChecked(true); } void ConfigDialog::on_checkBox_2_toggled(bool checked) { ui->spinBox_2->setEnabled(ui->checkBox_2->isChecked()); } yagf-0.9.5+repack1/src/QBusyIndicator.h000755 001750 001750 00000004623 13631520722 021276 0ustar00boradminboradmin000000 000000 /* This widget is based on QBusyIndicator by James Aleksans. YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2015 Andrei Borovsky 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 . */ #ifndef QBUSYINDICATOR_H #define QBUSYINDICATOR_H #include #include class QBusyIndicator : public QWidget { Q_OBJECT Q_PROPERTY(bool showBackground READ getShowBackground WRITE setShowBackground) Q_PROPERTY(double speed READ getSpeed WRITE setSpeed) Q_PROPERTY(bool displayedWhenStopped READ isDisplayedWhenStopped WRITE setDisplayedWhenStopped) Q_PROPERTY(QColor color READ color WRITE setColor) Q_PROPERTY(QColor backgroundColor READ getBackgroundColor WRITE setBackgroundColor) public: QBusyIndicator(QWidget *parent = 0); bool getShowBackground() const { return m_showBackground; } double getSpeed() const { return m_speed; } bool isAnimated () const; bool isDisplayedWhenStopped() const; const QColor &color() const { return m_color; } const QColor &getBackgroundColor() const { return m_backgroundColor; } virtual QSize sizeHint() const; int heightForWidth(int w) const; public slots: void startAnimation(); void stopAnimation(); void setSpeed(double speed); void setDisplayedWhenStopped(bool state); void setColor(const QColor &color); void setShowBackground(bool state); void setBackgroundColor(const QColor &color); protected: virtual void timerEvent(QTimerEvent *event); virtual void paintEvent(QPaintEvent *event); private: bool m_showBackground; int m_angle; int m_timerId; double m_speed; bool m_displayedWhenStopped; QColor m_color; QColor m_backgroundColor; }; #endif // QBUSYINDICATOR_H yagf-0.9.5+repack1/src/projectfiles.h000755 001750 001750 00000001605 13631520722 021064 0ustar00boradminboradmin000000 000000 #ifndef PROJECTFILES_H #define PROJECTFILES_H #include #include class ProjectFiles { public: ProjectFiles(const QString &rootDir); ~ProjectFiles(); QStringList directories(); QStringList projects(); bool isDirEmpty(const QString &dirName); bool canProjectBeSavedToDir(const QString &name); // relative bool isProjectDir(); bool isProjectDir(const QString &path); bool hasTemporaryData(); void cd(const QString &newRoot); bool pathExists(const QString &path); bool canCdTo(const QString &path); bool canCdToUpper(const QString &path); QString upDir(const QString &path); QString currentDir(); QString projectName(const QString &path); private: QStringList dirs; QStringList projs; QString root; bool isPD; private: bool isProjectDirInternal(const QString &path); }; #endif // PROJECTFILES_H yagf-0.9.5+repack1/src/BlockAnalysis.h000755 001750 001750 00000002772 13631520722 021137 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009 Andrei Borovsky 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 . */ #ifndef BLOCKANALYSIS_H #define BLOCKANALYSIS_H #include #include class QPixmap; class QImage; class QRect; class BlockAnalysis { public: BlockAnalysis(QPixmap *pixmap); ~BlockAnalysis(); int getSkew(); int getSkew1(); int getSkew2(); QRect getCoords(); QPixmap getPixmap(); private: QImage *m_image; char **m_blockMap; int longestLine[3]; int longestCount[3]; QRect *m_coords; qint64 mtreshold; quint16 *linesInfo; QRgb **lines; void newBlock(); void deleteBlock(); void countLinesInImg(int factor, int d); void countLinesInImg(QImage *_image); void preScan1(); void deleteLines(); bool badImage; void createLinesInfo(); }; #endif // BLOCKANALYSIS_H yagf-0.9.5+repack1/src/pdfextractor.cpp000755 001750 001750 00000012120 13631520722 021425 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2010 Andrei Borovsky 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 . */ #include "pdfextractor.h" #include "settings.h" #include "utils.h" #include "busyform.h" #include #include #include #include #include #include #include #include PDFExtractor::PDFExtractor(QObject *parent) : QObject(parent), proc(), convertEntire(false) { connect (&proc, SIGNAL(started()), this, SIGNAL(processStarted()), Qt::QueuedConnection); connect(&proc, SIGNAL(finished(int)), this, SLOT(procFinished()), Qt::QueuedConnection); //connect(&proc, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(procFinishedError())); connect(&proc, SIGNAL(error(QProcess::ProcessError)), this, SLOT(procFinishedError())); } PDFExtractor::~PDFExtractor() { proc.kill(); clearFiles(); } void PDFExtractor::setCommandStringPaged(const QString &cmdStr) { commandStringPaged = cmdStr; } void PDFExtractor::setConvertEntire(const QString &cmdStr) { commandStringEntire = cmdStr; } void PDFExtractor::setOutputDir() { QString pdfout = Settings::instance()->workingDir()+ QString("pdfout/"); outputDir = pdfout; QDir dir(pdfout); if (!dir.exists()) dir.mkdir(pdfout); else { dir.setFilter(QDir::Files); QStringList sl = dir.entryList(); foreach (QString s, sl) dir.remove(pdfout+s); } } QString PDFExtractor::getOutputDir() { return outputDir; } void PDFExtractor::setOutputExtension(const QString &value) { outputExtension = value; } QString PDFExtractor::getOutputExtension() { return outputExtension; } void PDFExtractor::run() { proc.setEnvironment(QProcess::systemEnvironment()); QStringList sl = makeCommandString(); QString cmd = sl.first(); sl.removeAt(0); proc.start(cmd, sl); } void PDFExtractor::setOutputPrefix(const QString &value) { outputPrefix = value; } QString PDFExtractor::getOutputPrefix() { return outputPrefix; } void PDFExtractor::setResolution(const QString &value) { resolution = value; } QString PDFExtractor::getResolution() { return resolution; } void PDFExtractor::setSourcePDF(const QString &value) { sourcePDF = value; } QString PDFExtractor::getSourcePDF() { return sourcePDF; } void PDFExtractor::setStartPage(const QString &value) { startPage = value.toInt(); } int PDFExtractor::getStartPage() { return startPage; } void PDFExtractor::setStopPage(const QString &value) { stopPage = value.toInt(); } int PDFExtractor::getStopPage() { return stopPage; } void PDFExtractor::cancelProcess() { proc.kill(); clearFiles(); } void PDFExtractor::sortDir(QDir &dir) { //pageCount(); dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); dir.setSorting(QDir::Size | QDir::Reversed); dir.setSorting(QDir::Name); dir.setPath(outputDir); } #include "utils.h" void PDFExtractor::procFinished() { emit processFinished(false); processFiles(); } void PDFExtractor::procFinishedError() { emit error(trUtf8("There was an error while extracting PDF pages.")); emit processFinished(true); processFiles(); } void PDFExtractor::processFiles() { QApplication::processEvents(); QDir dir; sortDir(dir); QFileInfoList fil; fil = dir.entryInfoList(filters, QDir::Files, QDir::Name); int counter = fil.count(); while (counter > 0) { int current = fil.count() - counter; QApplication::processEvents(); emit addPage(fil[current].absoluteFilePath(), current+1, fil.count()); counter--; } clearFiles(); emit extractingFinished(); } void PDFExtractor::clearFiles() { QDir dir; dir.setPath(outputDir); QFileInfoList fil; fil = dir.entryInfoList(filters, QDir::Files, QDir::Name); foreach (QFileInfo fi, fil) { dir.remove(fi.absoluteFilePath()); } } void PDFExtractor::removeRemaining() { if (lastFile != "") { QDir dir; sortDir(dir); QStringList sl = dir.entryList(); sl.sort(); bool doDelete = false; for (int i = 0; i < sl.count(); i++) { if (doDelete) { QFile f(outputDir+sl.at(i)); f.remove(); } if (lastFile.endsWith(sl.at(i))) doDelete = true; } } lastFile = ""; } yagf-0.9.5+repack1/src/busyform.h000755 001750 001750 00000002134 13631520722 020237 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #ifndef BUSYFORM_H #define BUSYFORM_H #include namespace Ui { class BusyForm; } class BusyForm : public QSplashScreen { Q_OBJECT public: explicit BusyForm(QWidget *parent = 0); ~BusyForm(); public slots: void textOut(const QString &text); private: Ui::BusyForm *ui; }; #endif // BUSYFORM_H yagf-0.9.5+repack1/src/sidebar.cpp000755 001750 001750 00000011747 13631520722 020347 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2010 Andrei Borovsky 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 . */ #include "sidebar.h" #include "qsnippet.h" #include #include #include #include #include #include #include #include SideBar::SideBar(QWidget *parent) : QListWidget(parent) { //setDragDropOverwriteMode(true); current = 0; setMaximumWidth(120); setMinimumWidth(120); connect(this, SIGNAL(currentItemChanged(QListWidgetItem *,QListWidgetItem *)), this, SLOT(itemActive(QListWidgetItem *,QListWidgetItem *))); setToolTip(trUtf8("Drop files here")); setAcceptDrops(true); setDropIndicatorShown(true); lock = false; dragging = false; } void SideBar::addItem(QSnippet *item) { setAlternatingRowColors(false); QSize size= item->sizeHint(); size.setWidth(width()); if (item->imageWidth() == 0) return; int h = item->imageHeight()*100/item->imageWidth(); if (h > width()+2) h = width()+2; size.setHeight(item->imageHeight() < width() ? item->imageHeight() + 2 : h + 2); item->setSizeHint(size); QListWidget::addItem(item); setCurrentItem(item); } void SideBar::itemActive(QListWidgetItem *item, QListWidgetItem *item2) { if (lock) return; lock = true; if (item) { emit pageSelected(((QSnippet *)item)->pageID()); current = ((QSnippet *)item); } else current = 0; lock = false; } /*void SideBar::dragEnterEvent(QDragEnterEvent *event) { if (!event->mimeData()->hasUrls()) { setCursor(Qt::ForbiddenCursor); event->ignore(); // >mimeData()->setData("application/x-qabstractitemmodeldatalist", QByteArray()); } else { setCursor(Qt::DragCopyCursor); event->accept(); } QListWidget::dragEnterEvent(event); }*/ QStringList SideBar::mimeTypes() const { QStringList qstrList; qstrList.append("text/uri-list"); return qstrList; } Qt::DropActions SideBar::supportedDropActions() const { if (dragging) return 0; return Qt::CopyAction | Qt::MoveAction; } bool SideBar::dropMimeData(int index, const QMimeData *data, Qt::DropAction action) { // if (action == Qt::MoveAction) // return false; QList urlList; urlList = data->urls(); // retrieve list of urls QStringList files; foreach(QUrl url, urlList) { // iterate over list files.append(url.toLocalFile()); ++index; // increment index to preserve drop order } emit filesDropped(files); return true; } void SideBar::startDrag(Qt::DropActions supportedActions) { dragging = true; supportedActions |= Qt::MoveAction; QDrag *drag = new QDrag(this); QMimeData *mimeData = new QMimeData(); QList urlList; QStringList sl; foreach(QListWidgetItem * lwi, selectedItems()) { QString s = QString::number(((QSnippet *)lwi)->pageID()); sl << s; } mimeData->setUrls(urlList); drag->setMimeData(mimeData); if (drag->exec(supportedActions,Qt::CopyAction) == Qt::CopyAction) { foreach(QListWidgetItem * lwi, selectedItems()) { emit fileRemoved(((QSnippet *) lwi)->pageID()); model()->removeRow(row(lwi)); } } current = 0; dragging = false; } QSnippet *SideBar::getItemByName(const QString &name) { for (int i = 0; i < count(); i++) { if (((QSnippet *)item(i))->getName() == name) return ((QSnippet *)item(i)); } return NULL; } void SideBar::select(const QString &name) { current = getItemByName(name); if (current) current->setSelected(true); } void SideBar::selectFirstFile() { if (count() == 0) { current = NULL; return; } current = (QSnippet *) item(0); } /*void SideBar::dragLeaveEvent(QDragLeaveEvent *event) { setCursor(Qt::ArrowCursor); event->accept(); //QListWidget::dragLeaveEvent(event); } void SideBar::dropEvent(QDropEvent *event) { if (event->mimeData()->hasUrls()) { QList ul = event->mimeData()->urls(); QList::Iterator i; for (i = ul.begin(); i != ul.end(); i++) { QUrl url = *i; this->addFile(url.toLocalFile()); } } setCursor(Qt::ArrowCursor); event->accept(); //QListWidget::dropEvent(event); }*/ yagf-0.9.5+repack1/src/configdialog.h000755 001750 001750 00000001157 13631520722 021022 0ustar00boradminboradmin000000 000000 #ifndef CONFIGDIALOG_H #define CONFIGDIALOG_H #include #include namespace Ui { class ConfigDialog; } class ConfigDialog : public QDialog { Q_OBJECT public: explicit ConfigDialog(QWidget *parent = 0); ~ConfigDialog(); void accept(); private slots: void on_pushButtonTessData_clicked(); void on_pushButtonLangs_clicked(); void itemClicked(QListWidgetItem *item); void on_checkBoxProcessAfterDeskew_toggled(bool checked); void on_checkBox_2_toggled(bool checked); private: void init(); private: Ui::ConfigDialog *ui; }; #endif // CONFIGDIALOG_H yagf-0.9.5+repack1/src/QBusyIndicator.cpp000755 001750 001750 00000007373 13631520722 021636 0ustar00boradminboradmin000000 000000 /* This widget is based on QBusyIndicator by James Aleksans. YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2015 Andrei Borovsky 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 . */ #include "QBusyIndicator.h" #include const int defaultInterval = 64; QBusyIndicator::QBusyIndicator(QWidget *parent) : QWidget(parent), m_showBackground(false), m_angle(0), m_timerId(-1), m_speed(1), m_displayedWhenStopped(false), m_color(Qt::black), m_backgroundColor(Qt::white) { setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); setFocusPolicy(Qt::NoFocus); } bool QBusyIndicator::isAnimated () const { return (m_timerId != -1); } void QBusyIndicator::setDisplayedWhenStopped(bool state) { m_displayedWhenStopped = state; update(); } bool QBusyIndicator::isDisplayedWhenStopped() const { return m_displayedWhenStopped; } void QBusyIndicator::startAnimation() { m_angle = 0; if (m_timerId == -1) m_timerId = startTimer(m_speed*defaultInterval); } void QBusyIndicator::stopAnimation() { if (m_timerId != -1) killTimer(m_timerId); m_timerId = -1; update(); } void QBusyIndicator::setSpeed(double speed) { if (m_timerId != -1) killTimer(m_timerId); m_speed = speed; if (m_timerId != -1) m_timerId = startTimer(m_speed*defaultInterval); } void QBusyIndicator::setColor(const QColor &color) { m_color = color; update(); } void QBusyIndicator::setShowBackground(bool state) { m_showBackground = state; update(); } void QBusyIndicator::setBackgroundColor(const QColor &color) { m_backgroundColor = color; update(); } QSize QBusyIndicator::sizeHint() const { return QSize(20,20); } int QBusyIndicator::heightForWidth(int w) const { return w; } void QBusyIndicator::timerEvent(QTimerEvent * /*event*/) { m_angle = (m_angle+20)%360; update(); } void QBusyIndicator::paintEvent(QPaintEvent * /*event*/) { if (!m_displayedWhenStopped && !isAnimated()) return; int width = qMin(this->width(), this->height()); QPainter p(this); p.setRenderHint(QPainter::Antialiasing); int outerRadius = m_showBackground ? (width-8)*0.5 : (width-4)*0.5; int innerRadius = m_showBackground ? (width-8)*0.5*0.38 : (width-4)*0.5*0.38; int boundingRadius = outerRadius + 2; int capsuleHeight = outerRadius - innerRadius; int capsuleWidth = (width > 32 ) ? capsuleHeight *.23 : capsuleHeight *.35; int capsuleRadius = capsuleWidth/2; if (m_showBackground) { p.setBrush(QColor(m_backgroundColor)); p.setPen(QColor(m_backgroundColor)); p.drawEllipse(rect().center(), boundingRadius, boundingRadius); } for (int i=0; i<18; i++) { QColor color = m_color; color.setAlphaF(qMax(1.0 - (i/16.0), 0.)); p.setPen(Qt::NoPen); p.setBrush(color); p.save(); p.translate(rect().center()); p.rotate(m_angle - i*20.0f); p.drawRoundedRect(-capsuleWidth*0.5, -(innerRadius+capsuleHeight), capsuleWidth, capsuleHeight, capsuleRadius, capsuleRadius); p.restore(); } } yagf-0.9.5+repack1/src/utils.cpp000755 001750 001750 00000006341 13631520722 020070 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009 Andrei Borovsky 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 . */ #include "settings.h" #include #include #include #include #include #include #include #include #include #include "utils.h" QString extractFileName(const QString &path) { QFileInfo fi(path); return fi.fileName(); } QString extractFilePath(const QString &path) { QFileInfo fi(path); QString s = fi.dir().path(); if (!s.endsWith("/")) s += '/'; return s; } QString extractDigits(const QString &fn) { bool extracting = FALSE; QString result = ""; for (int i = 0; i < fn.size(); i++) if ((fn.at(i) >= '0') && (fn.at(i) <= '9')) { extracting = TRUE; result += fn.at(i); } else { if (extracting) break; } return result; } bool findProgram(const QString &name) { QStringList sl = QString(getenv("PATH")).split(":"); QFileInfo fi; for (int i = 0; i < sl.count(); i++) { fi.setFile(sl.at(i), name); if (fi.exists()) return true; } return false; } static bool mbShown = false; void styledWarningMessage(QWidget *parent, const QString &text) { if (mbShown) return; QMessageBox mb(parent); mb.setIconPixmap(QPixmap(":warning.png")); mb.setWindowTitle(QObject::trUtf8("Warning")); mb.setText(text); mb.setButtonText(0, QObject::trUtf8("OK")); mbShown = true; mb.exec(); mbShown = false; } void styledInfoMessage(QWidget *parent, const QString &text) { QMessageBox mb(parent); mb.setIconPixmap(QPixmap(":/images/info.png")); mb.setWindowTitle(QObject::trUtf8("Information")); mb.setText(text); mb.setButtonText(0, QObject::trUtf8("OK")); mb.exec(); } void styledCriticalMessage(QWidget *parent, const QString &text) { QMessageBox mb(parent); mb.setIconPixmap(QPixmap(":/critical.png")); mb.setWindowTitle(QObject::trUtf8("Error")); mb.setText(text); mb.setButtonText(0, QObject::trUtf8("OK")); mb.exec(); } struct SleepThread : public QThread { using QThread::msleep;}; void qSleep(int msecs) { SleepThread::msleep(msecs); } void clearTmpFiles() { Settings * settings = Settings::instance(); QFile::remove(settings->workingDir() + "tmp*.bmp"); QFile::remove(settings->workingDir() + "tmp*.ygf"); QFile f(settings->workingDir()+settings->getRecognizeInputFile()); f.remove(); f.setFileName(settings->workingDir()+settings->getRecognizeOutputFile()); f.remove(); } yagf-0.9.5+repack1/src/waitwindow.ui000755 001750 001750 00000002126 13631520722 020754 0ustar00boradminboradmin000000 000000 WaitWindow Qt::ApplicationModal 0 0 88 115 Form 0.000010000000000 :/images/sand_clock.png:/images/sand_clock.png 64 64 yagf-0.9.5+repack1/src/djvu2pdf.cpp000755 001750 001750 00000004552 13631520722 020456 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2015 Andrei Borovsky 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 . */ #include "djvu2pdf.h" #include "utils.h" #include "settings.h" #include #include #include #include Djvu2PDF::Djvu2PDF(QObject *parent) : QObject(parent) { pdfout = Settings::instance()->workingDir()+ QString("fromdjvu/"); QDir dir(pdfout); if (!dir.exists()) dir.mkdir(pdfout); connect(&process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(onError())); connect(&process, SIGNAL(started()), this, SIGNAL(started()), Qt::QueuedConnection); connect(&process, SIGNAL(finished(int)), this, SLOT(onFinished()), Qt::QueuedConnection); } Djvu2PDF::~Djvu2PDF() { cancel(); } void Djvu2PDF::convert(const QString &fileName) { if (!findProgram("ddjvu")) { emit error(trUtf8("The ddjvu utility from the DjVuLibre package has not been found.\nPlease make sure the package is installed.")); return; } QString output = pdfout + "out.pdf"; QStringList sl; sl << "--format=pdf" << fileName << output; process.start("ddjvu", sl); } QString Djvu2PDF::pdfName() const { return pdfout + "out.pdf"; } void Djvu2PDF::onError() { emit error(trUtf8("Failed to convert djvu to pdf")); } void Djvu2PDF::cancel() { process.kill(); clearFiles(); } void Djvu2PDF::onFinished() { QFileInfo fi(pdfout, "out.pdf"); if (!fi.exists()) onError(); else emit finished(); } void Djvu2PDF::clearFiles() { QDir dir; dir.setPath(pdfout); QFileInfoList fil; fil = dir.entryInfoList(); foreach (QFileInfo fi, fil) { dir.remove(fi.absoluteFilePath()); } } yagf-0.9.5+repack1/src/core/000755 001750 001750 00000000000 13631520722 017145 5ustar00boradminboradmin000000 000000 yagf-0.9.5+repack1/src/core/qipgrayscaleimage.h000755 001750 001750 00000026037 13631520722 023020 0ustar00boradminboradmin000000 000000 /* This file is part of Libiprit by Andrei Borovsky . Libiprit is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Libiprit 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Libiprit. If not, see . */ #ifndef QIPGRAYSCALEIMAGE_H #define QIPGRAYSCALEIMAGE_H #include "qipblackandwhiteimage.h" #include "common.h" #include #include #include /*! \typedef qreal QIPHistogram[256]; Array of 256 double values for storing image intensity histograms. */ typedef qreal QIPHistogram[256]; class QFile; /*! \class QIPGrayscaleImage This class holds internal representations of grayscale images and allows you to perform different grayscale operations and binarize images. You pass the data to the instance of this class when you create the instance. The colored QImage is grayscaled using one of the GrayscaleConversion types. If you want obtain the grayscaled QImage use the toImage() method. The binarize() method produces black and white (binary) images. \sa QIPBlackAndWhiteImage */ class QIPGrayscaleImage { public: QIPGrayscaleImage(); /*! These codes specify which type of conversion from RGB to 256-level grayscale is to be used. MaxEntropyChannel and MinValue suite best if you canvert to grayscale for the further text extarction. */ enum GrayscaleConversion { RGBDevideByThree = 0, /*!< gray(i) = (r(i)+g(i)+b(i))/3 */ MinMaxValue, /*!< gray(i) = (min(r(i), g(i), b(i)) + max(r(i), g(i), b(i)))/2 */ MinValue, /*!< gray(i) = min(r(i), g(i), b(i)) */ MaxValue, /*!< gray(i) = max(r(i), g(i), b(i)) */ MaxEntropyChannel, /*!< gray(i) = ch(i) where ch is either r, g or b depending on which has the maximum entropy. */ MinEntropyChannel, /*!< gray(i) = ch(i) where ch is either r, g or b depending on which has the minimum entropy. */ FastConversion, NoConnversion }; Q_DECLARE_FLAGS(GrayscaleTransformations, GrayscaleConversion) /*! This is the constructor for an QIPGrayscaleImage object that you should use to start your image processing. \param image the QImage object holding an image to be processed. \param conversionMethod the type of conversion from RGB to grayscale. \sa GrayscaleConversion */ explicit QIPGrayscaleImage(const QImage &image, GrayscaleConversion conversionMethod = RGBDevideByThree); QIPGrayscaleImage( QIPBlackAndWhiteImage &image1, QIPBlackAndWhiteImage &image2); /*! Makes QIPGrayscaleImage from QImage. \sa toImage */ static QIPGrayscaleImage fromImage(const QImage &image, GrayscaleConversion conversionMethod = RGBDevideByThree); /*! Returns true if the instance contains no data. */ bool isNull() const; QIPGrayscaleImage(const QIPGrayscaleImage &I); QIPGrayscaleImage(const QString &ygfFileName); ~QIPGrayscaleImage(); /*! Converts grayscaled image to QImage object. */ QImage toImage() const; /*! These flags specify which type of binariztion to use when calling binarize() method. \sa binarize() */ enum BinarizationMethod { OtsuBinarization, /*!< Otsu global binarization */ OtsuMABinarization, NiblackBinarization, /*!< Niblack adaptive binarization */ SauvolaBinarization, /*!< Sauvola adaptive binarization */ MaxEntropyBinarization, /*!< Maximum entropy global binarization */ BradleyBinarization, /*!< Bradley adaptive binarization */ IterativeBinarization, /*!< Global iterative binarization */ BernsenBinarization, /*!< Bernsen adaptive binarization */ GatosBinarization /*!< Ga'tos adaptive binarization */ }; Q_DECLARE_FLAGS(BinarizationMethods, BinarizationMethod) /*! Calculates image intensity histogram for the rectangle specified by (x1,y1) (x2,y2). the reault is returned in result variable. If x1, y1, x2, y2 are set to zero the histogram for the who;e image is calculated. \sa equalize \sa entropy */ void histogram(QIPHistogram &result, quint32 x1=0, quint32 x2 = 0, quint32 y1 = 0, quint32 y2 = 0) const; /*! * Finds foreground/background threshold using Otsu method for the rectangle specified by (x1,y1) (x2,y2). the reault is returned in result variable. If x1, y1, x2, y2 are set to zero the result for the whole image is calculated. * Note that the values of x1, x2, y1, y2 should not exceed those of the original image (this is not checked). \sa simpleThreshold \sa maxEntropyThreshold */ quint8 otsuThreshold(quint32 x1 = 0, quint32 x2 = 0, quint32 y1 = 0, quint32 y2 = 0) const; /*! * Finds foreground/background threshold as a mean intencity value for the rectangle specified by (x1,y1) (x2,y2). the reault is returned in result variable. If x1, y1, x2, y2 are set to zero the result for the whole image is calculated. * Note that the values of x1, x2, y1, y2 should not exceed those of the original image (this is not checked). \sa otsuThreshold \sa maxEntropyThreshold */ quint8 simpleThreshold(quint32 x1 = 0, quint32 x2 = 0, quint32 y1 = 0, quint32 y2 = 0) const; /*! * Finds foreground/background threshold as a maximum entropy threshold for the rectangle specified by (x1,y1) (x2,y2). the reault is returned in result variable. If x1, y1, x2, y2 are set to zero the result for the whole image is calculated. * Note that the values of x1, x2, y1, y2 should not exceed those of the original image (this is not checked). \sa otsuThreshold \sa simpleThreshold */ quint8 maxEntropyThreshold(quint32 x1 = 0, quint32 x2 = 0, quint32 y1 = 0, quint32 y2 = 0) const; /*! * Finds mean of distribution for the rectangle specified by (x1,y1) (x2,y2). the reault is returned in result variable. If x1, y1, x2, y2 are set to zero the result for the whole image is calculated. * Note that the values of x1, x2, y1, y2 should not exceed those of the original image (this is not checked). \sa otsuThreshold \sa simpleThreshold */ qreal meanOfDistribution(quint32 x1 = 0, quint32 x2 = 0, quint32 y1 = 0, quint32 y2 = 0); /*! * Finds the entropy (-Sum(p(i)*Log(p(i)) for the rectangle specified by (x1,y1) (x2,y2). the reault is returned in result variable. If x1, y1, x2, y2 are set to zero the result for the whole image is calculated. * Note that the values of x1, x2, y1, y2 should not exceed those of the original image (this is not checked). */ qreal entropy(quint32 x1 = 0, quint32 x2 = 0, quint32 y1 = 0, quint32 y2 = 0); /*! * Equalizes the image histogram (spreads colors). * \sa histogram */ void equalize(); void equalize2(); qreal lpcEntropy(int x1 = 0, int x2 = 0, int y1 = 0, int y2 = 0); qreal variance(quint32 x1, quint32 x2, quint32 y1, quint32 y2); /*! * Returns the image's width. * \sa height */ int width() const; /*! * Returns the image's height. * \sa width */ int height() const; /*! * Returns the part of the original grayscale image bounded by the rectangle (x1,y1) (x2,y2) as a new instance of QIPGrayscaleImage. * Note that the boundaries should not exceed those of the original image (this is not checked). * \sa toImage */ QIPGrayscaleImage copy(int x1, int x2, int y1, int y2) const; void copyInternal2(IntRect &r, quint8 *s, quint8 *d) const; static quint8 * scanLinePtr(quint8 * ptr, int y, int wth) ; /*! Converts the grayscaled image to binary format using the specified method. */ QIPBlackAndWhiteImage binarize(BinarizationMethod method) const; /*! Sharpens the image. */ QIPGrayscaleImage sharpen() const; /*! Blurs the image. */ QIPGrayscaleImage blur() const; /*! Transforms the image so then edges appear as white lines on black. */ void isolateEdges(); /*! Inverts the intensity levels of the grayscale image. */ void invert(); void wienerFilter(); void blendImage(const QIPBlackAndWhiteImage &image); void darken(quint8 factor); void smoother(); void quantisize(); bool save(const QString &fileName, bool overwrite = false); static bool saveGrayscale(const QImage &image, const QString &fileName, bool overwrite = false); quint8 * scanLine(quint32 y) const; QIPGrayscaleImage scaleX2(); signals: public slots: protected: QIPGrayscaleImage(quint32 width, quint32 height); private: int w, h; QSharedPointer data; enum { SharpenFilter, BlurFilter, EdgesFilter } FilterType; private: QPoint loadHeader(QFile * file); void toGSRGDBBy3(const QImage &input, int top, int left, int bottom, int right); void toImageInternal(uchar *image, const IntRect &rect, int imageWidth) const; void toGrayScale(const QImage &input); inline quint8 pixel(quint32 x, quint32 y) const; inline void setPixel(quint32 x, quint32 y, quint8 value); inline quint8 nextInColumn(quint32 x, quint32 &y); inline quint8 prevInColumn(quint32 x, quint32 &y); qreal cdf(QIPHistogram hist, quint8 x); quint8 predictor(quint8 *x); QIPGrayscaleImage applyFilter(int type) const; void dilateImage(quint8 threshold = 0); QIPBlackAndWhiteImage niblackSauvolaBinarize(bool sauvola) const; QIPBlackAndWhiteImage otsuBinarize() const; QIPBlackAndWhiteImage otsuBinarizeMA() const; QIPBlackAndWhiteImage gatosBinarize() const; QIPBlackAndWhiteImage maxEntropyBinarize() const; QIPBlackAndWhiteImage bradleyBinarize() const; QIPBlackAndWhiteImage iterativeBinarize() const; QIPBlackAndWhiteImage bernsenBinarize() const; quint8 CalculateIterativeThreshold() const; void integralImage(uint w, uint h, uint * image) const; void toGrayscaleFast(const QImage &input); void toGrayscaleMinMax(const QImage &input); void toGrayscaleMinOrMax(const QImage &input, bool min); void toGrayscaleMinOrMaxInternal(const QImage &input, const IntRect &rect, bool min); void toGrayscaleMinMaxInternal(const QImage &input, const IntRect &rect); void toGrayScaleByEntropyChannel(const QImage &input, bool maxEntropy); void histogramInternal(qreal *result, const IntRect &r) const; void copyInternal(const IntRect &r, uint * image) const; void blendImageInternal(const IntRect &r, quint8 * p1, const quint8 * p2); }; Q_DECLARE_OPERATORS_FOR_FLAGS(QIPGrayscaleImage::BinarizationMethods) Q_DECLARE_OPERATORS_FOR_FLAGS(QIPGrayscaleImage::GrayscaleTransformations) #endif // QIPGRAYSCALEIMAGE_H yagf-0.9.5+repack1/src/core/subimagepp.cpp000755 001750 001750 00000010506 13631520722 022012 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #include "subimagepp.h" #include "settings.h" #include SubimagePP::SubimagePP(QImage &image) : img(image), ccbuilder(image) { ccbuilder.labelCCs(); quint32 hist[256] = {0}; quint8 c = ccbuilder.getMediumBWBG(hist); color = 0xFF << 24; color = color + (c << 16) + (c << 8) + c; for (int i = 0; i < 256; i++) { if (hist[i]) { darkestBG = hist[i]; break; } } /*for (int i = 0; i < 256; i++) { if (hist[i]) { for (int j = i + 16; j < 256; j++) hist[j] = c; break; } } for (int y = 0; y < img.height(); y ++) { quint32 * line = (quint32 *) img.scanLine(y); quint32 * lineCC = (quint32 *) ccbuilder.scanLine(y); for(int x = 0; x < img.width(); x++) { if (lineCC[x] == 0) { if (hist[line[x]&0x000000FF] == c) line[x] = color; } } }*/ } SubimagePP::~SubimagePP() { components.clear(); } void SubimagePP::fillComponents() { CCAnalysis an(&ccbuilder); an.analize(true); mgw = an.getMediumGlyphWidth(); mgh = an.getMediumGlyphHeight(); bars = an.getBars(); components = an.getAllComponents(false); } void SubimagePP::removeBars() { QSet barLabels; foreach (Rect r, bars) { barLabels.insert(r.label); } labelsToBackground(barLabels); } void SubimagePP::removeNoise() { int sf = Settings::instance()->getSkipWidth(); sf *= sf; QSet noiseLabels; foreach (Rect r, components) { if (r.dotCount < 3) noiseLabels.insert(r.label); if ((r.x1 == r.x2) || (r.y1 == r.y2) ) noiseLabels.insert(r.label); if (abs((r.x2-r.x1)*(r.y2-r.y1)) >= mgw*mgw*sf) noiseLabels.insert(r.label); if ((r.y1 == 0)||(r.y2 == img.height()-1)) if (r.y2 - r.y1 < mgh/2) noiseLabels.insert(r.label); if ((r.x1 == 0)||(r.x2 == img.width()-1)) { if (r.y2 - r.y1 < mgh/2) noiseLabels.insert(r.label); if (r.y2 - r.y1 > 2*mgh) noiseLabels.insert(r.label); } } labelsToBackground(noiseLabels); } void SubimagePP::stregthen() { quint8 c2 = (darkestBG&0x000000FF)/2; quint32 darker = 0xFF + (c2 << 16) +(c2 << 8) +c2; for (int y = 2; y < img.height()-2; y ++) { quint32 * linel2 = (quint32 *) img.scanLine(y-2); quint32 * lineg2 = (quint32 *) img.scanLine(y+2); quint32 * linel = (quint32 *) img.scanLine(y-1); quint32 * line = (quint32 *) img.scanLine(y); quint32 * lineg = (quint32 *) img.scanLine(y+1); quint32 * lineCC = (quint32 *) ccbuilder.scanLine(y); for(int x = 1; x < img.width()-1; x++) { if ((lineCC[x] != 0)&&(line[x] >= darkestBG)) { if ((linel[x] >= darkestBG)&&(lineg[x] >= darkestBG)) if ((linel2[x] >= darkestBG)&&(lineg2[x] >= darkestBG)) // if ((line[x-1] >= darkestBG)&&(line[x+1] >= darkestBG)) line[x] = darker; } } } } void SubimagePP::labelsToBackground(QSet &labels) { for (int y = 0; y < img.height(); y ++) { quint32 * line = (quint32 *) img.scanLine(y); quint32 * lineCC = (quint32 *) ccbuilder.scanLine(y); for(int x = 0; x < img.width(); x++) { if (labels.contains(lineCC[x])) { line[x] = color; //lineCC[x] = 0; } } } } yagf-0.9.5+repack1/src/core/tableanalizer.cpp000755 001750 001750 00000036377 13631520722 022511 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #include "tableanalizer.h" #include "qipblackandwhiteimage.h" #include "ccbuilder.h" #include "settings.h" #include "utils.h" #include "pixelwindow.h" #include enum State { Start, InLine, AfterLine }; const quint8 clBWWhite = 1; const quint8 clBWBlack = 0; TableAnalizer::TableAnalizer(QIPBlackAndWhiteImage *image) : img(image), blocks() { } QList TableAnalizer::splitTable(const QRect &bounds) { if (!findRect(bounds)) return blocks; // clearImage(); //img->toImage().save("0000A.png"); int cLabel = maxRect.label + 1; for (int y = maxRect.y1+1; y < maxRect.y2; y++) { quint8 * line = img->scanLine(y); quint8 * prevLine = img->scanLine(y - 1); for (int x = maxRect.x1+1; x < maxRect.x2-1; x++) { if (line[x] == clBWWhite) { if (line[x-1] > maxRect.label) { line[x] = line[x-1]; } else { if (prevLine[x] > maxRect.label) { line[x] = prevLine[x]; } else { if (prevLine[x+1] > maxRect.label) { line[x] = prevLine[x+1]; } else { if (prevLine[x-1] > maxRect.label) { line[x] = prevLine[x-1]; } else { cLabel++; line[x] = cLabel; } } } } updateComponents(x, y, line[x]); } else { } } } for (int i = blocks.count() - 1; i > -1; i--) if (blocks.at(i).label == maxRect.label) { blocks.removeAt(i); break; } clearGarbage(); img = 0; return sortBlocks(blocks); } QList TableAnalizer::splitTableForce(const QRect &bounds) { if (!findRect(bounds)) return blocks; blocks.clear(); addBars(bounds); clearGarbage(); return sortBlocks(blocks); } Rect TableAnalizer::getSkew(const QRect &bounds) { findRect(bounds); Rect result = {0,0,0,0}; quint8 * line = img->scanLine(maxRect.y1); for (int x = maxRect.x1; x <= maxRect.x2; x++) { if (line[x] == clBWBlack) { result.x1 = x; result.y1 = maxRect.y1; break; } } if (maxRect.x2 - result.x1 > 200) { for (int y = maxRect.y1; y <= maxRect.y2; y++) { quint8 * line = img->scanLine(y); if (line[maxRect.x2] == clBWBlack) { result.x2 = maxRect.x2; result.y2 = y; break; } } } else { result.x2 = result.x1; result.y2 = result.y1; for (int y = maxRect.y1; y <= maxRect.y2; y++) { quint8 * line = img->scanLine(y); if (line[maxRect.x1] == clBWBlack) { result.x1 = maxRect.x1; result.y1 = y; break; } } } float dx = result.x2 - result.x1; if (dx == 0) { result.y1 = result.y2; return result; } float dy = result.y2 - result.y1; float angle = abs(-atan(dy/dx)*360/6.283*100); if ((angle < 10)||(angle > 200)) { result.y1 = result.y2; return result; } return result; } bool TableAnalizer::findRect(const QRect &bounds) { // connectLine(bounds); CCBuilder ccbuilder(img->toImage()); ccbuilder.labelCCs(); for (int y = bounds.y(); y < bounds.y() + bounds.height(); y++) { quint32 * line = ccbuilder.scanLine(y); for (int x = bounds.x(); x < bounds.x()+ bounds.width(); x++) { if (line[x] > 0) updateComponents(x, y, line[x]); } } bool result = findMax(bounds); for (int y = bounds.y(); y < bounds.y() + bounds.height(); y++) { quint32 * line = ccbuilder.scanLine(y); quint8 * out = img->scanLine(y); for (int x = bounds.x(); x < bounds.x() + bounds.width(); x++) { if (line[x] == (quint32) maxRect.label) out[x] = clBWBlack; else out[x] = clBWWhite; } } // img->toImage().save("/home/parallels/A0.png"); return result; } void TableAnalizer::updateComponents(int x, int y, int label) { Rect r; for (int i = 0; i < blocks.count(); i++) { if (blocks.at(i).label == label) { r = blocks.at(i); if (x < r.x1) r.x1 = x; if (y < r.y1) r.y1 = y; if (x > r.x2) r.x2 = x; if (y > r.y2) r.y2 = y; r.dotCount++; blocks.removeAt(i); blocks.prepend(r); return; } } r.x1 = x; r.y1 = y; r.x2 =x; r.y2 =y; r.dotCount = 1; r.label = label; blocks.prepend(r); } bool TableAnalizer::findMax(const QRect &bounds) { /*quint8 colorMax = clBWWhite > clBWBlack ? clBWWhite : clBWBlack; for (int y = 0; y < img->height(); y++) { quint8 * line = img->scanLine(y); for (int x = 0; x < img->width(); x++) { if (line[x] > colorMax ) line[x] = clBWBlack; } }*/ if (blocks.count() == 0) return false; maxRect = blocks.at(0); for (int i = 1; i < blocks.count(); i++) { Rect r = blocks.at(i); if ((r.x2 - r.x1)*(r.y2 -r.y1) > (maxRect.x2- maxRect.x1)*(maxRect.y2 - maxRect.y1)) if (r.dotCount > 200) maxRect = r; } blocks.clear(); if ((maxRect.x2- maxRect.x1)*(maxRect.y2 - maxRect.y1) > bounds.width()*bounds.height()/4) return true; return false; } void TableAnalizer::clearImage() { for (quint32 y = 0; y < img->height(); y++) { quint8 * line = img->scanLine(y); for (quint32 x = 0; x < img->width(); x++) { quint8 color = line[x]; if (color != maxRect.label) line[x] = clBWWhite; else line[x] = clBWBlack; } } /* for (int y = 0; y < 200; y++) { quint8 * line = img->scanLine(y); for (int x = 0; x < 200; x++) { line[x] = clBWBlack; } }*/ img->toImage().save("/home/parallels/A0.png"); } bool __contains(Rect &r1, Rect &r2) { if ((r2.x1 >= r1.x1)&&(r2.y1 >= r1.y1)) if ((r2.x2 <= r1.x2)&&(r2.y2 <= r1.y2)) return true; return false; } bool __intersects(Rect &r1, Rect &r2) { if ((r2.x1 >= r1.x1)&&(r2.y1 >= r1.y1)) if ((r2.x1 <= r1.x2)&&(r2.y1 <= r1.y2)) return true; return false; } bool __intersects2(Rect &r1, Rect &r2) { if((r2.x1 < r1.x1-1)&&(r2.x2 > r1.x1+1)) if ((r2.y1 > r1.y1)&&(r2.y2 < r1.y2)) return true; if((r2.x1 < r1.x2-1)&&(r2.x2 > r1.x2+1)) if ((r2.y1 > r1.y1)&&(r2.y2 < r1.y2)) return true; /* if((r2.y1 < r1.y2-1)&&(r2.y2 > r1.y2+1)) if ((r2.x1 > r1.x1)&&(r2.x2 < r1.x2)) return true; if((r2.y1 < r1.y1-1)&&(r2.y2 > r1.y1+1)) if ((r2.x1 > r1.x1)&&(r2.x2 < r1.x2)) return true;*/ return false; } void TableAnalizer::clearGarbage() { for (int i = blocks.count()-1; i > -1; i--) { Rect r = blocks.at(i); if ((r.x2-r.x1)*(r.y2-r.y1)<150) blocks.removeAt(i); else { if ((r.x2-r.x1) < 15) blocks.removeAt(i); else { if ((r.y2-r.y1) < 15) blocks.removeAt(i); } } } int c = blocks.count(); int i = 0; while(i < c) { Rect r = blocks.at(i); for (int j = i+1; j < c; j++) { Rect r1 = blocks.at(j); if (__contains(r, r1)) { blocks.removeAt(j); c--; i--; break; } if (__contains(r1, r)) { blocks.removeAt(i); c--; i--; break; } if (__intersects(r, r1)){ blocks.removeAt(i); c--; i--; break; } if (__intersects(r1, r)){ blocks.removeAt(i); c--; i--; break; } /* if (__intersects2(r1, r)) { blocks.removeAt(i); c--; i--; break; } if (__intersects2(r, r1)) { blocks.removeAt(i); c--; i--; break; }*/ } i++; } } void TableAnalizer::drawHorzLine(int y, int minx, int maxx) { quint8 * line = img->scanLine(y); for (int x = minx; x < maxx; x++) line[x] = clBWBlack; } void TableAnalizer::drawVertLine(int x, int miny, int maxy) { for (int y = miny; y < maxy; y++) { quint8 * line = img->scanLine(y); line[x] = clBWBlack; } } const int stride = 100; const int thr = 90; void TableAnalizer::addBars(const QRect &bounds) { for (int y = maxRect.y1; y < maxRect.y2; y++) { quint8 * line = img->scanLine(y); for (int x = maxRect.x1 + 1; x < maxRect.x2 -1; x++) if ((line[x-1] == clBWBlack)&&(line[x+1] == clBWBlack)) line[x] = clBWBlack; } for (int y = maxRect.y1+1; y < maxRect.y1-1; y++) { quint8 * l1 = img->scanLine(y-1); quint8 * l2 = img->scanLine(y); quint8 * l3 = img->scanLine(y+1); for(int x = maxRect.x1; x < maxRect.x2; x++) { if ((l1[x]==clBWBlack)&&l3[x]==clBWBlack) l2[x] = clBWBlack; } } drawHorzLine(maxRect.y1+1, bounds.x(), bounds.x() + bounds.width()); drawHorzLine(maxRect.y2-1, bounds.x(), bounds.x() + bounds.width()); drawVertLine(maxRect.x1+1, bounds.y(), bounds.y() + bounds.height()); drawVertLine(maxRect.x2-1, bounds.y(), bounds.y() + bounds.height()); int prevHLine = maxRect.y1 + 1; int currentHLine = maxRect.y2-1; for (int y = maxRect.y1+5; y < maxRect.y2-5; y++) { quint8 * pprevLine = img->scanLine(y-2); quint8 * prevLine = img->scanLine(y-1); quint8 * nextLine = img->scanLine(y+1); quint8 * nnextLine = img->scanLine(y+2); quint8 * line = img->scanLine(y); int count = 0; for (int x = bounds.x(); x < bounds.x() + bounds.width(); x++) { if (count >= 150) { drawHorzLine(y, bounds.x(), bounds.x() + bounds.width()); Rect r; r.x1 = maxRect.x1; r.x2 = maxRect.x2; r.y1 = prevHLine; r.y2 = y; blocks.append(r); prevHLine = y+2; y+=8; break; } if ((line[x] == clBWBlack)||(prevLine[x] == clBWBlack)||(pprevLine[x] == clBWBlack)||(nextLine[x] == clBWBlack)||(nnextLine[x] == clBWBlack)) count++; else { count = 0; } } } Rect r; r.x1 = maxRect.x1; r.x2 = maxRect.x2; r.y1 = prevHLine; r.y2 = currentHLine; blocks.append(r); clearGarbage(); for (int x = maxRect.x1+3; x < maxRect.x2-3; x++) { int count = 0; for (int y = bounds.y(); y < bounds.y() + bounds.height(); y++) { quint8 * line = img->scanLine(y); if (count >= 150) { drawVertLine(x, bounds.y(), bounds.y() + bounds.height()); int bc = blocks.count(); for (int i = 0; i < bc;) { if ((x > blocks.at(i).x1)&&(x < blocks.at(i).x2)) { Rect r = blocks.at(i); Rect r1 = r; Rect r2 = r; r1.x2 = x-1; r2.x1 = x+1; blocks.removeAt(i); blocks.append(r1); blocks.append(r2); bc--; } else i++; } x +=8; break; } if (line[x] == clBWBlack) count++; else { if ((line[x-1] != clBWBlack)&&(line[x+1] != clBWBlack)) count = 0; else count++; } } } } QList TableAnalizer::sortBlocks(const QList &blocks) { if (blocks.count() < 3) return blocks; QList tmp = blocks; QList out; while(tmp.count()>1) { int ymid; ymid = (tmp.at(0).y1 + tmp.at(1).y2)/2; out.append(tmp.at(0)); tmp.removeFirst(); for (int i = tmp.count()-1; i >= 0; i--) { if (_contains(tmp.at(i).y1, tmp.at(i).y2, ymid)) { bool appeneded = false; for (int j = 0; j < out.count(); j++) { if (tmp.at(i).y2 <= out.at(j).y1) { appeneded = true; out.insert(j, tmp.at(i)); tmp.removeAt(i); break; } } if (!appeneded) { out.append(tmp.at(i)); tmp.removeAt(i); } } } } return out; } Rect TableAnalizer::getSkew2(const QRect &bounds) { int xb = -1; int yb; Rect er = {0,0,0,0}; quint8 * line = img->scanLine(maxRect.y1); for (int x = maxRect.x1; x <= maxRect.x2; x++) { if (line[x] == clBWBlack) { xb = x; yb = maxRect.y1; break; } } if (xb == -1) return er; PixelWindow * pw = new PixelWindow(img, xb, yb+5, 160, 11); int yt = 0; while((pw->pixel(xb, yb - yt)&&(yt <= 5)) == clBWBlack) { yt++; } yt--; if (pw->pixel(xb, yb + yt) != clBWBlack) return er; pw->move(xb, yb - yt + 5); int vcounter = 0; int xe = xb + 1; while ((abs(vcounter) < 5)&&(xe-xb<200)) { if (pw->pixel(xe, yt) == clBWBlack) { if (pw->pixel(xe, yt-1)==clBWBlack) { yt--; vcounter--; } } else { if (pw->pixel(xe, yt) == clBWWhite) { yt++; vcounter++; } else break; } xe++; } delete pw; Rect result; result.x1 = xb; result.x2 = xe; result.y1 = 0; result.y2 = vcounter; return result; } yagf-0.9.5+repack1/src/core/rotationcropper.h000755 001750 001750 00000002666 13631520722 022565 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2012 Andrei Borovsky 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 . */ #ifndef ROTATIONCROPPER_H #define ROTATIONCROPPER_H #include #include #include "ycommon.h" class QImage; class RotationCropper { public: RotationCropper(QImage * image, QRgb color); ~RotationCropper(); QRect crop(); private: void recolor(); bool checkHorzLine(int y); bool checkVertLine(int x); private: QImage * image; QRgb whitePixel; QRgb replaceColor; int darksCount; int lightsCount; int minval; int maxval; //int clAltCount; int whitesCount; int whitetr; int whiteAlt; qreal clBrighttoWidth; qreal clBrighttoWidthtr; int clWhiteCount; int y1, y2, x1, x2; }; #endif yagf-0.9.5+repack1/src/core/qipgrayscaleimage.cpp000755 001750 001750 00000120356 13631520722 023352 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #include "settings.h" #include "qipgrayscaleimage.h" #include "binarize.h" #include #include "common.h" #include #include #include #include #define IPRIT_MULTITHREADING const QString fheader = QString::fromUtf8("YGF1"); static const int kSharpen [3][3]= {{0,-1,0}, {-1,5,-1}, {0,-1,0}}; static const int wkSharpen = 1; static const int kBlur [3][3]= {{1,1,1}, {1,1,1}, {1,1,1}}; static const int wkBlur = 5; static const int kEdges [3][3]= {{-1,-1,-1}, {-1,8,-1}, {-1,-1,-1}}; static const int wkEdges = 1; QIPGrayscaleImage::QIPGrayscaleImage(const QImage &image, GrayscaleConversion conversionMethod) : data(new quint8[image.width()*image.height()], deallocator) { h = image.height(); w = image.width(); //data = QSharedPointer(); switch (conversionMethod) { case RGBDevideByThree: toGrayScale(image); break; case MinMaxValue: toGrayscaleMinMax(image); break; case MinValue: toGrayscaleMinOrMax(image, true); break; case MaxValue: toGrayscaleMinOrMax(image, false); break; case MaxEntropyChannel: toGrayScaleByEntropyChannel(image, true); break; case MinEntropyChannel: toGrayScaleByEntropyChannel(image, false); break; case FastConversion: toGrayscaleFast(image); default: toGrayScale(image); break; } } QIPGrayscaleImage::QIPGrayscaleImage(QIPBlackAndWhiteImage &image1, QIPBlackAndWhiteImage &image2) : data(new quint8[image1.width()*image1.height()], deallocator) { quint8 * d1 = image1.data.data(); quint8 * d2 = image1.data.data(); quint8 * d = data.data(); w = image1.width(); h = image1.height(); for (int i = 0; i < w*h; i++) { quint8 s = d1[i] + d2[i]; switch(s) { case 0: d[i] = 0; break; case 1: d[i] = 128; break; case 2: d[i] = 255; break; default: break; } } } QIPGrayscaleImage QIPGrayscaleImage::fromImage(const QImage &image, QIPGrayscaleImage::GrayscaleConversion conversionMethod) { return QIPGrayscaleImage(image, conversionMethod); } bool QIPGrayscaleImage::isNull() const { return w*h == 0; } QIPGrayscaleImage::QIPGrayscaleImage(const QIPGrayscaleImage &I) : data(I.data.data(), deallocator) { w = I.w; h = I.h; } QIPGrayscaleImage::QIPGrayscaleImage(const QString &ygfFileName) { w = 0; h = 0; QFile f(ygfFileName); if (!f.open(QIODevice::ReadOnly)) return; QPoint p = loadHeader(&f); w = p.x(); h = p.y(); if (w*h == 0) { f.close(); return; } data = QSharedPointer(new quint8[w*h], deallocator); f.read((char*)data.data(), w*h); f.flush(); f.close(); } QIPGrayscaleImage::~QIPGrayscaleImage() { data.clear(); } QImage QIPGrayscaleImage::toImage() const { QImage image(w, h, QImage::Format_ARGB32); #ifndef IPRIT_MULTITHREADING IntRect r = {0,0,image.width(),image.height()}; toImageInternal(image.scanLine(0),r, image.width()); #endif #ifdef IPRIT_MULTITHREADING IntRect r1 = {0,0,image.width(),image.height()/2}; IntRect r2 = {0,image.height()/2,image.width(),image.height()}; QFuture future1 = QtConcurrent::run(this, &QIPGrayscaleImage::toImageInternal,image.scanLine(0),r1, image.width()); QFuture future2 = QtConcurrent::run(this, &QIPGrayscaleImage::toImageInternal,image.scanLine(0),r2, image.width()); future1.waitForFinished(); future2.waitForFinished(); #endif return image; } void QIPGrayscaleImage::histogram(QIPHistogram &result, quint32 x1, quint32 x2, quint32 y1, quint32 y2) const { if (x2 == 0) x2 = w; if (y2 == 0) y2 = h; #ifndef IPRIT_MULTITHREADING IntRect r = {x1,y1,x2,y2}; histogramInternal(&result[0], r); #endif #ifdef IPRIT_MULTITHREADING IntRect r1 = {x1,y1,x2,(y1+y2)/2}; IntRect r2 = {x1,(y1+y2)/2,x2,y2}; qreal h1[256] = {0.0}; qreal h2[256] = {0.0}; QFuture future1 = QtConcurrent::run(this, &QIPGrayscaleImage::histogramInternal,&h1[0],r1); QFuture future2 = QtConcurrent::run(this, &QIPGrayscaleImage::histogramInternal,&h2[0],r2); future1.waitForFinished(); future2.waitForFinished(); for (int i = 0; i < 256; i++) result[i] = (h1[i] + h2[i])/2.; #endif } void QIPGrayscaleImage::histogramInternal(qreal * result, const IntRect &r) const { uint ht[256] = {0}; for (int y = r.y1; y < r.y2; y++) { quint8 * lineIn = scanLine(y); for(int x = r.x1; x < r.x2; x++) { ht[lineIn[x]]++; } } int size = (r.x2-r.x1)*(r.y2-r.y1); for (int i = 0; i < 256; i++) { result[i] = ht[i]; result[i]/=size; } } void QIPGrayscaleImage::copyInternal(const IntRect &r, uint *image) const { for (int y = r.y1; y < r.y2; y++) { quint8 * line = scanLine(y); uint * lineout = &image[y*w]; for (int x = r.x1; x < r.x2; x++) lineout[x] = line[x]; } } void QIPGrayscaleImage::darken(quint8 factor) { uint dataSize = w*h; quint8 * d = (quint8 *)data.data(); for (uint i = 0; i < dataSize; i++) { d[i] = d[i] >> factor; } } void QIPGrayscaleImage::smoother() { const int msn = 64; //increasing this increases smoothness const int thr = 90; quint8 steps[256] = {0}; uint dataSize = w*h; quint8 * d = (quint8 *)data.data(); for (uint i = 1; i < dataSize; i++) { quint8 diff = abs(d[i-1] -d[i]); steps[diff]++; } int counter = 0; quint8 min_diff = 255; for (int i = 255; (i >= 0) && (counter < msn); i--) { if (steps[i] != 0) { min_diff = i; counter++; } } if (min_diff < thr) min_diff = thr; for (uint i = 1; i < dataSize; i++) { quint8 diff = abs(d[i-1] -d[i]); if (diff >= min_diff) { if (d[i] > d[i-1]) d[i] = d[i] - diff/2; else d[i-1] = d[i-1] - diff/2; } } } void QIPGrayscaleImage::quantisize() { uint dataSize = w*h; quint8 * d = (quint8 *)data.data(); for (uint i = 0; i < dataSize; i++) { d[i] = d[i] >> 2; } for (uint i = 0; i < dataSize; i++) { d[i] = d[i] << 2; } } bool QIPGrayscaleImage::save(const QString &fileName, bool overwrite) { quint16 hx = h; quint16 wx = w; QFile f(fileName); if ((f.exists())&&(!overwrite)) return false; bool res = f.open(QIODevice::WriteOnly); if (!res) return false; f.write(fheader.toAscii(), 4); f.write((char*) &hx, 2); f.write((char*) &wx, 2); f.write((char*)data.data(), wx*hx); f.flush(); f.close(); return true; } bool QIPGrayscaleImage::saveGrayscale(const QImage &image, const QString &fileName, bool overwrite) { quint16 hx = image.height(); quint16 wx = image.width(); QFile f(fileName); if ((f.exists())&&(!overwrite)) return false; if(!f.open(QIODevice::WriteOnly)) return false; f.write(fheader.toAscii(), 4); f.write((char*) &hx, 2); f.write((char*) &wx, 2); quint8 * d = new quint8[wx]; for (int y = 0; y < hx; y++) { quint8 * line = (quint8 *) image.scanLine(y); for (int x = 0; x < wx; x++) d[x] = line[x*4]; quint64 rl = f.write((char*)d,wx); while (rl != 0) rl = f.write((char*)&d[rl],wx-rl); } delete[] d; f.flush(); f.close(); return true; } int QIPGrayscaleImage::width() const { return w; } int QIPGrayscaleImage::height() const { return h; } QIPGrayscaleImage QIPGrayscaleImage::copy(int x1, int x2, int y1, int y2) const { if (y2 > h) y2 = h; if (x2 > w) x2 = w; if (x1 > x2) x1 = 0; if (y1 > y2) y1 = 0; QIPGrayscaleImage result(x2 - x1, y2 - y1); quint8 *s = data.data(); quint8 * d= result.data.data(); IntRect r1; r1.x1 = x1; r1.x2 = x2; r1.y1 = y1; r1.y2 = (y2 - y1)/2; IntRect r2; r2.x1 = x1; r2.x2 = x2; r2.y2 = y2; r1.y1 = (y2 - y1)/2; #ifndef IPRIT_MULTITHREADING IntRect r; r.x1 = 0; r.y1 = 0; r.x2 = width(); r.y2 = height(); quint8 * d1 = data.data(); quint8 * d2 = image.data.data(); blendImageInternal(r, d1, d2); #endif #ifdef IPRIT_MULTITHREADING QFuture future1 = QtConcurrent::run(this, &QIPGrayscaleImage::copyInternal2, r1, s, d); QFuture future2 = QtConcurrent::run(this, &QIPGrayscaleImage::copyInternal2, r2, s, d); future1.waitForFinished(); future2.waitForFinished(); #endif return result; } void QIPGrayscaleImage::copyInternal2(IntRect &r, quint8 *s, quint8 *d) const { for (int y = r.y1; y < r.y2; y ++) { quint8 * src = &scanLinePtr(s, y, w)[r.x1]; quint8 * dst = scanLinePtr(d, y-r.y1, r.x2 - r.x1); memcpy(dst, src, r.x2 - r.x1); } } QIPBlackAndWhiteImage QIPGrayscaleImage::binarize(QIPGrayscaleImage::BinarizationMethod method) const { switch (method) { case OtsuBinarization : return otsuBinarize(); break; case OtsuMABinarization: return otsuBinarizeMA(); break; case NiblackBinarization : return niblackSauvolaBinarize(false); break; case SauvolaBinarization : return niblackSauvolaBinarize(true); break; case MaxEntropyBinarization : return maxEntropyBinarize(); break; case BradleyBinarization : return bradleyBinarize(); break; case IterativeBinarization: return iterativeBinarize(); break; case BernsenBinarization: return bernsenBinarize(); break; case GatosBinarization: return gatosBinarize(); break; default: break; } return QIPBlackAndWhiteImage(0,0); } QIPGrayscaleImage QIPGrayscaleImage::sharpen() const { return applyFilter(SharpenFilter); } QIPGrayscaleImage QIPGrayscaleImage::blur() const { return applyFilter(BlurFilter); } void QIPGrayscaleImage::isolateEdges() { applyFilter(EdgesFilter); } void QIPGrayscaleImage::invert() { for (int y = 0; y < h; y++) { quint8 * line = scanLine(y); for (int x = 0; x < w; x++) line[x] = 255 - line[x]; } } void QIPGrayscaleImage::wienerFilter() { qr_wiener_filter(data.data(),w,h); } void QIPGrayscaleImage::blendImage(const QIPBlackAndWhiteImage &image) { #ifndef IPRIT_MULTITHREADING IntRect r; r.x1 = 0; r.y1 = 0; r.x2 = width(); r.y2 = height(); quint8 * d1 = data.data(); quint8 * d2 = image.data.data(); blendImageInternal(r, d1, d2); #endif #ifdef IPRIT_MULTITHREADING quint8 * d1 = data.data(); quint8 * d2 = image.data.data(); IntRect r1; r1.x1 = 0; r1.y1 = 0; r1.x2 = width(); r1.y2 = height()/2; QFuture future1 = QtConcurrent::run(this, &QIPGrayscaleImage::blendImageInternal, r1, d1, d2); IntRect r2; r2.x1 = 0; r2.y1 = height()/2; r2.x2 = width(); r2.y2 = height(); QFuture future2 = QtConcurrent::run(this, &QIPGrayscaleImage::blendImageInternal, r2, d1, d2); future1.waitForFinished(); future2.waitForFinished(); #endif } void QIPGrayscaleImage::blendImageInternal(const IntRect &r, quint8 * p1, const quint8 * p2) { int w = r.x2 - r.x1; int h = r.y2 - r.y1; if (w*h < 32) return; if (h < 4) return; const quint8 * bw = p2 + r.y1*w; quint8 * gs = p1 + r.y1*w; for (int i = 0; i < w; i++) gs[i] = bw[i] == 1 ? qMin(gs[i] + 32, 255) : gs[i]*3/4; for (int i = 0; i < w*h; i+=w) { gs[i] = bw[i] == 1 ? qMin(gs[i] + 32, 255) : gs[i]*3/4; gs[i+w-1] = bw[i+w-1] == 1 ? qMin(gs[i+w-1] + 32, 255) : gs[i+w-1]*3/4; } for (int i = w*(h-1); i < w*h; i++) gs[i] = bw[i] == 1 ? qMin(gs[i] + 32, 255) : gs[i]*3/4; int up =Settings::instance()->getForegroundBrightenFactor(); uint d1 = 3; uint d2 = 4; int ra = 0; int c = 0; for (int i = w+1; i < w*(h-1)-1; i++) { if (bw[i] == 1) { ra += gs[i]; c++; if ((bw[i-1] != 0)||(bw[i+1] != 0)) if ((bw[i-2] != 0)||(bw[i+1] != 0)) if ((bw[i-w] != 0)||(bw[i+w] != 0)) if ((bw[i-w-1] != 0)||(bw[i+w+1] != 0)) if ((bw[i-w+1] != 0)||(bw[i+w-1] != 0)) gs[i] = qMin(gs[i] + up, 255); } else gs[i] = gs[i]*d1/d2; } up = Settings::instance()->getGlobalBrightenFactor(); if (ra/c < Settings::instance()->getDarkBackgroundThreshold()) for (int i = w+1; i < w*(h-1)-1; i++) gs[i] = qMin(gs[i]+up, 255); up = Settings::instance()->getGlobalDarkenFactor(); int thr = Settings::instance()->getGlobalDarkenThreshold(); for (int i = w+1; i < w*(h-1)-1; i++) if ((gs[i] < thr)&&(gs[i]>up)) gs[i]-=up; } QIPGrayscaleImage::QIPGrayscaleImage(quint32 width, quint32 height) : data(new quint8[width*height]) { w = width; h = height; } QPoint QIPGrayscaleImage::loadHeader(QFile *file) { QPoint res(0,0); char header[5] = {0}; file->read(header, 4); if (QString::fromAscii(header) != fheader) return res; quint16 wx, hx; file->read((char*) &hx, 2); file->read((char*) &wx, 2); res.setX(wx); res.setY(hx); return res; } void QIPGrayscaleImage::toGSRGDBBy3(const QImage &input, int top, int left, int bottom, int right) { uchar lut[256*3] = {0}; int lutcount = 0; for (int i = 0; i < 256; i++) { for(int j = 0; j < 3; j++) { lut[lutcount] = i; lutcount++; } } for (int y = top; y < bottom; y++) { QRgb * lineIn = (QRgb *)input.scanLine(y); quint8 * lineOut = scanLine(y); for(int x = left; x < right; x++) { QRgb cur = lineIn[x]; uint grayLevel = (qRed(cur) + qGreen(cur) + qBlue(cur)); lineOut[x] = lut[grayLevel]; } } } void QIPGrayscaleImage::toImageInternal(uchar * image, const IntRect &rect, int imageWidth) const { quint32 lut[256]; for (uint i = 0; i < 256; i++) { lut[i] = 0xFF000000 + (i << 16) + (i << 8) + i; } int im4 =4*imageWidth; for (int y = rect.y1; y < rect.y2; y++) { quint8 * line = scanLine(y); QRgb * lineOut = (QRgb *)&(image[im4*y]); for (int x = rect.x1; x < rect.x2; x++ ) { lineOut[x] = lut[line[x]]; } } } void QIPGrayscaleImage::toGrayScale(const QImage &input) { #ifndef IPRIT_MULTITHREADING toGSRGDBBy3(input,0,0,input.height(),input.width()); #endif #ifdef IPRIT_MULTITHREADING QFuture future1 = QtConcurrent::run(this, &QIPGrayscaleImage::toGSRGDBBy3,input,0,0,input.height()/2,input.width()); QFuture future2 = QtConcurrent::run(this, &QIPGrayscaleImage::toGSRGDBBy3,input,input.height()/2,0,input.height(),input.width()); future1.waitForFinished(); future2.waitForFinished(); #endif } quint8 QIPGrayscaleImage::otsuThreshold(quint32 x1, quint32 x2, quint32 y1, quint32 y2) const { qreal hist[256]; histogram(hist, x1, x2, y1, y2); qreal ihist[256]; qreal ut = 0; for (int i = 0; i < 256; i++) ut+= (ihist[i] = i*hist[i]); int maxK=0; int maxSigmaK=0; qreal wk = 0; qreal uk = 0; for (int k = 0; k < 256; ++k) { if (hist[k] == 0) continue; wk += hist[k]; uk += ihist[k]; qreal sigmaK = 0; if ((wk !=0) && (wk!=1)) sigmaK = ((ut*wk - uk)*(ut*wk - uk))/(wk*(1-wk)); if (sigmaK > maxSigmaK) { maxK = k; maxSigmaK = sigmaK; } } return maxK; } quint8 QIPGrayscaleImage::simpleThreshold(quint32 x1, quint32 x2, quint32 y1, quint32 y2) const { if (x2 == 0) x2 = w; if (y2 == 0) y2 = h; quint32 accum = 0; for (uint y = y1; y < y2; y ++) { quint8 * lineIn = scanLine(y); for(quint32 x = x1; x < x2; x++) accum += lineIn[x]; } return accum/((x2-x1)*(y2-y1)); } quint8 QIPGrayscaleImage::maxEntropyThreshold(quint32 x1, quint32 x2, quint32 y1, quint32 y2) const { if (x2 == 0) x2 = w; if (y2 == 0) y2 = h; qreal hist[256]; histogram(hist, x1, x2, y1, y2); qreal cdv[256]; cdv[0] = hist[0]; for (uint i = 1; i < 256; i++) cdv[i] = cdv[i - 1] + hist[i]; qreal epsilon = .1e-256; qreal hBlack[256] = {0.0}; qreal hWhite[256] = {0.0}; for (int t = 0; t < 256; t++) { if (cdv[t] > epsilon) { qreal hhB = 0; for (int i = 0; i <= t; i++) { if (hist[i] > epsilon) hhB -= hist[i] / cdv[t] * log(hist[i] / cdv[t]); } hBlack[t] = hhB; } else { hBlack[t] = 0; } double cdi = 1 - cdv[t]; if (cdi > epsilon) { qreal hhW = 0; for (int i = t + 1; i < 256; ++i) { if (hist[i] > epsilon) hhW -= hist[i] / cdi * log(hist[i] / cdi); } hWhite[t] = hhW; } else { hWhite[t] = 0; } } qreal maxIndex = hBlack[0] + hWhite[0]; quint8 maxT = 0; for (uint t = 1; t < 256; t++) { double j = hBlack[t] + hWhite[t]; if (j > maxIndex) { maxIndex = j; maxT = t; } } return maxT; } qreal QIPGrayscaleImage::meanOfDistribution(quint32 x1, quint32 x2, quint32 y1, quint32 y2) { qreal hist[256]; histogram(hist, x1, x2, y1, y2); qreal result = 0; for (uint i = 0; i < 256; i++) result += hist[i]*i; return result; } qreal QIPGrayscaleImage::entropy(quint32 x1, quint32 x2, quint32 y1, quint32 y2) { qreal hist[256]; histogram(hist, x1, x2, y1, y2); qreal result = 0; for (uint i = 0; i < 256; i++) result += hist[i]*log(hist[i]); return -result; } void QIPGrayscaleImage::equalize() { qreal hist[256]; histogram(hist); quint8 tt[256]; //tt[0] = 0; for (uint i = 0; i < 256; i++) { tt[i] = cdf(hist, i)*255; } for (int y = 0; y < h; y++) { quint8 * lineOut = scanLine(y); for(int x = 0; x < w; x++) lineOut[x] = tt[lineOut[x]]; } } void QIPGrayscaleImage::equalize2() { qreal hist[256]; histogram(hist); quint8 tt[256]; //tt[0] = 0; for (uint i = 0; i < 256; i++) { tt[i] = cdf(hist, i)*255; } for (int y = 0; y < h; y++) { quint8 * lineOut = scanLine(y); for(int x = 0; x < w; x++) lineOut[x] = tt[lineOut[x]] >> 1; for(int x = 0; x < w; x++) lineOut[x] = tt[lineOut[x]] << 1; } } qreal QIPGrayscaleImage::lpcEntropy(int x1, int x2, int y1, int y2) { uint ihist[256] = {0}; if (x2 == 0) x2 = w; if (y2 == 0) y2 = h; for (int y = y1; y < y2; y++) { quint8 * lineOut = scanLine(y); ihist[lineOut[x1]]++; ihist[lineOut[x1+1]]++; ihist[lineOut[x1+2]]++; quint8 cl = lineOut[x1+2]; for(int x = x1 + 3; x < x2; x++) { quint8 cp = predictor(&lineOut[x]); if ((cp-lineOut[x])*(cp-lineOut[x]) < 2) { ihist[cl]++; } else { cl = lineOut[x]; ihist[cl]++; } } } qreal hist[256] = {0.0}; qreal k = 1/((x2-x1)*(y2-y1)); qreal sum = 0; for (uint i =0; i < 256; i++) { hist[i] = ihist[i]*k*log(ihist[i]*k); sum += hist[i]; } return -sum; } qreal QIPGrayscaleImage::variance(quint32 x1, quint32 x2, quint32 y1, quint32 y2) { qreal hist[256]; histogram(hist, x1, x2, y1, y2); qreal max = 0; quint8 imax; for (int i = 0; i < 256; i++) if (hist[i] > max) { max = hist[i]; imax = i; } qreal sum = 0; for (int i = 0; i < 256; i++) sum += abs(i-imax)*hist[i]; return sum; } quint8 *QIPGrayscaleImage::scanLine(quint32 y) const { return &(data.data()[y*w]); } inline quint8 AVERAGE(quint8 a, quint8 b) { return ((a + b) >> 1); } QIPGrayscaleImage QIPGrayscaleImage::scaleX2() { QIPGrayscaleImage res(width()*2, height()*2); quint8 * source = data.data(); quint8 * target = res.data.data(); int srcWidth = width()*height(); int targetWidth = srcWidth*4; int numPixels = srcWidth; int mid = srcWidth; int e = 0; quint8 p; numPixels--; while (numPixels-- > 0) { p = *source; if (e >= mid) p = AVERAGE(p, *(source+1)); *target++ = p; e += srcWidth; if (e >= targetWidth) { e -= targetWidth; source++; } } *target = *source; return res; } quint8 QIPGrayscaleImage::pixel(quint32 x, quint32 y) const { return data.data()[x + y*w]; } void QIPGrayscaleImage::setPixel(quint32 x, quint32 y, quint8 value) { data.data()[x+y*w] = value; } quint8 QIPGrayscaleImage::nextInColumn(quint32 x, quint32 &y) { y++; return data.data()[x + y*w]; } quint8 QIPGrayscaleImage::prevInColumn(quint32 x, quint32 &y) { y--; return data.data()[x + y*w]; } qreal QIPGrayscaleImage::cdf(QIPHistogram hist, quint8 x) { qreal result = 0; for (int i = 0; i < x+1; i++) result +=hist[i]; return result; } quint8 QIPGrayscaleImage::predictor(quint8 * x) { quint8 xp[3] = {*(x-3), *(x-2), *(x-1) }; int d1 = xp[1] - xp[0]; int d2 = xp[2] - xp[1]; int dp = 2*d2 - d1; int xd = *x + dp; xd = qBound(0, xd, 255); return (quint8) xd; } QIPGrayscaleImage QIPGrayscaleImage::applyFilter(int type) const { QIPGrayscaleImage result(w, h); int kernel [3][3]; int wk; int a; if (type == SharpenFilter) { memcpy(kernel, kSharpen, 9*sizeof(int)); wk = wkSharpen; a = 0; } if (type == BlurFilter) { memcpy(kernel, kBlur, 9*sizeof(int)); wk = wkBlur; a = 0; } if (type == EdgesFilter) { memcpy(kernel, kEdges, 9*sizeof(int)); wk = wkEdges; a = 128; } for(int x= 1; x < w - 1; x++) { for(int y= 1; y < h - 1; y++) { int c = 0; for(int i = -1; i <= 1; i++) { for(int j = -1; j <= 1; j++) c += pixel(x+i, y+j)*kernel[i+1][j+1]; c = qBound(0, c/wk + a, 255); result.setPixel(x, y, c); } } } if (type==SharpenFilter) result.invert(); return result; } void QIPGrayscaleImage::dilateImage(quint8 threshold) { } QIPBlackAndWhiteImage QIPGrayscaleImage::niblackSauvolaBinarize(bool sauvola) const { QIPBlackAndWhiteImage result(w, h); const uint WindowSize = 15; const uint halfWindowSize = WindowSize/2; const qreal weight = 0.2; int xMin = halfWindowSize; int yMin = halfWindowSize; int xMax = w - 1 - halfWindowSize; int yMax = h - 1 - halfWindowSize; quint8 * output = result.data.data(); qreal sumPixelsWindow = 0; qreal sum2PixelsWindow = 0; qreal localMean = 0; qreal localVar = 0; qreal localStd = 0; qreal localValue = 0; qreal mainSumPixelWindow = 0; qreal mainSum2PixelWindow = 0; qreal *sumCols = new qreal[w]; //= {0.0}; qreal *sumSqCols = new qreal[w];// = {0.0}; memset(sumCols, 0, w*sizeof(qreal)); memset(sumSqCols, 0, w*sizeof(qreal)); for (uint i = 0; i < WindowSize; i++){ for (int x = 0; x < w; x++){ sumCols[x] += pixel(x, i); sumSqCols[x] += pixel(x, i)*pixel(x, i); } } for(uint j = 0; j < WindowSize; j++){ mainSumPixelWindow += sumCols[j]; mainSum2PixelWindow += sumSqCols[j]; } for(int y = yMin; y <= yMax; y++) { for(int j = xMin; j <= xMax; j++) { if(y == xMin){ if(j == yMin) { sumPixelsWindow = mainSumPixelWindow; sum2PixelsWindow = mainSum2PixelWindow; }else{ sumPixelsWindow += (sumCols[j+halfWindowSize] - sumCols[j-halfWindowSize-1]); sum2PixelsWindow += (sumSqCols[j+halfWindowSize] - sumSqCols[j-halfWindowSize-1]); } }else{ if(j == yMin) { for (int x = 0; x < w; x++) { sumCols[x] += (pixel(x, y+halfWindowSize) - pixel(x, y-halfWindowSize-1)); sumSqCols[x] += (pixel (x, y+halfWindowSize)*pixel (x, y+halfWindowSize) - pixel(x, y-halfWindowSize-1)*pixel(x, y-halfWindowSize-1)); } mainSumPixelWindow = 0; mainSum2PixelWindow = 0; for(uint k = 0; k < WindowSize; k++) { mainSumPixelWindow += sumCols[k]; mainSum2PixelWindow += sumSqCols[k]; } sumPixelsWindow = mainSumPixelWindow; sum2PixelsWindow = mainSum2PixelWindow; }else{ sumPixelsWindow += (sumCols[j+halfWindowSize] - sumCols[j-halfWindowSize-1]); sum2PixelsWindow += (sumSqCols[j+halfWindowSize] - sumSqCols[j-halfWindowSize-1]); } } localMean = sumPixelsWindow/(WindowSize*WindowSize); localVar = sum2PixelsWindow/(WindowSize*WindowSize) - localMean*localMean; localStd = sqrt(fabs(localVar)); if (!sauvola) localValue = localMean+weight*localStd; else localValue = localMean*(1 + (localStd/128-1)/6); if(pixel(j, y) < localValue) output[y*w + j] = 0; else output[y*w + j] = 1; } } for(int y = 0; y < h; y++){ for(int x = 0; x < w; x++){ if(y < yMin) output[y*w + x] = 1; if(y > yMax) output[y*w + x] = 1; if(x < xMin) output[y*w + x] = 1; if(x > xMax) output[y*w + x] = 1; } } delete [] sumCols; delete [] sumSqCols; return result; } QIPBlackAndWhiteImage QIPGrayscaleImage::otsuBinarize() const { QIPBlackAndWhiteImage result(w, h); quint8 threshold = otsuThreshold(); for (int y = 0; y < h; y ++) { quint8 * line = scanLine(y); quint8 * lineOut = result.scanLine(y); for (int x = 0; x < w; x++) { if (line[x] > threshold) lineOut[x] = 1; else lineOut[x] = 0; } } return result; } QIPBlackAndWhiteImage QIPGrayscaleImage::otsuBinarizeMA() const { quint32 sum; QIPBlackAndWhiteImage result(w, h); if (w*h < 4) return result; quint8 threshold = otsuThreshold(); memcpy((void*)result.data.data(), (void*)data.data(), w*h); quint8 * d = result.data.data(); sum = d[0] + d[1] + d[2]+ d[3] + d[4] + d[5] + d[6]; for (int i = 3; i < w*h-4; i++) { d[i] = sum/8; sum = sum - d[i-3] + d[i+4]; } for (int y = 0; y < h; y ++) { quint8 * lineOut = result.scanLine(y); for (int x = 0; x < w; x++) { if (lineOut[x] > threshold) lineOut[x] = 1; else lineOut[x] = 0; } } return result; } QIPBlackAndWhiteImage QIPGrayscaleImage::gatosBinarize() const { QIPBlackAndWhiteImage result(w, h); memcpy(result.data.data(), data.data(), w*h); quint8 * d = result.data.data(); qr_binarize(d, w, h); for (int y = 0; y < h; y++) { quint8 * line = result.scanLine(y); for (int x = 0; x < w; x++) if (line[x] == 0) line[x] = 1; else line[x] = 0; } return result; } QIPBlackAndWhiteImage QIPGrayscaleImage::maxEntropyBinarize() const { QIPBlackAndWhiteImage result(w, h); quint8 threshold = maxEntropyThreshold(); for (int y = 0; y < h; y ++) { quint8 * line = scanLine(y); quint8 * lineOut = result.scanLine(y); for (int x = 0; x < w; x++) { if (line[x] >= threshold) lineOut[x] = 1; else lineOut[x] = 0; } } return result; } QIPBlackAndWhiteImage QIPGrayscaleImage::bradleyBinarize() const { const uint windowSize = 41; const qreal pixelBrightnessDifferenceLimit = 0.15; QIPBlackAndWhiteImage result(w, h); quint8 * resultData = result.data.data(); memcpy(resultData, data.data(), w*h); uint * intImage = new uint[w*h]; integralImage(w, h, intImage); int halfWindowSize = windowSize / 2; qreal avgBrightnessPart = 1.0f - pixelBrightnessDifferenceLimit; for (int y = 0; y < h; y++) { int y1 = y - halfWindowSize > 0 ? y - halfWindowSize : 0; int y2 = y + halfWindowSize > h-1 ? h-1 : y + halfWindowSize; for (int x = 0; x < w; x++) { int x1 = x - halfWindowSize < 0 ? 0 : x - halfWindowSize; int x2 = x + halfWindowSize < w - 1 ? x + halfWindowSize : w - 1; resultData[x + y*w] = resultData[x + y*w] < ( intImage[y2*w + x2] + intImage[y1*w + x1] - intImage[y1*w + x2] - intImage[y2*w + x1])/((x2-x1)*(y2-y1))*avgBrightnessPart ? 0 : 1; } } delete [] intImage; return result; } QIPBlackAndWhiteImage QIPGrayscaleImage::iterativeBinarize() const { QIPBlackAndWhiteImage result(w, h); quint8 threshold = CalculateIterativeThreshold(); for (int y = 0; y < h; y++) { quint8 * line = scanLine(y); quint8 * lineOut = result.scanLine(y); for (int x = 0; x < w; x++) lineOut[x] = line[x] < threshold ? 0 : 1; } return result; } QIPBlackAndWhiteImage QIPGrayscaleImage::bernsenBinarize() const { const int regSize = 7; const quint8 contrastLimit = 120; const quint8 confused = 1; QIPBlackAndWhiteImage result(w, h); for (int y = 0; y < h; y++) { const quint8 * line = scanLine(y); quint8 * lineOut = result.scanLine(y); int istart = y == 0 ? 0 : y - 1; int istop = y + regSize >= h ? h : y + regSize - 1; quint8 minimum = 255; quint8 maximum = 0; int maxX = -1; int minX = -1; for (int x = 0; x < w; x++) { int jstart = x == 0 ? 0 : x-1; int jstop = x+regSize >= w ? w : x + regSize - 1; if ((maxX < jstart)||(minX < jstart)) { minimum = 255; maximum = 0; for (int i = istart; i < istop; i++) { const quint8 * lineK = scanLine(i); for (int j = jstart; j < jstop; j++) { if (minimum > lineK[j]) { minimum = lineK[j]; minX = j; } if (maximum < lineK[j]) { maximum = lineK[j]; maxX = j; } } } } else { for (int i = istart; i < istop; i++) { if (minimum > scanLine(i)[jstop-1]) { minimum = scanLine(i)[jstop-1]; minX = jstop-1; } if (maximum < scanLine(i)[jstop-1]) { maximum = scanLine(i)[jstop-1]; maxX = jstop-1; } } } quint8 c = maximum - minimum; quint8 value; if (c < contrastLimit) value = confused; else { uint p = (maximum + minimum) / 2; value = line[x] >= p ? 1 : 0; } lineOut[x] = value; } } return result; } quint8 QIPGrayscaleImage::CalculateIterativeThreshold() const { quint32 distribution[256] = {0}; for (int y = 0; y < h; y++) { quint8 * line = scanLine(y); for (int x = 0; x < w; x++) distribution[line[x]]++; } quint32 integralHist[256]; quint32 integralDistribution[256]; integralHist[0] = 0; integralDistribution[0] = distribution[0]; for (int i = 1; i < 256; i++) { integralHist[i] = integralHist[i-1] + distribution[i]*i; integralDistribution[i] = integralDistribution[i-1] + distribution[i]; } quint8 oldThreshold = 0; quint8 newThreshold = 128; while (abs(newThreshold - oldThreshold) > 0) { uint meanWhite; uint meanBlack; uint sumBlack = integralHist[newThreshold]; uint numBlack = integralDistribution[newThreshold]; uint sumWhite = integralHist[255] - integralHist[newThreshold]; uint numWhite = integralDistribution[255] - integralDistribution[newThreshold]; /*for (int i = 0; i < 256; i++) if (i < newThreshold) { sumBlack += valueHist[i]; numBlack += distribution[i]; } else { sumWhite += valueHist[i]; numWhite += distribution[i]; }*/ meanBlack = sumBlack != 0 ? sumBlack/numBlack : 0; meanWhite = sumWhite != 0 ? sumWhite/numWhite : 0; oldThreshold = newThreshold; newThreshold = (meanBlack + meanWhite)/2; } return newThreshold; } void QIPGrayscaleImage::integralImage(uint w, uint h, uint *image) const { #ifndef IPRIT_MULTITHREADING IntRect r1 = {0,0,w,h}; copyInternal(r1, image); #endif #ifdef IPRIT_MULTITHREADING IntRect r1 = {0,0,w,h/2}; IntRect r2 = {0,h-h/2,w,h}; QFuture future1 = QtConcurrent::run(this, &QIPGrayscaleImage::copyInternal,r1,image); QFuture future2 = QtConcurrent::run(this, &QIPGrayscaleImage::copyInternal,r2, image); future1.waitForFinished(); future2.waitForFinished(); #endif for (uint x = 1; x < w; x++) image[x] += image[x-1]; for (uint y = 1; y < h; y++) image[y*w] += image[(y-1)*w]; for (uint y = 1; y < h; y++) { for (uint x = 1; x < w; x++) image[y*w+x] = image[y*w+x] + image[y*w+x-1] + image[(y-1)*w+x] - image[(y-1)*w+x-1]; } } void QIPGrayscaleImage::toGrayscaleFast(const QImage &input) { for (int y = 0; y < h; y++) { quint8 * lineIn = (quint8 *)input.scanLine(y); quint8 * lineOut = scanLine(y); for(int x = 0; x < w; x++) { lineOut[x] = lineIn[x << 2]; } } } inline quint8 maxOfThree(quint8 v1, quint8 v2, quint8 v3) { quint8 max = v1; if (v2 > max) max = v2; if (v3 > max) max = v3; return max; } inline quint8 minOfThree(quint8 v1, quint8 v2, quint8 v3) { quint8 min = v1; if (v2 < min) min = v2; if (v3 < min) min = v3; return min; } void QIPGrayscaleImage::toGrayscaleMinMax(const QImage &input) { #ifndef IPRIT_MULTITHREADING IntRect r = {0,0,input.width(),input.height()}; toGrayscaleMinMaxInternal(input,r); #endif #ifdef IPRIT_MULTITHREADING IntRect r1 = {0,0,input.width(),input.height()/2}; IntRect r2 = {0,input.height()/2,input.width(),input.height()}; QFuture future1 = QtConcurrent::run(this, &QIPGrayscaleImage::toGrayscaleMinMaxInternal,input,r1); QFuture future2 = QtConcurrent::run(this, &QIPGrayscaleImage::toGrayscaleMinMaxInternal,input,r2); future1.waitForFinished(); future2.waitForFinished(); #endif } void QIPGrayscaleImage::toGrayscaleMinOrMax(const QImage &input, bool min) { #ifndef IPRIT_MULTITHREADING IntRect r = {0,0,input.width(),input.height()}; toGrayscaleMinOrMaxInternal(input,r, min); #endif #ifdef IPRIT_MULTITHREADING IntRect r1 = {0,0,input.width(),input.height()/2}; IntRect r2 = {0,input.height()/2,input.width(),input.height()}; QFuture future1 = QtConcurrent::run(this, &QIPGrayscaleImage::toGrayscaleMinOrMaxInternal,input,r1, min); QFuture future2 = QtConcurrent::run(this, &QIPGrayscaleImage::toGrayscaleMinOrMaxInternal,input,r2, min); future1.waitForFinished(); future2.waitForFinished(); #endif } void QIPGrayscaleImage::toGrayscaleMinOrMaxInternal(const QImage &input, const IntRect &rect, bool min) { for (int y = rect.y1; y < rect.y2; y++) { QRgb * lineIn = (QRgb *)input.scanLine(y); quint8 * lineOut = scanLine(y); for(int x = rect.x1; x < rect.x2; x++) { QRgb cur = lineIn[x]; lineOut[x] = min ? minOfThree(qRed(cur), qGreen(cur), qBlue(cur)) : maxOfThree(qRed(cur), qGreen(cur), qBlue(cur)); } } } void QIPGrayscaleImage::toGrayscaleMinMaxInternal(const QImage &input, const IntRect &rect) { for (int y = rect.y1; y < rect.y2; y++) { QRgb * lineIn = (QRgb *)input.scanLine(y); quint8 * lineOut = scanLine(y); for(int x = rect.x1; x < rect.x2; x++) { QRgb cur = lineIn[x]; lineOut[x] = (minOfThree(qRed(cur), qGreen(cur), qBlue(cur)) + maxOfThree(qRed(cur), qGreen(cur), qBlue(cur))) >> 1; } } } double safeLog(double x) { if (x > 0) return log(x); return 0; } void QIPGrayscaleImage::toGrayScaleByEntropyChannel(const QImage &input, bool maxEntropy) { qreal rHist[256]; qreal gHist[256]; qreal bHist[256]; quint32 rChannel[256] = {0}; quint32 gChannel[256] = {0}; quint32 bChannel[256] = {0}; int width = input.width(); int height = input.height(); if (width*height == 0) return; for (int y = 0; y < height; y++) { QRgb * lineIn = (QRgb *)input.scanLine(y); for(int x = 0; x < width; x++) { rChannel[qRed(lineIn[x])]++; gChannel[qGreen(lineIn[x])]++; bChannel[qBlue(lineIn[x])]++; } } qreal sizeI = 1.0/(width*height); for (int i = 0; i < 256; i++) { rHist[i] = rChannel[i]*sizeI; rHist[i] *= (-safeLog(rHist[i])); gHist[i] = gChannel[i]*sizeI; gHist[i] *= (-safeLog(gHist[i])); bHist[i] = bChannel[i]*sizeI; bHist[i] *= (-safeLog(bHist[i])); } qreal rEntropy = 0.0; qreal gEntropy = 0.0; qreal bEntropy = 0.0; for (int i = 0; i < 256; i++) { rEntropy += rHist[i]; gEntropy += gHist[i]; bEntropy += bHist[i]; } int (*chan)(QRgb); if (maxEntropy) { qreal max = rEntropy; chan = qRed; if (gEntropy > max) { max = gEntropy; chan = qGreen; } if (bEntropy > max) { chan = qBlue; } } else { qreal min = gEntropy; chan = qGreen; if (rEntropy < min) { min = rEntropy; chan = qRed; } if (bEntropy < min) { chan = qBlue; } } for (int y = 0; y < height; y++) { QRgb * lineIn = (QRgb *)input.scanLine(y); quint8 * lineOut = scanLine(y); for(int x = 0; x < width; x++) lineOut[x] = chan(lineIn[x]); } } quint8 maxTh(qreal * hist, qreal * ihist, int start, int stop) { qreal ut = 0; for (int i = start; i < stop; i++) ut+= ihist[i]; int maxK=0; int maxSigmaK=0; qreal wk = 0; qreal uk = 0; for (int k = start; k < stop; ++k) { if (hist[k] == 0) continue; wk += hist[k]; uk += ihist[k]; qreal sigmaK = 0; if ((wk !=0) && (wk!=1)) sigmaK = ((ut*wk - uk)*(ut*wk - uk))/(wk*(1-wk)); if (sigmaK > maxSigmaK) { maxK = k; maxSigmaK = sigmaK; } } return maxK; } QIPGrayscaleImage::QIPGrayscaleImage() : data(0) { w = 0; h = 0; } quint8 *QIPGrayscaleImage::scanLinePtr(quint8 *ptr, int y, int wth) { return &(ptr[y*wth]); } yagf-0.9.5+repack1/src/core/pixelwindow.h000755 001750 001750 00000002541 13631520722 021674 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #ifndef PIXELWINDOW_H #define PIXELWINDOW_H #include "qipblackandwhiteimage.h" #include "qipgrayscaleimage.h" class PixelWindow { public: PixelWindow(QIPBlackAndWhiteImage *image, int x, int y, int width, int height); PixelWindow(QIPGrayscaleImage * image, int x, int y, int width, int height); ~PixelWindow(); void move(int newX, int newY); quint8 pixel(int x, int y); private: QIPBlackAndWhiteImage * img; QIPGrayscaleImage * gsimg; int xStart; int yStart; int w; int h; int iw; quint8 ** lines; quint8 * blankLine; }; #endif // PIXELWINDOW_H yagf-0.9.5+repack1/src/core/subpagepp.h000755 001750 001750 00000000342 13631520722 021306 0ustar00boradminboradmin000000 000000 #ifndef SUBPAGEPP_H #define SUBPAGEPP_H #include class SubpagePP : public QObject { Q_OBJECT public: explicit SubpagePP(QObject *parent = 0); signals: public slots: }; #endif // SUBPAGEPP_H yagf-0.9.5+repack1/src/core/qipblackandwhiteimage.h000755 001750 001750 00000014020 13631520722 023633 0ustar00boradminboradmin000000 000000 /* This file is part of Libiprit by Andrei Borovsky . Libiprit is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Libiprit 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Libiprit. If not, see . */ #ifndef QIPBLACKANDWHITEIMAGE_H #define QIPBLACKANDWHITEIMAGE_H #include "common.h" //#include "qipconnectedcomponents.h" #include #include #include /*! \class QIPBlackAndWhiteImage This class holds internal representations of black and white (binary) images and allows you to perform different operations on them. The only way to create an instance of the class is to call QIPGrayscaleImage::binarize() method. When you are done with transformations you can convert the data to QImage image (which will contain only black and white pixels) using the toImage() method. \sa QIPGrayscaleImage */ class QIPGrayscaleImage; class QIPBlackAndWhiteImage { QIPBlackAndWhiteImage(quint32 width, quint32 height); public: QIPBlackAndWhiteImage(); QIPBlackAndWhiteImage(const QIPBlackAndWhiteImage &I); ~QIPBlackAndWhiteImage(); /*! Converts binary image to QImage object. */ QImage toImage() const; /*! * Returns the part of the original black and white image bounded by the rectangle (x1,y1) (x2,y2) as a new instance of QIPBlackAndWhiteImage. * Note that the boundaries should not exceed those of the original image (this is not checked). * \sa toImage */ QIPBlackAndWhiteImage copy(quint32 x1, quint32 x2, quint32 y1, quint32 y2) const; /*! * Returns the image's width. * \sa height */ quint32 width(); /*! * Returns the image's height. * \sa width */ quint32 height(); /*! * Returns an image obtained by morphologically dilating the original image with the structuring element defined by the structuringElement variable. * structuringElement is an array of quint8 values where 1 corresponds to white and 0 - to black. The array should form a square with an odd side size for example, the structureing element 3*3 might be declared as * \code quint8 se[9] = {1,0,1,0,0,0,1,0,1}; \endcode * The hotspot is in the center of the square. * dimensions is the size of the side of the square. Odd values like 3, 5, 7 should be used for squares 3*3, 5*5, and 7*7 respectively. * \sa erode */ QIPBlackAndWhiteImage dilate(quint8 *structuringElement, int dimensions) const; /*! * Returns an image obtained by morphologically eroding the original image with the structuring element defined by the structuringElement variable. * structuringElement is an array of quint8 values where 1 corresponds to white and 0 - to black. The array should form a square with an odd side size for example, the structureing element 3*3 might be declared as * \code quint8 se[9] = {1,0,1,0,0,0,1,0,1}; \endcode * The hotspot is in the center of the square. * dimensions is the size of the side of the square. Odd values like 3, 5, 7 should be used for squares 3*3, 5*5, and 7*7 respectively. * \sa dilate */ QIPBlackAndWhiteImage erode(quint8 *structuringElement, int dimensions) const; /*! * Returns an image obtained by morphologically opening the original image with the structuring element defined by the structuringElement variable. * structuringElement is an array of quint8 values where 1 corresponds to white and 0 - to black. The array should form a square with an odd side size for example, the structureing element 3*3 might be declared as * \code quint8 se[9] = {1,0,1,0,0,0,1,0,1}; \endcode * The hotspot is in the center of the square. * dimensions is the size of the side of the square. Odd values like 3, 5, 7 should be used for squares 3*3, 5*5, and 7*7 respectively. * \sa close */ QIPBlackAndWhiteImage open(quint8 *structuringElement, int dimensions) const; /*! * Returns an image obtained by morphologically closing the original image with the structuring element defined by the structuringElement variable. * structuringElement is an array of quint8 values where 1 corresponds to white and 0 - to black. The array should form a square with an odd side size for example, the structureing element 3*3 might be declared as * \code quint8 se[9] = {1,0,1,0,0,0,1,0,1}; \endcode * The hotspot is in the center of the square. * dimensions is the size of the side of the square. Odd values like 3, 5, 7 should be used for squares 3*3, 5*5, and 7*7 respectively. * \sa open */ QIPBlackAndWhiteImage close(quint8 *structuringElement, int dimensions) const; /*! * Returns an inverted image. */ QIPBlackAndWhiteImage inverse() const; /*! * Returns the image with black or white border frames cropped out. */ QIPBlackAndWhiteImage crop() const; QRect cropGrayScaleImage(const QIPGrayscaleImage &image); bool isNull() const; void free(); quint8 * scanLine(quint32 y) const; quint8 pixel(int x, int y); private: int w, h; QSharedPointer data; private: void toImageInternal(uchar * image, const IntRect &rect, int imageWidth) const; inline void setPixel(quint32 x, quint32 y, quint8 value); bool compareElements(quint8 **se, quint8 **w, int dimensions) const; IntRect cropInternal(bool upperLeft) const; void copyInternal(quint8 * data, int x1, int x2, int y1, int y2) const; friend class QIPGrayscaleImage; friend class QIPConnectedComponents; }; #endif // QIPBLACKANDWHITEIMAGE_H yagf-0.9.5+repack1/src/core/pageanalysis.cpp000755 001750 001750 00000016344 13631520722 022344 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #include "pageanalysis.h" #include "rotationcropper.h" #include "ccbuilder.h" #include "analysis.h" #include "utils.h" #include #include #include #include #include void BlockSplitter::setImage(const QImage &image, qreal rotation, qreal scale) { img = image; m_rotate = rotation; m_scale = scale; } QRect BlockSplitter::getRootBlock(const QImage &image) { if (image.isNull()) return QRect(0,0,0,0); QImage img1 = image; QRect result = blockAllText(); RotationCropper rc(&img1, QColor("white").rgb()); // CCBuilder cb(img1); //img1.save("/home/anre/pictures/ttt.png"); //QRect r = cb.crop();//rc.crop(); QRect r1(result.x(), result.y(), result.width(), result.height()); result = r1; /*foreach (Rect rc, bars) { bars.removeOne(rc); rc.x1 += r.x(); rc.x2 += r.x(); rc.y1 += r.y(); rc.y2 += r.y(); bars.append(rc); }*/ return result; } Bars BlockSplitter::getBars() { return bars; } QRect BlockSplitter::blockAllText() { //img = img.transformed(QTransform().translate(-x, -y).rotate(m_rotate).translate(x, y), Qt::SmoothTransformation); if (!img.isNull()) { CCBuilder *cb = new CCBuilder(img); cb->labelCCs(); CCAnalysis *an = new CCAnalysis(cb); an->analize(); lines = an->getLines(); foreach(TextLine l, lines) if (l.count() < 3) lines.removeOne(l); int minX = 100000; int minY = 100000; int maxX = 0; int maxY = 0; for (int i =0; i < lines.count(); i++) { int x1 = lines.at(i).at(0).x; int y1 = lines.at(i).at(0).y; int x2 = lines.at(i).at(lines.at(i).count()-1).x; int y2 = lines.at(i).at(lines.at(i).count()-1).y; //graphicsInput->drawLine(x1,y1,x2,y2); if (x1 > x2) { int t = x2; x2 = x1; x1 = t; } minX = minX < x1 ? minX : x1; maxX = maxX > x2 ? maxX : x2; if (y1 > y2) { int t = y2; y2 = y1; y1 = t; } minY = minY < y1 ? minY : y1; maxY = maxY > y2 ? maxY : y2; } minX = minX - 2*an->getMediumGlyphWidth(); maxX =maxX + 2*an->getMediumGlyphWidth(); minY = minY - 2*an->getMediumGlyphHeight(); maxY = maxY + 2*an->getMediumGlyphHeight(); //graphicsInput->clearBlocks(); //graphicsInput->addBlock(QRectF(ox + minX*2*sideBar->getScale(), oy + minY*2*sideBar->getScale(), (maxX-minX)*2*sideBar->getScale(), (maxY-minY)*2*sideBar->getScale())); bars = an->addBars(); delete an; delete cb; minX = minX <= 0 ? 1 :minX; minY = minY <= 0 ? 1 :minY; return QRect(minX*m_scale, minY*m_scale, (maxX-minX)*m_scale, (maxY-minY)*m_scale); } return QRect(0, 0, 0, 0); } void BlockSplitter::splitVertical() { bool didSplit = true; while (didSplit) { didSplit = false; for (int i = blocks.count() - 1; i >=0; i--) { Rect block = blocks.at(i); foreach(Rect bar, bars) { if (abs(bar.x2 - bar.x1) > (bar.y2-bar.y1)) continue; int xmid = (bar.x1 + bar.x2)/2; if ((block.x1 < (xmid - 5)) &&(block.x2 > (xmid + 5))) { Rect block1 = block; block1.x2 = xmid -2; Rect block2 = block; block2.x1 = xmid + 2; blocks.removeAll(block); blocks.append(block1); blocks.append(block2); didSplit = true; break; } } } } } void BlockSplitter::splitBlocks() { QRect r = getRootBlock(img); Rect b; b.x1 = r.x(); b.y1 = r.y(); b.x2 = b.x1 + r.width(); b.y2 = b.y1 + r.height(); blocks.clear(); blocks.append(b); splitVertical(); splitHorisontal(); for (int i = blocks.count() -1; i >=0; i--) { Rect r = blocks.at(i); if (!isBlockRecogniseable(r)) blocks.removeAll(r); } /*CCBuilder ccb(img); ccb.labelCCs(); CCAnalysis cca(&ccb); cca.tableAnalise(); Rect r1 = cca.getTableRect(); cca.markTableBlocks(b); QList bl = cca.extractTableBlocks(b); foreach (Rect r1, bl) { blocks.append(r1); }*/ //int i = bl.count(); } QList BlockSplitter::getBlocks() { return blocks; } QRect BlockSplitter::getRotationCropRect(const QImage &image) { const QImage *img = ℑ QImage *img2 = const_cast(img); RotationCropper rc(img2, QColor("white").rgb()); return rc.crop(); } void BlockSplitter::splitHorisontal() { bool didSplit = true; while (didSplit) { didSplit = false; for (int i = blocks.count() - 1; i >=0; i--) { Rect block = blocks.at(i); foreach(Rect bar, bars) { if (abs(bar.y2 - bar.y1) > (bar.x2-bar.x1)) continue; int ymid = (bar.y1 + bar.y2)/2; if ((block.y1 < (ymid - 5)) &&(block.y2 > (ymid + 5))) if (_contains(bar.x1, bar.x2, block.x1)||_contains(bar.x1, bar.x2, block.x2)||_contains(block.x1, block.x2, bar.x1)||_contains(block.x1, block.x2, bar.x2)) { Rect block1 = block; block1.y2 = ymid -2; Rect block2 = block; block2.y1 = ymid + 2; blocks.removeAll(block); blocks.append(block1); blocks.append(block2); didSplit = true; break; } } } } } inline bool between(int a, int b, int c) { return (c > a) && (c < b); } bool BlockSplitter::isBlockRecogniseable(const Rect &block) { int contains = 0; int maxl = 0; foreach(TextLine l, lines) { if (!between(block.x1, block.x2, l.first().x)) continue; if (!between(block.x1, block.x2, l.last().x)) continue; if (!between(block.y1, block.y2, l.first().y)) continue; if (!between(block.y1, block.y2, l.last().y)) continue; contains++; if (l.count() > maxl) maxl = l.count(); } if ((maxl > 3)) return true; return false; } yagf-0.9.5+repack1/src/core/qipblackandwhiteimage.cpp000755 001750 001750 00000030046 13631520722 024174 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #include "qipblackandwhiteimage.h" #include "common.h" #include "qipgrayscaleimage.h" static const QRgb black = qRgb(0,0,0); static const QRgb white = qRgb(255,255,255); QIPBlackAndWhiteImage::QIPBlackAndWhiteImage() : data(0) { w =0; h = 0; } QIPBlackAndWhiteImage::QIPBlackAndWhiteImage(quint32 width, quint32 height) : data(new quint8[width*height], deallocator) { w = width; h = height; // quint8 * ptr = new quint8[w*h]; // data = QSharedPointer(ptr); } QIPBlackAndWhiteImage::QIPBlackAndWhiteImage(const QIPBlackAndWhiteImage &I) : data(I.data.data(),deallocator) { w = I.w; h = I.h; } QIPBlackAndWhiteImage::~QIPBlackAndWhiteImage() { data.clear(); } quint8 *QIPBlackAndWhiteImage::scanLine(quint32 y) const { return &(data.data()[y*w]); } quint8 QIPBlackAndWhiteImage::pixel(int x, int y) { if (x < 0) return 1; if (x +y*w >= w*h) return 1; return data.data()[x + y*w]; } void QIPBlackAndWhiteImage::setPixel(quint32 x, quint32 y, quint8 value) { data.data()[x+y*w] = value; } bool QIPBlackAndWhiteImage::compareElements(quint8 **se, quint8 **w, int dimensions) const { for (int i = 0; i < dimensions; i++) for (int j = 0; j < dimensions; j++) // for (int j = 0; j < dimensions-2; j++) if (se[i][j] == 0) if (w[i][j] != 0) return false; return true; } IntRect QIPBlackAndWhiteImage::cropInternal(bool upperLeft) const { IntRect result; if (upperLeft) { for (int y = 0; y < h; y++) { quint32 stepCount = 0; quint8 * line = scanLine(y); for (int x = 1; x < w; x++) { if (line[x] != line[x-1]) stepCount++; } if (stepCount > 4) { result.y1 = y > 2 ? y - 2 : y; result.y1 = y > 4 ? y - 4 : result.y1; break; } } for (int x = 0; x < w; x++) { quint32 bin[2] = {0,0}; quint32 min; for (int y = 0; y < h; y++) { quint8 * line = scanLine(y); bin[line[x]]++; } min = bin[0] < bin[1] ? bin[0] : bin[1]; if (min > 10) { result.x1 = x >4? x-4:x; break; } } //result.x1 = minL; } else { for (int y = h-1; y > 0; y--) { quint32 stepCount = 0; quint8 * line = scanLine(y); for (int x = 1; x < w; x++) { if (line[x] != line[x-1]) stepCount++; } if (stepCount > 4) { result.y2 = h- y > 2 ? y + 2 : y; result.y2 = h -y > 4 ? y + 4 : result.y2; //result.y2 = 500; break; } } for (int x = w-2; x > 0; x--) { quint32 bin[2] = {0,0}; quint32 min; for (int y = 0; y < h; y++) { quint8 * line = scanLine(y); bin[line[x]]++; } min = bin[0] < bin[1] ? bin[0] : bin[1]; if (min > 10) { result.x2 = x >4? x-4:x; break; } } } return result; } void QIPBlackAndWhiteImage::copyInternal(quint8 * data, int x1, int x2, int y1, int y2) const { int wr = x2 - x1; for (int y = y1; y < y2; y++) memcpy(&(data[wr*(y-y1)]), &(scanLine(y)[x1]), wr); } QImage QIPBlackAndWhiteImage::toImage() const { QImage image(w, h, QImage::Format_ARGB32); #ifndef IPRIT_MULTITHREADING IntRect r = {0,0,image.width(),image.height()}; toImageInternal(image.scanLine(0),r, image.width()); #endif #ifdef IPRIT_MULTITHREADING IntRect r1 = {0,0,image.width(),image.height()/2}; IntRect r2 = {0,image.height()/2,image.width(),image.height()}; QFuture future1 = QtConcurrent::run(this, &QIPBlackAndWhiteImage::toImageInternal,image.scanLine(0),r1, image.width()); QFuture future2 = QtConcurrent::run(this, &QIPBlackAndWhiteImage::toImageInternal,image.scanLine(0),r2, image.width()); future1.waitForFinished(); future2.waitForFinished(); #endif return image; } QIPBlackAndWhiteImage QIPBlackAndWhiteImage::copy(quint32 x1, quint32 x2, quint32 y1, quint32 y2) const { QIPBlackAndWhiteImage result(x2-x1, y2-y1); #ifndef IPRIT_MULTITHREADING copyInternal(result.data.data(), x1, x2, y1, y2); #endif #ifdef IPRIT_MULTITHREADING copyInternal(result.data.data(), x1, x2, y1, y2); QFuture future1 = QtConcurrent::run(this, &QIPBlackAndWhiteImage::copyInternal, result.data.data(), x1, x2, y1, (y1+y2)/2); QFuture future2 = QtConcurrent::run(this, &QIPBlackAndWhiteImage::copyInternal, result.data.data(), x1, x2, (y1+y2)/2, y2 - (y1+y2)/2); future1.waitForFinished(); future2.waitForFinished(); #endif return result; } quint32 QIPBlackAndWhiteImage::width() { return w; } quint32 QIPBlackAndWhiteImage::height() { return h; } QIPBlackAndWhiteImage QIPBlackAndWhiteImage::dilate(quint8 *structuringElement, int dimensions) const { QIPBlackAndWhiteImage res(w, h); memset((void *)res.data.data(), 1, w*h); if ((dimensions >= w)|| (dimensions >= h)) return res; quint8 ** slines = new quint8 * [dimensions]; quint8 ** dlines = new quint8 * [dimensions]; quint8 ** elines = new quint8 * [dimensions]; for (int i = 0; i < dimensions; i++) elines[i] = &structuringElement[dimensions*i]; int dimensions_2 = dimensions/2; for (int y = dimensions_2; y < h - dimensions_2; y++) { for (int i = 0; i < dimensions; i++) { int ind = y + i - dimensions_2; slines[i] = scanLine(ind); dlines[i] = res.scanLine(ind); } for (int x = dimensions_2; x < w - dimensions_2; x++) { if (slines[dimensions_2][x] == 0) { //dlines [dimensions_2][x] = slines[dimensions_2][x]; int xs = x - dimensions_2; for (int i = 0; i < dimensions; i++) for (int j = 0; j < dimensions; j++) { dlines[i][xs+j] &= elines[i][j]; } } } } delete[] slines; delete[] elines; delete[] dlines; return res; } QIPBlackAndWhiteImage QIPBlackAndWhiteImage::erode(quint8 *structuringElement, int dimensions) const { QIPBlackAndWhiteImage res(w, h); memset((void *)res.data.data(), 1, w*h); if ((dimensions >= w)|| (dimensions >= h)) return res; quint8 ** slines = new quint8 * [dimensions]; quint8 ** dlines = new quint8 * [dimensions]; quint8 ** elines = new quint8 * [dimensions]; quint8 * sums = new quint8 [dimensions]; for (int i = 0; i < dimensions; i++) elines[i] = &structuringElement[dimensions*i]; int seSumsTotal = 0; for (int i = 0; i < dimensions; i++) for (int j = 0; j < dimensions; j++) seSumsTotal += elines[i][j]; int dimensions_2 = dimensions/2; for (int y = dimensions_2; y < h - dimensions_2; y++) { for (int i = 0; i < dimensions; i++) { int ind = y + i - dimensions_2; slines[i] = scanLine(ind); dlines[i] = res.scanLine(ind); } //sums[0] = ; for (int x = 0; x < dimensions; x++) { sums[x] = 0; for (int i = 0; i < dimensions; i++) sums[x] += slines[i][x]; } int totalSum = 0; for (int i = 0; i < dimensions; i++) totalSum += sums[i]; if (totalSum <= seSumsTotal) { if (totalSum == 0) dlines[dimensions_2][dimensions_2] = 0; else { if (compareElements(elines, slines, dimensions)) dlines[dimensions_2][dimensions_2] = 0; } } for (int x = dimensions_2+1; x < w - dimensions_2; x++) { for (int i = 0; i < dimensions; i++) slines[i]++; //int xf = x + dimensions_2; totalSum -= sums[0]; for (int i = 1; i < dimensions; i++) sums[i-1] = sums[i]; sums[dimensions-1] = 0; for (int i = 0; i < dimensions; i++) sums[dimensions-1] += slines[i][dimensions-1]; totalSum += sums[dimensions-1]; if (totalSum <= seSumsTotal) { if (totalSum == 0) dlines[dimensions_2][x] = 0; else { if (compareElements(elines, slines, dimensions)) dlines[dimensions_2][x] = 0; } } } } delete[] slines; delete[] elines; delete[] dlines; delete[] sums; return res; } QIPBlackAndWhiteImage QIPBlackAndWhiteImage::open(quint8 *structuringElement, int dimensions) const { return erode(structuringElement, dimensions).dilate(structuringElement, dimensions); } QIPBlackAndWhiteImage QIPBlackAndWhiteImage::close(quint8 *structuringElement, int dimensions) const { return dilate(structuringElement, dimensions).erode(structuringElement, dimensions); } QIPBlackAndWhiteImage QIPBlackAndWhiteImage::inverse() const { QIPBlackAndWhiteImage res(w, h); for (int y = 0; y < h; y++) { quint8 * sline = scanLine(y); quint8 * dline = res.scanLine(y); for (int x = 0; x < w; x++) dline[x] = 1 - sline[x]; } return res; } QIPBlackAndWhiteImage QIPBlackAndWhiteImage::crop() const { IntRect r1, r2; #ifndef IPRIT_MULTITHREADING r1 = cropInternal(true); r2 = cropInternal(false); #endif #ifdef IPRIT_MULTITHREADING QFuture future1 = QtConcurrent::run(this, &QIPBlackAndWhiteImage::cropInternal, true); QFuture future2 = QtConcurrent::run(this, &QIPBlackAndWhiteImage::cropInternal, false); future1.waitForFinished(); future2.waitForFinished(); r1 = future1.result(); r2 = future2.result(); #endif return copy(r1.x1, r2.x2, r1.y1, r2.y2); } QRect QIPBlackAndWhiteImage::cropGrayScaleImage(const QIPGrayscaleImage &image) { IntRect r1, r2; #ifndef IPRIT_MULTITHREADING r1 = cropInternal(true); r2 = cropInternal(false); #endif #ifdef IPRIT_MULTITHREADING QFuture future1 = QtConcurrent::run(this, &QIPBlackAndWhiteImage::cropInternal, true); QFuture future2 = QtConcurrent::run(this, &QIPBlackAndWhiteImage::cropInternal, false); future1.waitForFinished(); future2.waitForFinished(); r1 = future1.result(); r2 = future2.result(); #endif if ((r2.x2-r1.x1 < 32)&&(r2.y2-r1.y1 < 32)) return QRect(0,0,0,0); // QIPGrayscaleImage tmp = image->copy(r1.x1, r2.x2, r1.y1, r2.y2); // delete *image; // (*image) = tmp; return QRect(r1.x1,r1.y1, r2.x2-r1.x1,r2.y2-r2.y1); } bool QIPBlackAndWhiteImage::isNull() const { return w*h == 0; } void QIPBlackAndWhiteImage::free() { data.clear(); } void QIPBlackAndWhiteImage::toImageInternal(uchar *image, const IntRect &rect, int imageWidth) const { int im4 =4*imageWidth; for (int y = rect.y1; y < rect.y2; y++) { quint8 * line = scanLine(y); QRgb * lineOut = (QRgb *)&image[im4*y]; for (int x = rect.x1; x < rect.x2; x++ ) lineOut[x] = (line[x] == 0 ? black : white); } } yagf-0.9.5+repack1/src/core/subpagepp.cpp000755 001750 001750 00000000130 13631520722 021634 0ustar00boradminboradmin000000 000000 #include "subpagepp.h" SubpagePP::SubpagePP(QObject *parent) : QObject(parent) { } yagf-0.9.5+repack1/src/core/ccbuilder.cpp000755 001750 001750 00000040645 13631520722 021621 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #include "ccbuilder.h" #include "settings.h" #include #include #define XDEBUG #ifdef XDEBUG #include #endif class Cropper { public: Cropper(CCBuilder * builder) { this->builder = builder; darksCount = 0; lightsCount = 0; minval = 0; maxval = 0; //clAltCount = 0; whitetr = 650; clBrighttoWidthtr = 0.1; } ~Cropper() {} QRect crop() { y1 = 0; int tolerance = 3; for (int y = 0; y < builder->h; y ++) { if (checkHorzLine(y)) { tolerance--; if (tolerance == 0) { y1 = y; break; } } else tolerance = 3; } y2 = builder->h-1; tolerance = 3; for (int y = y2; y >= 0; y--) { if (checkHorzLine(y)) { tolerance--; if (tolerance == 0) { y2 = y; break; } } else tolerance = 3; } x1 = 0; tolerance = 3; for (int x = x1; x < builder->w; x++) { if (checkVertLine(x)) { tolerance--; if (tolerance == 0) { x1 = x; break; } } else tolerance = 3; } x2 = builder->w-1; tolerance = 3; for (int x = x2; x >= 0; x--) { if (checkVertLine(x)) { tolerance--; if (tolerance == 0) { x2 = x; break; } } else tolerance = 3; } return QRect(x1, y1, x2-x1, y2-y1); } bool checkHorzLine(int y) { quint32 clWhiteCount = 0; darksCount = 0; lightsCount = 0; minval = 800; maxval = 0; whitesCount = 0; //clAltCount = 0; whiteAlt = 0; //int maxlstripe = 0; //int currentlstripe = 0; QRgb * line = (QRgb *) builder->image.scanLine(y); //int curline =0; for (int i = 0; i < builder->w; i++) { int pixel = qRed(line[i]) + qGreen(line[i]) + qBlue(line[i]); if (pixel <= 382) { darksCount++; // if (currentlstripe > maxlstripe) maxlstripe = currentlstripe; // currentlstripe = 0; } else { lightsCount++; // currentlstripe++; if (pixel >= whitetr) { whitesCount++; if (whiteAlt == 0) { whiteAlt = 1; clWhiteCount++; } } else whiteAlt = 0; } minval = pixel < minval ? pixel : minval; maxval = pixel > maxval ? pixel : maxval; } clBrighttoWidth = (qreal)lightsCount/builder->w; if (clBrighttoWidth <= clBrighttoWidthtr) return false; if (maxval - minval < 40) return false; //if (clAltCount < 10) // return false; //if (maxlstripe < 10) // return false; // if ((clWhiteCount > 0)&&(clWhiteCount < 3)) // return false; return true; } bool checkVertLine(int x) { quint32 clWhiteCount = 0; darksCount = 0; lightsCount = 0; minval = 800; maxval = 0; whitesCount = 0; //clAltCount = 0; whiteAlt = 0; //int curline =0; for (int y = 0; y < builder->h; y++) { QRgb * line = (QRgb *) builder->image.scanLine(y); int pixel = qRed(line[x]) + qGreen(line[x]) + qBlue(line[x]); if (pixel <= 382) { darksCount++; // if (curline) { // clAltCount++; // curline = 0; // } } else { lightsCount++; // if (!curline) { // clAltCount++; // curline = 1; // } if (pixel >= whitetr) { whitesCount++; if (whiteAlt == 0) { whiteAlt = 1; clWhiteCount++; } } else whiteAlt = 0; } minval = pixel < minval ? pixel : minval; maxval = pixel > maxval ? pixel : maxval; } clBrighttoWidth = (qreal)lightsCount/builder->h; if (clBrighttoWidth <= clBrighttoWidthtr) return false; if (maxval - minval < 40) return false; // if (clAltCount < 10) // return false; if ((clWhiteCount > 0)&&(clWhiteCount < 3)) return false; return true; } private: CCBuilder * builder; int darksCount; int lightsCount; int minval; int maxval; //int clAltCount; int whitesCount; int whitetr; int whiteAlt; qreal clBrighttoWidth; qreal clBrighttoWidthtr; int y1, y2, x1, x2; }; CCBuilder::CCBuilder(const QImage &img, QObject *parent) : QObject(parent) { labels = NULL; //new quint32 [image.height()*image.width()]; flags = NULL; //new bool[image.height()]; if (img.isNull()) { w = h = 0; return; } image = img; if (image.format() != QImage::Format_ARGB32) image.convertToFormat(QImage::Format_ARGB32); labels = NULL; //new quint32 [image.height()*image.width()]; flags = NULL; //new bool[image.height()]; //memset(flags, 0, sizeof(bool)*image.height()); skipNext = false; maxlabel = 1; w = image.width(); h = image.height(); thr1 = 0; thr2 = 0; for (int y = 64; y < img.height(); y++) { QRgb * line = (QRgb *) img.scanLine(y); for(int x = 32; x < img.width()/2; x++) thr1 = thr1 + (line[x]&0x000000FF); for(int x= img.width()/2; x < img.width()-32; x++) thr2 = thr2 + (line[x]&0x000000FF); } thr1 /= (w*h/2); thr2 /= (w*h/2); } CCBuilder::~CCBuilder() { delete [] labels; delete [] flags; } int CCBuilder::width() { return w; } int CCBuilder::height() { return h; } void CCBuilder::compactLabels() { QList l; l.append(0); for( int i = 0; i < w; i++) for( int j = 0; j < h; j++) if (!l.contains(label(i,j))) l.append(label(i,j)); for( int i = 0; i < w; i++) for( int j = 0; j < h; j++) setLabel(i, j, l.indexOf(label(i,j))); } quint32 CCBuilder::label(int x, int y) { int index = y*w+x; if (index < w*h) return labels[index]; return 0; } int CCBuilder::labelChecked(int x, int y) { if ((x<0)||(y<0)) return 0; if ((x>=w)||(y>=h)) return 0; return labels[y*w+x]; } void CCBuilder::setLabel(int x, int y, int newValue) { recolor.replace(label(x, y), newValue); labels[y*w+x] = newValue; didRecolor = true; } void CCBuilder::relabelLineLR(int y) { for (int x = 0; x < w; x++) { if (labelChecked(x, y)) { int oc = labelChecked(x, y); if (recolor.at(labelChecked(x-1, y))) { int nc = recolor.at(labelChecked(x-1, y)); if (nc < oc) { setLabel(x, y, nc); oc = nc; } if (recolor.at(labelChecked(x+1, y-1))) { int nc = recolor.at(labelChecked(x+1, y-1)); if (nc < oc) { setLabel(x, y, nc); oc = nc; } } } else { if (recolor.at(labelChecked(x, y-1))) { int nc = recolor.at(labelChecked(x, y-1)); if (nc < oc) { setLabel(x, y, nc); oc = nc; } } if (recolor.at(labelChecked(x-1, y-1))) { int nc = recolor.at(labelChecked(x-1, y-1)); if (nc < oc) { setLabel(x, y, nc); oc = nc; } } if (recolor.at(labelChecked(x+1, y-1))) { int nc = recolor.at(labelChecked(x+1, y-1)); if (nc < oc) { setLabel(x, y, nc); oc = nc; } } } } } } void CCBuilder::relabelLineRL(int y) { for (int x = w-1; x >= 0; x--) { if (labelChecked(x, y)) { int oc = labelChecked(x, y); if (recolor.at(labelChecked(x+1, y))) { int nc = recolor.at(labelChecked(x+1, y)); if (nc < oc) { setLabel(x, y, nc); oc = nc; } if (recolor.at(labelChecked(x-1, y+1))) { int nc = recolor.at(labelChecked(x-1, y+1)); if (nc < oc) { setLabel(x, y, nc); oc = nc; } } } else { if (recolor.at(labelChecked(x, y+1))) { int nc = recolor.at(labelChecked(x, y+1)); if (nc < oc) { setLabel(x, y, nc); oc = nc; } } if (recolor.at(labelChecked(x+1, y+1))) { int nc = recolor.at(labelChecked(x+1, y+1)); if (nc < oc) { setLabel(x, y, nc); oc = nc; } } if (recolor.at(labelChecked(x-1, y+1))) { int nc = recolor.at(labelChecked(x-1, y+1)); if (nc < oc) { setLabel(x, y, nc); oc = nc; } } } } } } bool CCBuilder::isForeground(int x, QRgb value) { quint32 thr = x < image.width()/2 ? thr1 : thr2; return (value&0x000000FF) < thr; } void CCBuilder::initialScan() { recolor.clear(); recolor.append(0); scanFirstLineLR(); for (int j = 1; j < h; j++) { labelLeftmostPoint(j); scanLineLR(j); labelRightmostPoint(j); } } void CCBuilder::backwardScan() { bool rdid = false; didRecolor = false; relabelLineLR(h-1); rdid = rdid|didRecolor; skipNext = flags[h-1]; flags[h-1] = !didRecolor; skipNext = skipNext&flags[h-1]; for (int j = h-2; j >= 0; j--) { didRecolor = false; skipNext = skipNext&flags[j]; if (!skipNext) { relabelLineRL(j); rdid = rdid|didRecolor; } #ifdef DEBUG_CC else dcounter++; gcounter++; #endif skipNext = flags[j]; flags[j] = !didRecolor; skipNext = skipNext&flags[j]; } didRecolor = rdid; } void CCBuilder::forwardScan() { bool rdid = false; didRecolor = false; relabelLineLR(0); rdid = rdid|didRecolor; skipNext = flags[0]; flags[0] = !didRecolor; skipNext = skipNext&flags[0]; for (int j = 1; j < h; j++) { didRecolor = false; skipNext = skipNext&flags[j]; if (!skipNext) { relabelLineLR(j); rdid = rdid|didRecolor; } #ifdef DEBUG_CC else dcounter++; gcounter++; #endif skipNext = flags[j]; flags[j] = !didRecolor; skipNext = skipNext&flags[j]; } didRecolor = rdid; } int CCBuilder::labelCCs() { delete labels; delete flags; labels = 0; flags = 0; if (w*h == 0) return 0; labels = new quint32 [image.height()*image.width()]; flags = new bool[image.height()]; memset(flags, 0, sizeof(bool)*image.height()); #ifdef DEBUG_CC dcounter = 0; gcounter = 0; #endif int count = 0; initialScan(); didRecolor = true; int turn = 1; while (didRecolor) { didRecolor = false; if (turn) backwardScan(); else forwardScan(); turn = 1 - turn; count++; } #ifdef DEBUG_CC qDebug() << dcounter << gcounter; #endif return count; } void CCBuilder::scanFirstLineLR() { if (!(h*w)) return; QRgb * line = (QRgb *) image.scanLine(0); if (isForeground(0, line[0])) { labels[0] = maxlabel; recolor.append(maxlabel); maxlabel++; } else labels[0] = 0; for (int i = 1; i < w; i++) { if (isForeground(i, line[i])) { if (labels[i-1]) labels[i] = labels[i-1]; else { labels[i] = maxlabel; recolor.append(maxlabel); maxlabel++; } } else labels[i] = 0; } } void CCBuilder::labelLeftmostPoint(int y) { QRgb * line = (QRgb *) image.scanLine(y); if (isForeground(0, line[0])) { int prlabel = labels[w*(y-1)]; if (prlabel) labels[w*y] = prlabel; else { if ((w > 1) && (labels[w*(y-1) + 1] > 0)) { labels[w*y] = labels[w*(y-1) + 1]; } else { labels[w*y] = maxlabel; recolor.append(maxlabel); maxlabel++; } } } else labels[w*y] = 0; } void CCBuilder::labelRightmostPoint(int y) { if (w < 2) return; QRgb * line = (QRgb *) image.scanLine(y); if (isForeground(w-1, line[w-1])) { if (labels[w*y-1]) labels[w*(y+1) - 1] = labels[w*y-1]; else { if (labels[w*y-2]) { labels[w*(y+1) - 1] = labels[w*y-2]; } else if (labels[w*(y+1)-2]) { labels[w*(y+1) - 1] = labels[w*(y+1)-2]; } else { labels[w*(y+1) - 1] = maxlabel; recolor.append(maxlabel); maxlabel++; } } } else labels[w*(y+1) - 1] = 0; } quint8 CCBuilder::getMediumBWBG(quint32 * hist) { quint32 acc = 0; quint32 count = 0; for (int y = 0; y < h; y ++) { quint8 * line = (quint8 *) image.scanLine(y); for(int x = 0; x < w; x++) { if (labels[w*y + x] == 0) { acc +=line[x*4]; hist[line[x*4]]++; count++; } } } if (count != 0) return acc/count; return 255; } void CCBuilder::scanLineLR(int y) { QRgb * line = (QRgb *) image.scanLine(y); for (int i = 1; i < w-1; i++) { labels[w*y + i] = 0; int nc; int oc; oc = maxlabel; if (isForeground(i, line[i])) { nc = labels[w*(y - 1) + i]; if (nc) { labels[w*y + i] = nc; oc = nc; } nc = labels[w*(y - 1) + i - 1]; if ((nc) && (nc <= oc)) { labels[w*y + i] = nc; oc = nc; } nc = labels[w*(y - 1) + i + 1]; if ((nc) && (nc <= oc)) { labels[w*y + i] = nc; oc = nc; } nc = labels[w*y + i - 1]; if ((nc) && (nc <= oc)) { labels[w*y + i] = nc; oc = nc; } if (!labels[w*y + i]) { labels[w*y + i] = maxlabel; recolor.append(maxlabel); maxlabel++; } } } } QRect CCBuilder::crop() { Cropper cropper(this); return cropper.crop(); } quint32 *CCBuilder::scanLine(int y) { return &labels[w*y]; } yagf-0.9.5+repack1/src/core/util.cpp000755 001750 001750 00000006612 13631520722 020636 0ustar00boradminboradmin000000 000000 /*Copyright (C) 2008-2009 Timothy B. Terriberry (tterribe@xiph.org) You can redistribute this library and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.*/ #include #include "util.h" #pragma GCC diagnostic ignored "-Wparentheses" /*Computes floor(sqrt(_val)) exactly.*/ unsigned qr_isqrt(unsigned _val){ unsigned g; unsigned b; int bshift; /*Uses the second method from http://www.azillionmonkeys.com/qed/sqroot.html The main idea is to search for the largest binary digit b such that (g+b)*(g+b) <= _val, and add it to the solution g.*/ g=0; b=0x8000; for(bshift=16;bshift-->0;){ unsigned t; t=(g<<1)+b<>=1; } return g; } /*Computes sqrt(_x*_x+_y*_y) using CORDIC. This implementation is valid for all 32-bit inputs and returns a result accurate to about 27 bits of precision. It has been tested for all postiive 16-bit inputs, where it returns correctly rounded results in 99.998% of cases and the maximum error is 0.500137134862598032 (for _x=48140, _y=63018). Very nearly all results less than (1<<16) are correctly rounded. All Pythagorean triples with a hypotenuse of less than ((1<<27)-1) evaluate correctly, and the total bias over all Pythagorean triples is -0.04579, with a relative RMS error of 7.2864E-10 and a relative peak error of 7.4387E-9.*/ unsigned qr_ihypot(int _x,int _y){ unsigned x; unsigned y; int mask; int shift; int u; int v; int i; x=_x=abs(_x); y=_y=abs(_y); mask=-(x>y)&(_x^_y); x^=mask; y^=mask; _y^=mask; shift=31-qr_ilog(y); shift=QR_MAXI(shift,0); x=(unsigned)((x<>32); _y=(int)((_y<>32); u=x; mask=-(_y<0); x+=_y+mask^mask; _y-=u+mask^mask; u=x+1>>1; v=_y+1>>1; mask=-(_y<0); x+=v+mask^mask; _y-=u+mask^mask; for(i=1;i<16;i++){ int r; u=x+1>>2; r=(1<<2*i)>>1; v=_y+r>>2*i; mask=-(_y<0); x+=v+mask^mask; _y=_y-(u+mask^mask)<<1; } return x+((1U<>1)>>shift; } #if defined(__GNUC__) && defined(HAVE_FEATURES_H) # include # if __GNUC_PREREQ(3,4) # include # if INT_MAX>=2147483647 # define QR_CLZ0 sizeof(unsigned)*CHAR_BIT # define QR_CLZ(_x) (__builtin_clz(_x)) # elif LONG_MAX>=2147483647L # define QR_CLZ0 sizeof(unsigned long)*CHAR_BIT # define QR_CLZ(_x) (__builtin_clzl(_x)) # endif # endif #endif int qr_ilog(unsigned _v){ #if defined(QR_CLZ) /*Note that __builtin_clz is not defined when _x==0, according to the gcc documentation (and that of the x86 BSR instruction that implements it), so we have to special-case it.*/ return QR_CLZ0-QR_CLZ(_v)&-!!_v; #else int ret; int m; m=!!(_v&0xFFFF0000)<<4; _v>>=m; ret=m; m=!!(_v&0xFF00)<<3; _v>>=m; ret|=m; m=!!(_v&0xF0)<<2; _v>>=m; ret|=m; m=!!(_v&0xC)<<1; _v>>=m; ret|=m; ret|=!!(_v&0x2); return ret + !!_v; #endif } #if defined(QR_TEST_SQRT) #include #include /*Exhaustively test the integer square root function.*/ int main(void){ unsigned u; u=0; do{ unsigned r; unsigned s; r=qr_isqrt(u); s=(int)sqrt(u); if(r!=s)printf("%u: %u!=%u\n",u,r,s); u++; } while(u); return 0; } #endif yagf-0.9.5+repack1/src/core/imageprocessor.h000755 001750 001750 00000004066 13631520722 022351 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009 Andrei Borovsky 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 . */ #ifndef IMAGEPROCESSOR_H #define IMAGEPROCESSOR_H #include "qipgrayscaleimage.h" #include "utils.h" #include #include #include class QIPBlackAndWhiteImage; class ImageProcessor : public QObject { Q_OBJECT public: explicit ImageProcessor(QObject *parent = 0); ~ImageProcessor(); QRect crop(); void loadImage(const QImage &image); QImage loadFromFile(const QString &fn); QImage gsImage() const; void binarize(); void altBinarize(); QIPBlackAndWhiteImage fastBinarize(); static void saveForPDF(const QImage &image, const QString &fileName, int squish = 1); void saveYGF(const QImage &image, const QString &fileName); QImage loadYGF(const QString &fileName); static void polishImage(QImage &image); static void polishImage2(QImage &image); static bool isTextHorizontal(QImage &image); static void cropAngles(QImage &image); void flatten(); static void bust(QImage &image); QImage upScale(const QImage &image, bool bolden); QList splitTable(const QRect &bounds); QList splitTableForce(const QRect &bounds); QRect deskewByTable(const QRect &bounds); signals: public slots: private: QIPGrayscaleImage img; private: void normalizeBounds(QRect &bounds, int w, int h); }; #endif // IMAGEPROCESSOR_H yagf-0.9.5+repack1/src/core/common.h000755 001750 001750 00000002131 13631520722 020606 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #ifndef COMMON_H #define COMMON_H #include template void deallocator(T_ buf[]) { delete[] buf; } typedef struct IntRect { int x1, y1, x2, y2; } _IntRect; //#define IPRIT_MULTITHREADING #ifdef IPRIT_MULTITHREADING #include #include #endif #endif // COMMON_H yagf-0.9.5+repack1/src/core/make_style.sh000755 001750 001750 00000000201 12470517140 021632 0ustar00boradminboradmin000000 000000 #!/bin/sh astyle --style=k\&r -l --convert-tabs --pad-header --indent-switches --align-pointer=name --indent=spaces=4 *.cpp *.h yagf-0.9.5+repack1/src/core/pageanalysis.h000755 001750 001750 00000003060 13631520722 022000 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #ifndef PAGEANALYSIS_H #define PAGEANALYSIS_H #include #include #include #include #include #include "ycommon.h" #include "core/analysis.h" class QPixmap; class QImage; class QRect; class BlockSplitter { public: void setImage(const QImage &image, qreal rotation, qreal scale); QRect getRootBlock(const QImage &image); Bars getBars(); // call after something calls blockAllText(); void splitBlocks(); QRect getRotationCropRect(const QImage &image); QList getBlocks(); private: QRect blockAllText(); void splitVertical(); void splitHorisontal(); bool isBlockRecogniseable(const Rect &block); private: QImage img; qreal m_rotate; qreal m_scale; Bars bars; Lines lines; QList blocks; }; #endif yagf-0.9.5+repack1/src/core/imageprocessor.cpp000755 001750 001750 00000025624 13631520722 022707 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #include "imageprocessor.h" #include "qipgrayscaleimage.h" #include "qipblackandwhiteimage.h" #include "subimagepp.h" #include "settings.h" #include "tableanalizer.h" #include #include #include #include #include const uint m_treshold = 0; ImageProcessor::ImageProcessor(QObject *parent) : QObject(parent) { //img = NULL; //bwimg = NULL; } ImageProcessor::~ImageProcessor() { } QRect ImageProcessor::crop() { QRect r; try { QIPBlackAndWhiteImage bwimg1 = QIPBlackAndWhiteImage(img.binarize(QIPGrayscaleImage::OtsuMABinarization)); r = bwimg1.cropGrayScaleImage(img); //bwimg1.free(); img = img.copy(r.x(), r.x()+r.width(), r.y(), r.y()+r.height()); } catch(...) { r.setX(0); r.setY(0); r.setWidth(img.width()); r.setHeight(img.height()); } return r; } void ImageProcessor::loadImage(const QImage &image) { img = QIPGrayscaleImage(image,QIPGrayscaleImage::MinValue); } QImage ImageProcessor::loadFromFile(const QString &fn) { if (!fn.endsWith(".ygf", Qt::CaseInsensitive)) { QImageReader ir(fn); if (!ir.canRead()) return QImage(0,0,QImage::Format_ARGB32); int total = ir.size().width()*ir.size().height(); if ( total > 0x8000000) { ir.setScaledSize(QSize(ir.size().width()/2, ir.size().height()/2)); } return ir.read(); } else { ImageProcessor ipx; return ipx.loadYGF(fn); } } QImage ImageProcessor::gsImage() const { return img.toImage(); } void ImageProcessor::binarize() { img.smoother(); QIPBlackAndWhiteImage bwimg = img.binarize(QIPGrayscaleImage::GatosBinarization); img.blendImage(bwimg); bwimg.width(); //img->darken(235); } void ImageProcessor::altBinarize() { img.smoother(); //QIPBlackAndWhiteImage bwimg = img.binarize(QIPGrayscaleImage::BradleyBinarization); QIPBlackAndWhiteImage bwimg = img.binarize(QIPGrayscaleImage::BernsenBinarization); img.blendImage(bwimg); } QIPBlackAndWhiteImage ImageProcessor::fastBinarize() { //img.smoother(); return img.binarize(QIPGrayscaleImage::BradleyBinarization); } void ImageProcessor::saveForPDF(const QImage &image, const QString &fileName, int squish) { QIPGrayscaleImage img; if (squish > 1) { QImage im = image.scaled(image.width()/squish, image.height()/squish, Qt::KeepAspectRatio, Qt::SmoothTransformation); img = QIPGrayscaleImage::fromImage(im, QIPGrayscaleImage::FastConversion); } else img = QIPGrayscaleImage::fromImage(image, QIPGrayscaleImage::FastConversion); //img.smoother(); QIPBlackAndWhiteImage bwimg = img.binarize(QIPGrayscaleImage::GatosBinarization); QString filename = Settings::instance()->workingDir() + fileName; bwimg.toImage().save(filename); } void ImageProcessor::saveYGF(const QImage &image, const QString &fileName) { //QIPGrayscaleImage gsi(image, QIPGrayscaleImage::MinValue); QIPGrayscaleImage::saveGrayscale(image, fileName); } QImage ImageProcessor::loadYGF(const QString &fileName) { QIPGrayscaleImage gsi(fileName); return gsi.toImage(); } void ImageProcessor::polishImage(QImage &image) { for(int y =1; y < image.height()-1; y++) { QRgb * line = (QRgb *) image.scanLine(y); QRgb * linep = (QRgb *) image.scanLine(y-1); QRgb * linen = (QRgb *) image.scanLine(y+1); //if for (int x = 1; x < image.width()-1; x++) { if (line[x]%255 > 64) { if ((line[x-1]%255 < 64)&&(line[x+1]%255 < 64)) line[x] = 0xFF404040; else if ((linep[x]%255 < 64)&&(linen[x]%255 < 64)) line[x] = 0xFF404040; else if ((linep[x-1]%255 < 64)&&(linen[x+1]%255 < 64)) line[x] = 0xFF404040; else if ((linep[x+1]%255 < 64)&&(linen[x-1]%255 < 64)) line[x] = 0xFF404040; } } } } void ImageProcessor::polishImage2(QImage &image) { /*for (int y = 0; y < image.height(); y++) { quint8 * line = image.scanLine(y); uint strokLen = 24; for (int x = 0; x < image.width()*4 - strokLen*4; x+=strokLen*2) { int strokes[8] = {0}; int xvals[8] = {0}; int curstrok = 0; for (int t = x+4; t < x+strokLen*4; t+=4) { if (abs(line[t]-line[t-4]) > strokes[curstrok]) { strokes[curstrok] = line[t]-line[t-4]; xvals[curstrok] = t; } else curstrok++; if (curstrok >= 8) break; } if (curstrok < 4) break; int start = -1; int stop = -1; int k = 0; while (k < curstrok -1) { if (((strokes[k] < 0)&&(strokes[k+1] < 0))||((strokes[k] > 0)&&(strokes[k+1] > 0))) { strokes[k] += strokes[k+1]; xvals[k] = xvals[k+1]; for (int l = k+1; l < curstrok-1; l++) strokes[l] = strokes[l+1]; curstrok--; } else k++; } if (curstrok < 4) break; for (int m = 1; m < curstrok-1; m++) { if (start < 0) { if (strokes[m-1] < -15) if (strokes[m] > 7) if (-strokes[m-1] > strokes[m]) start = xvals[m]; } else { if (strokes[m-1] < -7) if (strokes[m] > 15) if (strokes[m] > -strokes[m-1]) { stop = xvals[m]; break; } } if (stop > 0) { for (int p = start; p < stop; p +=4) line[p] = 60; } } } }*/ } bool ImageProcessor::isTextHorizontal(QImage &image) { return true; if (image.width() > image.height()) return true; QMap stripes; for (int y = 600; y < image.height() - 600; y++) { quint8 * line = image.scanLine(y); for (int x = 1200; x < image.width()*4 - 1200; x+=160) { if (stripes.contains(x)) { if (line[x] > 128) stripes.insert(x, stripes.value(x)+1); else if (stripes.value(x) < 600) stripes.insert(x, 0); } else stripes.insert(x, 0); } } int longCount = 0; int shortCount = 0; foreach (int count, stripes.values()) { if (count >= 600) longCount++; else shortCount++; } if (longCount*2 > shortCount) return false; if (longCount*3 > shortCount) return true; return true; } void ImageProcessor::cropAngles(QImage &image) { // int prevLen = 0; for (int y = 0; y < image.height(); y++) { QRgb * line = (QRgb *) image.scanLine(y); for (int x = 0; x < image.width(); x++) { if ((line[x]&0x00FFFFFF) == 0) line[x] =0xFFFFFFFF; else break; } for (int x = image.width()-1; x > 0; x--) { if ((line[x]&0x00FFFFFF) == 0) line[x] =0xFFFFFFFF; else break; } } for (int x = 0; x < image.width(); x++) { for (int y = 0; y < image.height(); y++) { QRgb * line = (QRgb *) image.scanLine(y); if ((line[x]&0x00FFFFFF) == 0) line[x] =0xFFFFFFFF; else break; } for (int y = image.height()-1; y > 0 ; y--) { QRgb * line = (QRgb *) image.scanLine(y); if ((line[x]&0x00FFFFFF) == 0) line[x] =0xFFFFFFFF; else break; } } } void ImageProcessor::flatten() { int tr = Settings::instance()->getDarkBackgroundThreshold(); for (int y = 0; y < img.height(); y++) { quint8 * line = img.scanLine(y); for (int x = 0; x < img.width(); x++) { line[x] = line[x] > tr ? 255 : line[x]; } } } void ImageProcessor::bust(QImage &image) { for (int y = 0; y < image.height(); y++) { QRgb * line = (QRgb *) image.scanLine(y); for (int x = 0; x < image.width(); x++) { quint8 ov = line[x] & 0x000000FF; quint32 np = (ov << 16) + (ov << 8) + ov + 0xFF000000; line[x] = np; } } } QImage ImageProcessor::upScale(const QImage &image, bool bolden) { QImage scImage = image.scaled(image.width()*2, image.height()*2, Qt::KeepAspectRatio, Qt::SmoothTransformation); loadImage(scImage); binarize(); if (bolden) { QImage limage = gsImage(); SubimagePP spp(limage); spp.stregthen(); return limage; } else return gsImage(); } QList ImageProcessor::splitTable(const QRect &bounds) { QRect brect = bounds; QIPBlackAndWhiteImage bwi = fastBinarize(); normalizeBounds(brect, bwi.width(), bwi.height()); TableAnalizer ti(&bwi); return ti.splitTable(brect); } QList ImageProcessor::splitTableForce(const QRect &bounds) { QRect brect = bounds; QIPBlackAndWhiteImage bwi = fastBinarize(); normalizeBounds(brect, bwi.width(), bwi.height()); TableAnalizer ti(&bwi); return ti.splitTableForce(brect); } QRect ImageProcessor::deskewByTable(const QRect &bounds) { QRect brect = bounds; QIPBlackAndWhiteImage bwi = fastBinarize(); normalizeBounds(brect, bwi.width(), bwi.height()); TableAnalizer ti(&bwi); Rect r = ti.getSkew(brect); return QRect(r.x1, r.y1, r.x2-r.x1, r.y2-r.y1); } void ImageProcessor::normalizeBounds(QRect &bounds, int w, int h) { if ((bounds.width() == 0)||(bounds.height() == 0)) { bounds.setX(0); bounds.setY(0); bounds.setWidth(w); bounds.setHeight(h); } } yagf-0.9.5+repack1/src/core/binarize.h000755 001750 001750 00000002476 13631520722 021135 0ustar00boradminboradmin000000 000000 #ifndef BINARIZE_H #define BINARIZE_H /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2014 Andrei Borovsky The original code is Copyright (C) 2008-2009 Timothy B. Terriberry (tterribe@xiph.org) 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 . */ #if !defined(_qrcode_binarize_H) # define _qrcode_binarize_H (1) void qr_image_cross_masking_median_filter(unsigned char *_img, int _width,int _height); void qr_wiener_filter(unsigned char *_img,int _width,int _height); /*Binarizes a grayscale image.*/ void qr_binarize(unsigned char *_img,int _width,int _height); unsigned char *qr_binarize1(const unsigned char *_img,int _width,int _height); #endif #endif // BINARIZE_H yagf-0.9.5+repack1/src/core/binarize.cpp000755 001750 001750 00000053676 13631520722 021500 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2014 Andrei Borovsky The original code is Copyright (C) 2008-2009 Timothy B. Terriberry (tterribe@xiph.org) 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 . */ #include #include #include #include "util.h" //#include "image.h" #include "binarize.h" #pragma GCC diagnostic ignored "-Wparentheses" //I afraid to fix this code. I simply supress warnings. Vadik. /*Binarization based on~\cite{GPP06}. @ARTICLE{GPP06, author="Basilios Gatos and Ioannis E. Pratikakis and Stavros J. Perantonis", title="Adaptive Degraded Document Image Binarization", journal="Pattern Recognition", volume=39, number=3, pages="317-327", month=Mar, year=2006 }*/ void wienerFilter(unsigned char *_img,int _width,int _height, int dimensions){ int bufSize = dimensions == 5 ? 8 : 4; unsigned *m_buf[bufSize]; unsigned *sn2_buf[bufSize]; unsigned char g; int x; int y; if(_width<=0||_height<=0)return; m_buf[0]=(unsigned *)malloc((_width+4<<3)*sizeof(*m_buf)); sn2_buf[0]=(unsigned *)malloc((_width+4<<3)*sizeof(*sn2_buf)); for(y=1;y<8;y++){ m_buf[y]=m_buf[y-1]+_width+4; sn2_buf[y]=sn2_buf[y-1]+_width+4; } for(y=-4;y<_height;y++){ unsigned *pm; unsigned *psn2; int i; int j; pm=m_buf[y+2&7]; psn2=sn2_buf[y+2&7]; for(x=-4;x<_width;x++){ unsigned m; unsigned m2; m=m2=0; if(y>=0&&y<_height-4&&x>=0&&x<_width-4)for(i=0;i<5;i++)for(j=0;j<5;j++){ g=_img[(y+i)*_width+x+j]; m+=g; m2+=g*g; } else for(i=0;i<5;i++)for(j=0;j<5;j++){ g=_img[QR_CLAMPI(0,y+i,_height-1)*_width+QR_CLAMPI(0,x+j,_width-1)]; m+=g; m2+=g*g; } pm[x+4]=m; psn2[x+4]=(m2*25-m*m); } pm=m_buf[y&7]; if(y>=0)for(x=0;x<_width;x++){ int sn2; sn2=sn2_buf[y&7][x+2]; if(sn2){ int vn3; int m; /*Gatos et al. give the expression mu+(s2-v2)*(g-mu)/s2 , which we reduce to mu+(s2-v2)*g/s2-(s2-v2)*mu/s2 , g-(v2/s2)*g+(v2/s2)*mu , g+(mu-g)*(v2/s2) . However, s2 is much noisier than v2, and dividing by it often gives extremely large adjustments, causing speckle near edges. Therefore we limit the ratio (v2/s2) to lie between 0 and 1.*/ vn3=0; for(i=-2;i<3;i++){ psn2=sn2_buf[y+i&7]; for(j=0;j<5;j++)vn3+=psn2[x+j]; } m=m_buf[y&7][x+2]; vn3=vn3+1023>>10; sn2=25*sn2+1023>>10; if(vn3=0&&y<_height-4&&x>=0&&x<_width-4)for(i=0;i<5;i++)for(j=0;j<5;j++){ g=_img[(y+i)*_width+x+j]; m+=g; m2+=g*g; } else for(i=0;i<5;i++)for(j=0;j<5;j++){ g=_img[QR_CLAMPI(0,y+i,_height-1)*_width+QR_CLAMPI(0,x+j,_width-1)]; m+=g; m2+=g*g; } pm[x+4]=m; psn2[x+4]=(m2*25-m*m); } pm=m_buf[y&7]; if(y>=0)for(x=0;x<_width;x++){ int sn2; sn2=sn2_buf[y&7][x+2]; if(sn2){ int vn3; int m; /*Gatos et al. give the expression mu+(s2-v2)*(g-mu)/s2 , which we reduce to mu+(s2-v2)*g/s2-(s2-v2)*mu/s2 , g-(v2/s2)*g+(v2/s2)*mu , g+(mu-g)*(v2/s2) . However, s2 is much noisier than v2, and dividing by it often gives extremely large adjustments, causing speckle near edges. Therefore we limit the ratio (v2/s2) to lie between 0 and 1.*/ vn3=0; for(i=-2;i<3;i++){ psn2=sn2_buf[y+i&7]; for(j=0;j<5;j++)vn3+=psn2[x+j]; } m=m_buf[y&7][x+2]; vn3=vn3+1023>>10; sn2=25*sn2+1023>>10; if(vn3=0&&y<_height-2&&x>=0&&x<_width-2)for(i=0;i<3;i++)for(j=0;j<3;j++){ g=_img[(y+i)*_width+x+j]; m+=g; m2+=g*g; } else for(i=0;i<3;i++)for(j=0;j<3;j++){ g=_img[QR_CLAMPI(0,y+i,_height-1)*_width+QR_CLAMPI(0,x+j,_width-1)]; m+=g; m2+=g*g; } pm[x+2]=m; psn2[x+2]=(m2*9-m*m); } pm=m_buf[y&3]; if(y>=0)for(x=0;x<_width;x++){ int sn2; sn2=sn2_buf[y&3][x+1]; if(sn2){ int m; int vn3; /*Gatos et al. give the expression mu+(s2-v2)*(g-mu)/s2 , which we reduce to mu+(s2-v2)*g/s2-(s2-v2)*mu/s2 , g-(v2/s2)*g+(v2/s2)*mu , g+(mu-g)*(v2/s2) . However, s2 is much noisier than v2, and dividing by it often gives extremely large adjustments, causing speckle near edges. Therefore we limit the ratio (v2/s2) to lie between 0 and 1.*/ vn3=0; for(i=-1;i<2;i++){ psn2=sn2_buf[y+i&3]; for(j=0;j<3;j++)vn3+=psn2[x+j]; } m=m_buf[y&3][x+1]; vn3=vn3+31>>5; sn2=9*sn2+31>>5; if(vn30&&_height>0){ unsigned *col_sums; unsigned *col2_sums; int logwindw; int logwindh; int windw; int windh; int y0offs; int y1offs; unsigned g; unsigned g2; int x; int y; /*We keep the window size fairly large to ensure it doesn't fit completely inside the center of a finder pattern of a version 1 QR code at full resolution.*/ for(logwindw=4;logwindw<8&&(1<>3);logwindw++); for(logwindh=4;logwindh<8&&(1<>3);logwindh++); windw=1<>1);y++){ y1offs=QR_MINI(y,_height-1)*_width; for(x=0;x<_width;x++){ g=_img[y1offs+x]; col_sums[x]+=g; col2_sums[x]+=g*g; } } for(y=0;y<_height;y++){ unsigned m; unsigned m2; int x0; int x1; /*Initialize the sums over the window.*/ m=(col_sums[0]<>1);x++){ x1=QR_MINI(x,_width-1); m+=col_sums[x1]; m2+=col2_sums[x1]; } for(x=0;x<_width;x++){ int d; /*Perform the test against the threshold T = (m/n)*(1+k*(s/R-1)), where n=windw*windh, s=sqrt((m2-(m*m)/n)/n), and R=128. We don't actually compute the threshold directly, as that would require a square root. Instead we perform the equivalent test: (m/n)*(m/n)*(m2/n-(m/n)*(m/n))/16 > (((1/k)*g-((1-k)/k)*(m/n))*32)**2 R is split up across each side of the inequality to maximize the dynamic range available for the right hand side, which requires 31 bits in the worst case.*/ /*(m/n)*(1+(1/5)*(sqrt((m2-m*m/n)/n)/128-1)) > g m*(1+(1/5)*(sqrt((m2-m*m/n)/n)/128-1)) > g*n m*sqrt((m2-m*m/n)/n) > 5*g*n-4*m<<7 m*m*(m2*n-m*m) > (5*g*n-4*m<<7)**2*n*n || 5*g*n-4*m < 0 */ g=_img[y*_width+x]; d=(5*g<=0){ unsigned mm; unsigned mms2; unsigned d2; mm=(m>>logwindw)*(m>>logwindh); mms2=(m2-mm>>logwindw+logwindh)*(mm>>logwindw+logwindh)+15>>4; d2=d>>logwindw+logwindh-5; d2*=d2; if(d2>=mms2){ /*Update the background average.*/ b+=g; nb++; _mask[y*_width+x]=0; } else _mask[y*_width+x]=0xFF; } else _mask[y*_width+x]=0xFF; /*Update the window sums.*/ if(x+1<_width){ x0=QR_MAXI(0,x-(windw>>1)); x1=QR_MINI(x+(windw>>1),_width-1); m+=col_sums[x1]-col_sums[x0]; m2+=col2_sums[x1]-col2_sums[x0]; } } /*Update the column sums.*/ if(y+1<_height){ y0offs=QR_MAXI(0,y-(windh>>1))*_width; y1offs=QR_MINI(y+(windh>>1),_height-1)*_width; for(x=0;x<_width;x++){ g=_img[y0offs+x]; col_sums[x]-=g; col2_sums[x]-=g*g; g=_img[y1offs+x]; col_sums[x]+=g; col2_sums[x]+=g*g; } } } free(col2_sums); free(col_sums); } *_b=b; *_nb=nb; } /*Interpolates a background image given the source and a conservative foreground mask. If the current window contains no foreground pixels, the average background value over the whole image is used. Note on dynamic range: we assume _width*_height<=0x8000000 (23 bits). Returns the average difference between the foreground and the interpolated background.*/ static void qr_interpolate_background(unsigned char *_dst, int *_delta,int *_ndelta,const unsigned char *_img,const unsigned char *_mask, int _width,int _height,unsigned _b,int _nb){ int delta; int ndelta; delta=ndelta=0; if(_width>0&&_height>0){ unsigned *col_sums; unsigned *ncol_sums; int logwindw; int logwindh; int windw; int windh; int y0offs; int y1offs; unsigned b; unsigned g; int x; int y; b=_nb>0?((_b<<1)+_nb)/(_nb<<1):0xFF; for(logwindw=4;logwindw<8&&(1<>4);logwindw++); for(logwindh=4;logwindh<8&&(1<>4);logwindh++); windw=1<>1);y++){ y1offs=QR_MINI(y,_height-1)*_width; for(x=0;x<_width;x++)if(!_mask[y1offs+x]){ col_sums[x]+=_img[y1offs+x]; ncol_sums[x]++; } } for(y=0;y<_height;y++){ unsigned n; unsigned m; int x0; int x1; /*Initialize the sums over the window.*/ m=(col_sums[0]<>1);x++){ x1=QR_MINI(x,_width-1); m+=col_sums[x1]; n+=ncol_sums[x1]; } for(x=0;x<_width;x++){ if(!_mask[y*_width+x])g=_img[y*_width+x]; else{ g=n>0?((m<<1)+n)/(n<<1):b; delta+=(int)g-_img[y*_width+x]; ndelta++; } _dst[y*_width+x]=(unsigned char)g; /*Update the window sums.*/ if(x+1<_width){ x0=QR_MAXI(0,x-(windw>>1)); x1=QR_MINI(x+(windw>>1),_width-1); m+=col_sums[x1]-col_sums[x0]; n+=ncol_sums[x1]-ncol_sums[x0]; } } /*Update the column sums.*/ if(y+1<_height){ y0offs=QR_MAXI(0,y-(windh>>1))*_width; y1offs=QR_MINI(y+(windh>>1),_height-1)*_width; for(x=0;x<_width;x++){ if(!_mask[y0offs+x]){ col_sums[x]-=_img[y0offs+x]; ncol_sums[x]--; } if(!_mask[y1offs+x]){ col_sums[x]+=_img[y1offs+x]; ncol_sums[x]++; } } } } free(ncol_sums); free(col_sums); } *_delta=delta; *_ndelta=ndelta; } /*Parameters of the logistic sigmoid function that defines the threshold based on the background intensity. They should all be between 0 and 1.*/ #define QR_GATOS_Q (0.7) #define QR_GATOS_P1 (0.5) #define QR_GATOS_P2 (0.8) /*Compute the final binarization mask according to Gatos et al.'s method~\cite{GPP06}.*/ static void qr_gatos_mask(unsigned char *_mask,const unsigned char *_img, const unsigned char *_background,int _width,int _height, unsigned _b,int _nb,int _delta,int _ndelta){ unsigned thresh[256]; unsigned g; double delta; double b; int x; int y; /*Construct a lookup table for the thresholds. This bit uses floating point, but doesn't need to do much calculation, so emulation should be fine.*/ b=_nb>0?(_b+0.5)/_nb:0xFF; delta=_ndelta>0?(_delta+0.5)/_ndelta:0xFF; for(g=0;g<256;g++){ double d; d=QR_GATOS_Q*delta*(QR_GATOS_P2+(1-QR_GATOS_P2)/ (1+exp(2*(1+QR_GATOS_P1)/(1-QR_GATOS_P1)-4*g/(b*(1-QR_GATOS_P1))))); if(d<1)d=1; else if(d>0xFF)d=0xFF; thresh[g]=(unsigned)floor(d); } /*Apply the adaptive threshold.*/ for(y=0;y<_height;y++)for(x=0;x<_width;x++){ g=_background[y*_width+x]; /*_background[y*_width+x]=thresh[g];*/ _mask[y*_width+x]=(unsigned char)(-(g-_img[y*_width+x]>thresh[g])&0xFF); } /*{ FILE *fout; fout=fopen("thresh.png","wb"); image_write_png(_background,_width,_height,fout); fclose(fout); }*/ } /*Binarizes a grayscale image.*/ void qr_binarize(unsigned char *_img,int _width,int _height){ unsigned char *mask; unsigned char *background; unsigned b; int nb; int delta; int ndelta; /*qr_wiener_filter(_img,_width,_height); { FILE *fout; fout=fopen("wiener.png","wb"); image_write_png(_img,_width,_height,fout); fclose(fout); }*/ mask=(unsigned char *)malloc(_width*_height*sizeof(*mask)); qr_sauvola_mask(mask,&b,&nb,_img,_width,_height); /*{ FILE *fout; fout=fopen("foreground.png","wb"); image_write_png(mask,_width,_height,fout); fclose(fout); }*/ background=(unsigned char *)malloc(_width*_height*sizeof(*mask)); qr_interpolate_background(background,&delta,&ndelta, _img,mask,_width,_height,b,nb); /*{ FILE *fout; fout=fopen("background.png","wb"); image_write_png(background,_width,_height,fout); fclose(fout); }*/ qr_gatos_mask(_img,_img,background,_width,_height,b,nb,delta,ndelta); free(background); free(mask); } /*The above algorithms are computationally expensive, and do not work as well as the simple algorithm below. Sauvola by itself does an excellent job of classifying regions outside the QR code as background, which greatly reduces the chance of false alarms. However, it also tends to over-shrink isolated black dots inside the code, making them easy to miss with even slight mis-alignment. Since the Gatos method uses Sauvola as input to its background interpolation method, it cannot possibly mark any pixels as foreground which Sauvola classified as background, and thus suffers from the same problem. The following simple adaptive threshold method does not have this problem, though it produces essentially random noise outside the QR code region. QR codes are structured well enough that this does not seem to lead to any actual false alarms in practice, and it allows many more codes to be detected and decoded successfully than the Sauvola or Gatos binarization methods.*/ /*A simplified adaptive thresholder. This compares the current pixel value to the mean value of a (large) window surrounding it.*/ unsigned char *qr_binarize1(const unsigned char *_img,int _width,int _height){ unsigned char *mask = NULL; if(_width>0&&_height>0){ unsigned *col_sums; int logwindw; int logwindh; int windw; int windh; int y0offs; int y1offs; unsigned g; int x; int y; mask=(unsigned char *)malloc(_width*_height*sizeof(*mask)); /*We keep the window size fairly large to ensure it doesn't fit completely inside the center of a finder pattern of a version 1 QR code at full resolution.*/ for(logwindw=4;logwindw<8&&(1<>3);logwindw++); for(logwindh=4;logwindh<8&&(1<>3);logwindh++); windw=1<>1);y++){ y1offs=QR_MINI(y,_height-1)*_width; for(x=0;x<_width;x++){ g=_img[y1offs+x]; col_sums[x]+=g; } } for(y=0;y<_height;y++){ unsigned m; int x0; int x1; /*Initialize the sum over the window.*/ m=(col_sums[0]<>1);x++){ x1=QR_MINI(x,_width-1); m+=col_sums[x1]; } for(x=0;x<_width;x++){ /*Perform the test against the threshold T = (m/n)-D, where n=windw*windh and D=3.*/ g=_img[y*_width+x]; mask[y*_width+x]=-(g+3<>1)); x1=QR_MINI(x+(windw>>1),_width-1); m+=col_sums[x1]-col_sums[x0]; } } /*Update the column sums.*/ if(y+1<_height){ y0offs=QR_MAXI(0,y-(windh>>1))*_width; y1offs=QR_MINI(y+(windh>>1),_height-1)*_width; for(x=0;x<_width;x++){ col_sums[x]-=_img[y0offs+x]; col_sums[x]+=_img[y1offs+x]; } } } free(col_sums); } #if defined(QR_DEBUG) { FILE *fout; fout=fopen("binary.png","wb"); image_write_png(_img,_width,_height,fout); fclose(fout); } #endif return(mask); } #if defined(TEST_BINARIZE) #include #include "image.c" int main(int _argc,char **_argv){ unsigned char *img; int width; int height; int x; int y; if(_argc<2){ fprintf(stderr,"usage: %s .png\n",_argv[0]); return EXIT_FAILURE; } /*width=1182; height=1181; img=(unsigned char *)malloc(width*height*sizeof(*img)); for(y=0;y 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 . */ #ifndef SUBIMAGEPP_H #define SUBIMAGEPP_H #include #include "ccbuilder.h" #include "analysis.h" class SubimagePP { public: explicit SubimagePP(QImage &image); ~SubimagePP(); void fillComponents(); void removeBars(); void removeNoise(); void stregthen(); signals: public slots: private: void labelsToBackground(QSet &labels); private: QImage &img; CCBuilder ccbuilder; QList components; quint32 color; Bars bars; int mgw, mgh; quint32 darkestBG; }; #endif // SUBIMAGEPP_H yagf-0.9.5+repack1/src/core/tableanalizer-1.cpp000755 001750 001750 00000023572 13631520722 022640 0ustar00boradminboradmin000000 000000 #include "tableanalizer.h" #include "qipblackandwhiteimage.h" #include "ccbuilder.h" enum State { Start, InLine, AfterLine }; const quint8 clBWWhite = 1; const quint8 clBWBlack = 0; TableAnalizer::TableAnalizer(QIPBlackAndWhiteImage *image) : img(image), blocks() { } QList TableAnalizer::splitTable(const QRect &bounds) { if (!findRect(bounds)) return blocks; // clearImage(); //img->toImage().save("0000A.png"); int cLabel = maxRect.label + 1; for (int y = maxRect.y1+1; y < maxRect.y2; y++) { quint8 * line = img->scanLine(y); quint8 * prevLine = img->scanLine(y - 1); for (int x = maxRect.x1+1; x < maxRect.x2-1; x++) { if (line[x] == clBWWhite) { if (line[x-1] > maxRect.label) { line[x] = line[x-1]; } else { if (prevLine[x] > maxRect.label) { line[x] = prevLine[x]; } else { if (prevLine[x+1] > maxRect.label) { line[x] = prevLine[x+1]; } else { if (prevLine[x-1] > maxRect.label) { line[x] = prevLine[x-1]; } else { cLabel++; line[x] = cLabel; } } } } updateComponents(x, y, line[x]); } else { } } } for (int i = blocks.count() - 1; i > -1; i--) if (blocks.at(i).label == maxRect.label) { blocks.removeAt(i); break; } clearGarbage(); img = 0; return blocks; } QList TableAnalizer::splitTableForce(const QRect &bounds) { if (!findRect(bounds)) return blocks; blocks.clear(); addBars(bounds); clearGarbage(); return blocks; } bool TableAnalizer::findRect(const QRect &bounds) { // connectLine(bounds); CCBuilder ccbuilder(img->toImage()); ccbuilder.labelCCs(); for (int y = bounds.y(); y < bounds.y() + bounds.height(); y++) { quint32 * line = ccbuilder.scanLine(y); for (int x = bounds.x(); x < bounds.x()+ bounds.width(); x++) { if (line[x] > 0) updateComponents(x, y, line[x]); } } bool result = findMax(bounds); for (int y = bounds.y(); y < bounds.y() + bounds.height(); y++) { quint32 * line = ccbuilder.scanLine(y); quint8 * out = img->scanLine(y); for (int x = bounds.x(); x < bounds.x() + bounds.width(); x++) { if (line[x] == maxRect.label) out[x] = clBWBlack; else out[x] = clBWWhite; } } img->toImage().save("/home/parallels/A0.png"); return result; } void TableAnalizer::updateComponents(int x, int y, int label) { Rect r; for (int i = 0; i < blocks.count(); i++) { if (blocks.at(i).label == label) { r = blocks.at(i); if (x < r.x1) r.x1 = x; if (y < r.y1) r.y1 = y; if (x > r.x2) r.x2 = x; if (y > r.y2) r.y2 = y; r.dotCount++; blocks.removeAt(i); blocks.prepend(r); return; } } r.x1 = x; r.y1 = y; r.x2 =x; r.y2 =y; r.dotCount = 1; r.label = label; blocks.prepend(r); } bool TableAnalizer::findMax(const QRect &bounds) { /*quint8 colorMax = clBWWhite > clBWBlack ? clBWWhite : clBWBlack; for (int y = 0; y < img->height(); y++) { quint8 * line = img->scanLine(y); for (int x = 0; x < img->width(); x++) { if (line[x] > colorMax ) line[x] = clBWBlack; } }*/ if (blocks.count() == 0) return false; maxRect = blocks.at(0); for (int i = 1; i < blocks.count(); i++) { Rect r = blocks.at(i); if ((r.x2 - r.x1)*(r.y2 -r.y1) > (maxRect.x2- maxRect.x1)*(maxRect.y2 - maxRect.y1)) if (r.dotCount > 200) maxRect = r; } blocks.clear(); if ((maxRect.x2- maxRect.x1)*(maxRect.y2 - maxRect.y1) > bounds.width()*bounds.height()/4) return true; return false; } void TableAnalizer::clearImage() { for (int y = 0; y < img->height(); y++) { quint8 * line = img->scanLine(y); for (int x = 0; x < img->width(); x++) { quint8 color = line[x]; if (color != maxRect.label) line[x] = clBWWhite; else line[x] = clBWBlack; } } /* for (int y = 0; y < 200; y++) { quint8 * line = img->scanLine(y); for (int x = 0; x < 200; x++) { line[x] = clBWBlack; } }*/ img->toImage().save("/home/parallels/A0.png"); } bool __contains(Rect &r1, Rect &r2) { if ((r2.x1 >= r1.x1)&&(r2.y1 >= r1.y1)) if ((r2.x2 <= r1.x2)&&(r2.y2 <= r1.y2)) return true; return false; } bool __intersects(Rect &r1, Rect &r2) { if ((r2.x1 >= r1.x1)&&(r2.y1 >= r1.y1)) if ((r2.x1 <= r1.x2)&&(r2.y1 <= r1.y2)) return true; return false; } void TableAnalizer::clearGarbage() { for (int i = blocks.count()-1; i > -1; i--) { Rect r = blocks.at(i); if ((r.x2-r.x1)*(r.y2-r.y1)<100) blocks.removeAt(i); else { if ((r.x2-r.x1) < 10) blocks.removeAt(i); else { if ((r.y2-r.y1) < 10) blocks.removeAt(i); } } } int c = blocks.count(); int i = 0; while(i < c) { Rect r = blocks.at(i); for (int j = i+1; j < c; j++) { Rect r1 = blocks.at(j); if (__contains(r, r1)) { blocks.removeAt(j); c--; i--; break; } if (__contains(r1, r)) { blocks.removeAt(i); c--; i--; break; } if (__intersects(r, r1)){ blocks.removeAt(i); c--; i--; break; } if (__intersects(r1, r)){ blocks.removeAt(i); c--; i--; break; } } i++; } } void TableAnalizer::drawHorzLine(int y, int minx, int maxx) { quint8 * line = img->scanLine(y); for (int x = minx; x < maxx; x++) line[x] = clBWBlack; } void TableAnalizer::drawVertLine(int x, int miny, int maxy) { for (int y = miny; y < maxy; y++) { quint8 * line = img->scanLine(y); line[x] = clBWBlack; } } const int stride = 100; const int thr = 90; static int hPixelsCount; void TableAnalizer::addBars(const QRect &bounds) { drawHorzLine(maxRect.y1+1, bounds.x(), bounds.x() + bounds.width()); drawHorzLine(maxRect.y2-1, bounds.x(), bounds.x() + bounds.width()); drawVertLine(maxRect.x1+1, bounds.y(), bounds.y() + bounds.height()); drawVertLine(maxRect.x2-1, bounds.y(), bounds.y() + bounds.height()); int prevHLine = maxRect.y1 + 1; int currentHLine = maxRect.y2-1; for (int y = maxRect.y1+3; y < maxRect.y2-3; y++) { int count = 0; if (findHorzLine(y, maxRect.x1, maxRect.x2, count)) { drawHorzLine(y, bounds.x(), bounds.x() + bounds.width()); Rect r; r.x1 = maxRect.x1; r.x2 = maxRect.x2; r.y1 = prevHLine; r.y2 = y; blocks.append(r); prevHLine = y+2; y+=8; break; } } Rect r; r.x1 = maxRect.x1; r.x2 = maxRect.x2; r.y1 = prevHLine; r.y2 = currentHLine; blocks.append(r); clearGarbage(); for (int x = maxRect.x1+3; x < maxRect.x2-3; x++) { int count = 0; for (int y = bounds.y(); y < bounds.y() + bounds.height(); y++) { quint8 * line = img->scanLine(y); if (count >= 150) { drawVertLine(x, bounds.y(), bounds.y() + bounds.height()); int bc = blocks.count(); for (int i = 0; i < bc;) { if ((x > blocks.at(i).x1)&&(x < blocks.at(i).x2)) { Rect r = blocks.at(i); Rect r1 = r; Rect r2 = r; r1.x2 = x-1; r2.x1 = x+1; blocks.removeAt(i); blocks.append(r1); blocks.append(r2); bc--; } else i++; } x +=8; break; } if (line[x] == clBWBlack) count++; else { if ((line[x-1] != clBWBlack)&&(line[x+1] != clBWBlack)) count = 0; else count++; } } } } bool TableAnalizer::findHorzLine(qint32 y, qint32 xstart, qint32 xstop, int count) { for (int x = xstart; x <= xstop; x++) { if (img->pixel(x, y) == clBWBlack) { count++; if (count >=150) return true; if (img->pixel(x+1, y) == clBWWhite) { if (img->pixel(x+1, y-1) == clBWBlack) { if (findHorzLine(y-1, x+1, xstop, count) == true) return true; } else { if (img->pixel(x+1, y+1) == clBWBlack) { if (findHorzLine(y+1, x+1, xstop, count) == true) return true; } } } } else { if (count >= 150) return true; count = 0; } } return count == 150; } yagf-0.9.5+repack1/src/core/pixelwindow.cpp000755 001750 001750 00000005424 13631520722 022232 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #include "pixelwindow.h" PixelWindow::PixelWindow(QIPBlackAndWhiteImage * image, int x, int y, int width, int height) { img = image; gsimg = 0; xStart = x; yStart = y; w = width; h = height; iw = image->width(); lines = new quint8 * [h]; int yt = yStart; while ((yt < 0)&&(yt - yStart < h)) { lines[yt - yStart] = 0; yt++; } while (yt + h < (int) img->height()) { lines[yt] = img->scanLine(yt - yStart); } while (yt - yStart < h) { lines[yt - yStart] = 0; yt++; } } PixelWindow::PixelWindow(QIPGrayscaleImage *image, int x, int y, int width, int height) { img = 0; gsimg = image; xStart = x; yStart = y; w = width; h = height; iw = image->width(); lines = new quint8 * [h]; int yt = yStart; while ((yt < 0)&&(yt - yStart < h)) { lines[yt - yStart] = 0; yt++; } while (yt + h < gsimg->height()) { lines[yt] = gsimg->scanLine(yt - yStart); } while (yt - yStart < h) { lines[yt - yStart] = 0; yt++; } } PixelWindow::~PixelWindow() { delete[] lines; } void PixelWindow::move(int newX, int newY) { xStart = newX; yStart = newY; delete[] lines; lines = new quint8 * [h]; int yt = yStart; while ((yt < 0)&&(yt - yStart < h)) { lines[yt - yStart] = 0; yt++; } if (gsimg == 0) { while (yt + h < (int) img->height()) { lines[yt] = img->scanLine(yt - yStart); } } else { while (yt + h < gsimg->height()) { lines[yt] = gsimg->scanLine(yt - yStart); } } while (yt - yStart < h) { lines[yt - yStart] = 0; yt++; } } quint8 PixelWindow::pixel(int x, int y) { int yt = yStart - y; if (lines[yt] == 0) return 255; if (x < 0) return 255; if ((x < xStart)||(x+xStart >= iw)) return 255; return lines[yt][xStart+x]; } yagf-0.9.5+repack1/src/core/util.h000755 001750 001750 00000004175 13631520722 020305 0ustar00boradminboradmin000000 000000 #ifndef UTIL_H #define UTIL_H /*Copyright (C) 2008-2009 Timothy B. Terriberry (tterribe@xiph.org) You can redistribute this library and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.*/ #if !defined(_qrcode_util_H) # define _qrcode_util_H (1) #define QR_MAXI(_a,_b) ((_a)-((_a)-(_b)&-((_b)>(_a)))) #define QR_MINI(_a,_b) ((_a)+((_b)-(_a)&-((_b)<(_a)))) #define QR_SIGNI(_x) (((_x)>0)-((_x)<0)) #define QR_SIGNMASK(_x) (-((_x)<0)) /*Unlike copysign(), simply inverts the sign of _a if _b is negative.*/ #define QR_FLIPSIGNI(_a,_b) ((_a)+QR_SIGNMASK(_b)^QR_SIGNMASK(_b)) #define QR_COPYSIGNI(_a,_b) QR_FLIPSIGNI(abs(_a),_b) /*Divides a signed integer by a positive value with exact rounding.*/ #define QR_DIVROUND(_x,_y) (((_x)+QR_FLIPSIGNI(_y>>1,_x))/(_y)) #define QR_CLAMPI(_a,_b,_c) (QR_MAXI(_a,QR_MINI(_b,_c))) #define QR_CLAMP255(_x) ((unsigned char)((((_x)<0)-1)&((_x)|-((_x)>255)))) /*Swaps two integers _a and _b if _a>_b.*/ #define QR_SORT2I(_a,_b) \ do{ \ int t__; \ t__=QR_MINI(_a,_b)^(_a); \ (_a)^=t__; \ (_b)^=t__; \ } \ while(0) #define QR_ILOG0(_v) (!!((_v)&0x2)) #define QR_ILOG1(_v) (((_v)&0xC)?2+QR_ILOG0((_v)>>2):QR_ILOG0(_v)) #define QR_ILOG2(_v) (((_v)&0xF0)?4+QR_ILOG1((_v)>>4):QR_ILOG1(_v)) #define QR_ILOG3(_v) (((_v)&0xFF00)?8+QR_ILOG2((_v)>>8):QR_ILOG2(_v)) #define QR_ILOG4(_v) (((_v)&0xFFFF0000)?16+QR_ILOG3((_v)>>16):QR_ILOG3(_v)) /*Computes the integer logarithm of a (positive, 32-bit) constant.*/ #define QR_ILOG(_v) ((int)QR_ILOG4((unsigned)(_v))) /*Multiplies 32-bit numbers _a and _b, adds (possibly 64-bit) number _r, and takes bits [_s,_s+31] of the result.*/ #define QR_FIXMUL(_a,_b,_r,_s) ((int)((_a)*(long long)(_b)+(_r)>>(_s))) /*Multiplies 32-bit numbers _a and _b, adds (possibly 64-bit) number _r, and gives all 64 bits of the result.*/ #define QR_EXTMUL(_a,_b,_r) ((_a)*(long long)(_b)+(_r)) unsigned qr_isqrt(unsigned _val); unsigned qr_ihypot(int _x,int _y); int qr_ilog(unsigned _val); #endif #endif // UTIL_H yagf-0.9.5+repack1/src/core/rotationcropper.cpp000755 001750 001750 00000014102 13631520722 023104 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2010 Andrei Borovsky 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 . */ #include "rotationcropper.h" #include #include RotationCropper::RotationCropper(QImage * image, QRgb color) { this->image = image; darksCount = 0; lightsCount = 0; minval = 0; maxval = 0; //clAltCount = whitetr = 650; clBrighttoWidthtr = 0.1; //QRgb * line = (QRgb *) image->scanLine(0); whitePixel = color; //replaceColor = color; } RotationCropper::~RotationCropper() {} QRect RotationCropper::crop() { y1 = 0; int tolerance = 3; recolor(); for (int y = 0; y < image->height(); y ++) { if (checkHorzLine(y)) { tolerance--; if (tolerance == 0) { y1 = y; break; } } else tolerance = 3; } y2 = image->height()-1; tolerance = 3; for (int y = y2; y >= 0; y--) { if (checkHorzLine(y)) { tolerance--; if (tolerance == 0) { y2 = y; break; } } else tolerance = 3; } x1 = 0; tolerance = 3; for (int x = x1; x < image->width(); x++) { if (checkVertLine(x)) { tolerance--; if (tolerance == 0) { x1 = x; break; } } else tolerance = 3; } x2 = image->width()-1; tolerance = 3; for (int x = x2; x >= 0; x--) { if (checkVertLine(x)) { tolerance--; if (tolerance == 0) { x2 = x; break; } } else tolerance = 3; } return QRect(x1, y1, x2-x1, y2-y1); } void RotationCropper::recolor() { QColor repColor(1,2,3); for (int y = 0; y < image->height(); y++) { QRgb * line = (QRgb *) image->scanLine(y); for (int x = 0; x < image->width(); x++) { if (line[x] == whitePixel ) line[x] = repColor.rgb(); else break; } for (int x = image->width() - 1; x >= 0; x--) { if (line[x] == whitePixel ) line[x] = repColor.rgb(); else break; } } } bool RotationCropper::checkHorzLine(int y) { int skipCount = 0; darksCount = 0; lightsCount = 0; minval = 800; maxval = 0; whitesCount = 0; //clAltCount = 0; whiteAlt = 0; //int maxlstripe = 0; //int currentlstripe = 0; QRgb * line = (QRgb *) image->scanLine(y); for (int i = 0; i < image->width(); i++) { if ((qRed(line[i]) == 1) && (qGreen(line[i]) == 2) && (qBlue(line[i]) == 3)) { skipCount++; continue; } int pixel = qRed(line[i]) + qGreen(line[i]) + qBlue(line[i]); if (pixel <= 382) { darksCount++; // if (currentlstripe > maxlstripe) maxlstripe = currentlstripe; // currentlstripe = 0; } else { lightsCount++; // currentlstripe++; if (pixel >= whitetr) { whitesCount++; if (whiteAlt == 0) { whiteAlt = 1; clWhiteCount++; } } else whiteAlt = 0; } minval = pixel < minval ? pixel : minval; maxval = pixel > maxval ? pixel : maxval; } qreal d = image->width() - skipCount; if (d == 0) return false; clBrighttoWidth = (qreal)lightsCount/d; if (clBrighttoWidth <= clBrighttoWidthtr) return false; if (maxval - minval < 40) return false; //if (clAltCount < 10) // return false; //if (maxlstripe < 10) // return false; // if ((clWhiteCount > 0)&&(clWhiteCount < 3)) // return false; return true; } bool RotationCropper::checkVertLine(int x) { int skipCount = 0; darksCount = 0; lightsCount = 0; minval = 800; maxval = 0; whitesCount = 0; //clAltCount = 0; whiteAlt = 0; //int curline =0; for (int y = 0; y < image->height(); y++) { QRgb * line = (QRgb *) image->scanLine(y); if ((qRed(line[x]) == 1) && (qGreen(line[x]) == 2) && (qBlue(line[x]) == 3)) { skipCount++; continue; } int pixel = qRed(line[x]) + qGreen(line[x]) + qBlue(line[x]); if (pixel <= 382) { darksCount++; // if (curline) { // clAltCount++; // curline = 0; // } } else { lightsCount++; // if (!curline) { // clAltCount++; // curline = 1; // } if (pixel >= whitetr) { whitesCount++; if (whiteAlt == 0) { whiteAlt = 1; clWhiteCount++; } } else whiteAlt = 0; } minval = pixel < minval ? pixel : minval; maxval = pixel > maxval ? pixel : maxval; } qreal d = image->height() - skipCount; if (d == 0) return false; clBrighttoWidth = (qreal)lightsCount/d; if (clBrighttoWidth <= clBrighttoWidthtr) return false; if (maxval - minval < 40) return false; // if (clAltCount < 10) // return false; if ((clWhiteCount > 0)&&(clWhiteCount < 3)) return false; return true; } yagf-0.9.5+repack1/src/core/analysis.cpp000755 001750 001750 00000034021 13631520722 021477 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2011 Andrei Borovsky 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 . */ #include "analysis.h" #include "utils.h" #include bool operator==(Rect r1, Rect r2) { if (r1.x1 != r2.x1) return false; if (r1.y1 != r2.y1) return false; if (r1.x2 != r2.x2) return false; if (r1.y2 != r2.y2) return false; return true; } bool operator==(GlyphInfo g1, GlyphInfo g2) { if (g1.x != g2.x) return false; if (g1.y != g2.y) return false; if (g1.h != g2.h) return false; return true; } CCAnalysis::CCAnalysis(CCBuilder * builder) { this->builder = builder; glyphCount = 0; mediumGlyphHeight = 0; mediumGlyphWidth = 0; mediumLetterSpace = 0; mediumWordSpace = 0; stringsCount = 0; } CCAnalysis::~CCAnalysis() { } bool CCAnalysis::analize(bool extractBars) { if (extractComponents(extractBars)) { classifyGlyphs(); normalizeLines(); return true; } return false; } void CCAnalysis::tableAnalise() { if (extractComponents(false)) { classifyGlyphs(); } } Bars CCAnalysis::addBars() { extractComponents(true); addBarsHorizontal(); addBarsVertical(); addBarsHorisontalAfterVertical(); return bars; } Bars CCAnalysis::getBars() { return bars; } int listContains(QList &list, int label) { foreach (Rect r, list) { if (r.label == label) { return list.indexOf(r); } } return -1; } bool CCAnalysis::extractComponents(bool extractBars) { fillComponents(); if (components.count() == 0) return false; if (extractBars) { doExtractBars(); } int wacc = 0; int hacc= 0; int count = 0; foreach(Rect r, components.values()) { wacc += (r.x2 - r.x1); hacc +=(r.y2 - r.y1); count++; } if (count == 0) return false; int wmed = wacc/count; int hmed = hacc/count; foreach(quint32 k, components.keys()) { Rect r = components.value(k); if ((r.x2 - r.x1) > 6*wmed) components.remove(k); else { int s = (r.y2 - r.y1)*(r.x2 - r.x1); if (( s < 30) || ((r.y2 - r.y1) > 4*hmed)) components.remove(k); else { if (s == 0) components.remove(k); else if (((double)r.dotCount/(double)s) < 0.1) components.remove(k); } } } return getComponentParams(); } int CCAnalysis::getGlyphBoxCount() { return components.count(); } Rect CCAnalysis::getGlyphBox(int index) { return components.values().at(index); } void CCAnalysis::classifyGlyphs() { foreach (Rect r, components) { glyphField.insert(r.x1, r); } } TextLine CCAnalysis::extractLine() { Rect first; //QPoint firstpt; TextLine line; for (int x =0; x < builder->width(); x++) { if (glyphField.values(x).count()) { first = glyphField.values(x).at(0); glyphField.remove(x, first); line.append(ginfo((first.x1+first.x2)/2, (first.y1+first.y2)/2, abs(first.y1-first.y2))); break; } } if (line.count()) { Rect temp = first; while (findAdjacent(temp) >= 0) { line.append(ginfo((temp.x1+temp.x2)/2, (temp.y1+temp.y2)/2, abs(temp.y1-temp.y2))); } } return line; } int CCAnalysis::findAdjacent(Rect &r) { int startx = (r.x1+r.x2)/2; int xspan = (r.x2 - r.x1)*4; int ymid = (r.y1+r.y2)/2; int endx = startx + xspan; for (int x=startx; x = r1.y1) && (ymid <= r1.y2)) { r = r1; glyphField.remove(x, r1); return x; } } } return -1; } void CCAnalysis::normalizeLines() { k = 0; int count = 0; TextLine l = extractLine(); while (l.count()) { lines.append(l); if (l.count() > 4) { if (abs (l.last().h - l.first().h) < 3) { qreal d = l.last().x - l.first().x; if (d != 0) { k = k + ((qreal)(l.last().y - l.first().y))/d; count++; } } else { int lastX = l.at(l.count()-1).x; int lastY = l.at(l.count()-1).y; int lastH = l.at(l.count()-1).h; int firstX = l.at(1).x; int firstY = l.at(1).y; int firstH = l.at(1).h; if (abs (lastH - firstH) < 3) { qreal d = lastX - firstX; if (d != 0) { k = k + ((qreal)(lastY - firstY))/d; count++; } } } } //graphicsInput->drawLine(l.at(0).x()*2, l.at(0).y()*2, l.at(l.count()-1).x()*2,l.at(l.count()-1).y()*2); l = extractLine(); } if (count) k = k/count; } Lines CCAnalysis::getLines() { return lines; } qreal CCAnalysis::getK() { return k; } void CCAnalysis::rotatePhi(qreal phi, const QPoint &c, QPoint &p) { int x = p.x() - c.x(); int y = p.y() - c.y(); int x1 = x*cos(phi) - y*sin(phi); int y1 = x*sin(phi) + y*cos(phi); p.setX(x1+c.x()); p.setY(y1+c.y()); } void CCAnalysis::addBarsHorizontal(int hoffset, int height, int woffset, int width) { bool * li = new bool[builder->height()]; if (height < 0) height = builder->height(); if (width < 0) width = builder->width(); for (int i = hoffset; i < height; i++) li[i] = false; foreach (TextLine tl, lines) { if (tl.count() == 1) continue; foreach(GlyphInfo gi, tl) // OPTIMIZE if (_contains(woffset, width, gi.x)) { for (int i = gi.y - gi.h/2; i < gi.y + gi.h/2; i++) li[i] = true; } } int him = 0; int hlm = 0; int lcount = 0; int icount = 0; int chl = 0; int chi = 0; for (int i= hoffset; i < height; i++) { if (!li[i]) { // empty space if (chl > 0) { hlm += chl; lcount++; chl = 0; } chi++; } else { if (chi > 0) { if (icount > 0) him += chi; icount++; chi = 0; } chl++; } } if ((icount < 3)||(lcount == 0)) { delete[] li; return; } him -= chi; him = him/(icount-2); hlm /= lcount; int ilcount = 0; int llcount = 0; for (int i = hoffset; i < height; i++) { if (!li[i]) { ilcount++; } else { if (ilcount >= 5*him) { Rect r; r.x1 = woffset; r.x2 = width-1; r.y1 = 0; for (int j = i - 3*him; j < i; j++) { if ((!li[j-1]) && (!li[j]) && (!li[j+1])) { r.y1 = j; break; } } if (r.y1 > 0) { r.y2 = r.y1; bars.append(r); } } ilcount = 0; llcount++; } } delete[] li; } void CCAnalysis::addBarsHorisontalAfterVertical() { Rect r; r.y1 = 0; r.y2 = builder->height(); r.x1 = builder->width(); r.x2 = r.x1; verts.append(r); for (int i = 1; i < verts.count(); i++) { addBarsHorizontal(0, -1, verts[i-1].x2, verts[i].x1); } } /*void CCAnalysis::addBarsHorizontal() { bool * li = new bool[builder->height()]; for (int i = 0; i < builder->height(); i++) li[i] = false; int hlm = 0; foreach (TextLine tl, lines) hlm += tl.first().h; hlm /= lines.count(); foreach (TextLine tl, lines) { if (tl.count() < 3) if (tl.first().x > lines.first().first().x + 64) continue; for (int i = (tl.first().y - hlm < 0 ? 0 : tl.first().y - hlm); i < (tl.last().y + hlm > builder->height() ? builder->height() : tl.last().y + hlm); i++) li[i] = true; //for (int i = (tl.last().y - tl.last().h < 0 ? 0 : tl.last().y - tl.last().h); i < (tl.last().y + tl.last().h > builder->height() ? builder->height() : tl.last().y + tl.last().h); i++) // li[i] = true; } int fcount = 0; for (int i = 0; i < builder->height(); i++) { if (!li[i]) fcount++; else { if (fcount >= hlm*1.5) { Rect r; r.x1 = 0; r.x2 = builder->width()-1; r.y1 = i - hlm/2; r.y2 = r.y1; bars.append(r); fcount = 0; } } } delete[] li; }*/ void CCAnalysis::addBarsVertical() { int * li = new int[builder->width()]; for (int i = 0; i < builder->width(); i++) li[i] = 0; foreach(Rect c, components.values()) { for (int j = c.x1; j <= c.x2; j++) li[j]++; } int liprev = 1000; for (int i = 0; i < builder->width(); i++) { if (li[i] < 3) { if (liprev >= 3) { Rect r; r.x1 = i < builder->width() -5 ? i + 5 : i; r.x2 = r.x1; r.y1 = 0; r.y2 = builder->height()-1; bars.append(r); verts.append(r); } } else if (liprev < 3) { Rect r; r.x1 = i > 3 ? i - 3 : i-1; r.x2 = r.x1; r.y1 = 0; r.y2 = builder->height()-1; bars.append(r); verts.append(r); } liprev = li[i]; } delete[] li; } void CCAnalysis::rotateLines(qreal phi, const QPoint &c) { for (int i = 0; i < lines.count(); i++) { TextLine l = lines.at(i); for (int j =0; j < l.count(); j++) { QPoint p = QPoint(l.at(j).x, l.at(j).y); rotatePhi(phi, c, p); ginfo g = l.at(j); g.x = p.x(); g.y = p.y(); l.replace(j, g); } lines.replace(i, l); } } void CCAnalysis::fillComponents() { components.clear(); for (int y = 0; y < builder->height(); y++) { quint32 * line = builder->scanLine(y); for (int x = 0; x < builder->width(); x++) { quint32 label; //= builder->label(x,y); if ((label = line[x]) != 0) { Rect r; r.dotCount = 0; r.x1 = builder->width(); r.x2 = 0; r.y1 = builder->height(); r.y2 = 0; r.label = label; if (!components.contains(label)) components.insert(label, r); r = components.value(label); r.dotCount++; if (x < r.x1) r.x1 = x; if (x > r.x2) r.x2=x; if (y r.y2) r.y2 = y; components.remove(label); components.insert(label,r); } } } } bool CCAnalysis::getComponentParams() { int wacc = 0; int hacc= 0; int count = 0; foreach(Rect r, components.values()) { wacc += (r.x2 - r.x1); hacc +=(r.y2 - r.y1); count++; } if (count == 0) return false; int wmed = wacc/count; int hmed = hacc/count; mediumGlyphWidth = wmed; mediumGlyphHeight = hmed; glyphCount = count; return true; } void CCAnalysis::doExtractBars() { foreach(quint32 k, components.keys()) { Rect r = components.value(k); int deltaX = abs(r.x2 - r.x1); // TODO: remove abs() if not needed int deltaY = abs(r.y2 - r.y1); // TODO: remove abs() if not needed if ((deltaX > 10)&&(deltaY > 10)) continue; if (deltaX != 0) { if (deltaY/deltaX >= BarRatio) { components.remove(k); bars.append(r); continue; } } else { if (deltaY >= BarRatio) { components.remove(k); bars.append(r); continue; } } if (deltaY != 0) { if (deltaX/deltaY >= BarRatio) { components.remove(k); bars.append(r); continue; } } else { if (deltaX >= BarRatio) { components.remove(k); bars.append(r); continue; } } } } QList CCAnalysis::getAllComponents(bool extractBars) { fillComponents(); if (extractBars) { bars.clear(); doExtractBars(); } getComponentParams(); return components.values(); } int CCAnalysis::getMediumGlyphWidth() { return mediumGlyphWidth; } int CCAnalysis::getMediumGlyphHeight() { return mediumGlyphHeight; } ginfo::ginfo(int a1, int a2, int a3) { x = a1; y = a2; h = a3; } int CCAnalysis::getGlyphCount() { return glyphCount; } QList CCAnalysis::getGlyphs() { return components.values(); } yagf-0.9.5+repack1/src/core/tableanalizer.h000755 001750 001750 00000003213 13631520722 022135 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2015 Andrei Borovsky 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 . */ #ifndef TABLEANALIZER_H #define TABLEANALIZER_H #include "../utils.h" #include #include class QIPBlackAndWhiteImage; class TableAnalizer { public: TableAnalizer(QIPBlackAndWhiteImage *image); QList splitTable(const QRect &bounds); QList splitTableForce(const QRect &bounds); Rect getSkew(const QRect &bounds); private: QIPBlackAndWhiteImage * img; Rect maxRect; QList blocks; private: bool findRect(const QRect &bounds); void updateComponents(int x, int y, int label); bool findMax(const QRect &bounds); void clearImage(); void clearGarbage(); void drawHorzLine(int y, int minx, int maxx); void drawVertLine(int x, int miny, int maxy); void addBars(const QRect &bounds); QList sortBlocks(const QList &blocks); Rect getSkew2(const QRect &bounds); }; #endif // TABLEANALIZER_H yagf-0.9.5+repack1/src/core/analysis.h000755 001750 001750 00000006162 13631520722 021151 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2011 Andrei Borovsky 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 . */ #ifndef ANALYSIS_H #define ANALYSIS_H #include "ccbuilder.h" #include "utils.h" #include //#include #include #include #include #include bool operator==(Rect r1, Rect r2); typedef QHash ComponentParameters; typedef QList Strings; typedef QList StringsBoxes; typedef QMultiHash GlyphField; typedef struct ginfo { ginfo(int a1, int a2, int a3); int h; int x; int y; } GlyphInfo; bool operator==(GlyphInfo g1, GlyphInfo g2); typedef QList TextLine; typedef QMultiHash LineField; typedef QList Lines; typedef QList Bars; const int BarRatio = 24; class CCAnalysis : public QObject { public: CCAnalysis(CCBuilder * builder); ~CCAnalysis(); bool analize(bool extractBars = false); void tableAnalise(); Bars addBars(); Bars getBars(); QList getAllComponents(bool extractBars); TextLine extractLine(); int getGlyphCount(); QList getGlyphs(); int getMediumGlyphHeight(); int getMediumGlyphWidth(); int getMediumLetterSpace(); int getMediumWordSpace(); int getStringsCount(); int getGlyphBoxCount(); Rect getGlyphBox(int index); QRect getStringBox(const int index) const; Lines getLines(); qreal getK(); void rotateLines(qreal phi, const QPoint &c = QPoint(0,0)); private: void fillComponents(); bool getComponentParams(); void doExtractBars(); bool extractComponents(bool extractBars = false); void classifyGlyphs(); int findAdjacent(Rect &r); void normalizeLines(); void rotatePhi(qreal phi, const QPoint &c, QPoint &p); void addBarsHorizontal(int hoffset = 0, int height = -1, int woffset = 0, int width = -1); void addBarsHorisontalAfterVertical(); void addBarsVertical(); private: CCBuilder * builder; ComponentParameters components; Strings strings; StringsBoxes boxes; GlyphField glyphField; Lines lines; int glyphCount; int mediumGlyphHeight; int mediumGlyphWidth; int mediumLetterSpace; int mediumWordSpace; int stringsCount; qreal k; Bars bars; QVector verts; }; #endif yagf-0.9.5+repack1/src/core/ccbuilder.h000755 001750 001750 00000005074 13631520722 021263 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #ifndef CCBUILDER_H #define CCBUILDER_H #include #include #include #include #include //#define DEBUG_CC typedef QList IntList; /* This class builds a 2-dimensional array for an image in which the connected pixels are labeled with the same numbers. The elements of the resulting array may be accesed using the label() method. */ class CCBuilder : public QObject { Q_OBJECT public: /* pixmap is the image to be analysed */ explicit CCBuilder(const QImage &img, QObject *parent = 0); ~CCBuilder(); /* This method resets CCs labels so that they occupy a continuos range of numbers */ void compactLabels(); /* This method returns the label value for original image's x and y. */ quint32 label(int x, int y); /* This method performs the actual connected component's labeling */ int labelCCs(); /* Returns image width */ int width(); /* Returns image height */ int height(); QRect crop(); quint32 * scanLine(int y); quint8 getMediumBWBG(quint32 *hist); signals: public slots: private: void initialScan(); void backwardScan(); void forwardScan(); int labelChecked(int x, int y); void setLabel(int x, int y, int newValue); void relabelLineLR(int y); void relabelLineRL(int y); inline bool isForeground(int x, QRgb value); void scanFirstLineLR(); void scanLineLR(int y); void labelLeftmostPoint(int y); void labelRightmostPoint(int y); private: quint32 thr1, thr2; QImage image; quint32 * labels; bool * flags; bool skipNext; IntList recolor; quint32 maxlabel; bool didRecolor; int w, h; QRect cropRect; #ifdef DEBUG_CC int dcounter; int gcounter; #endif friend class Cropper; }; #endif // CCBUILDER_H yagf-0.9.5+repack1/src/core/tableanalizer-1.h000755 001750 001750 00000001500 13631520722 022270 0ustar00boradminboradmin000000 000000 #ifndef TABLEANALIZER_H #define TABLEANALIZER_H #include "../utils.h" #include #include class QIPBlackAndWhiteImage; class TableAnalizer { public: TableAnalizer(QIPBlackAndWhiteImage *image); QList splitTable(const QRect &bounds); QList splitTableForce(const QRect &bounds); private: QIPBlackAndWhiteImage * img; Rect maxRect; QList blocks; private: bool findRect(const QRect &bounds); void updateComponents(int x, int y, int label); bool findMax(const QRect &bounds); void clearImage(); void clearGarbage(); void drawHorzLine(int y, int minx, int maxx); void drawVertLine(int x, int miny, int maxy); void addBars(const QRect &bounds); bool findHorzLine(qint32 y, qint32 xstart, qint32 xstop, int count); }; #endif // TABLEANALIZER_H yagf-0.9.5+repack1/src/main.cpp000755 001750 001750 00000005212 13631520722 017650 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009-2015 Andrei Borovsky 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 . */ #include #include #include #include #include #include #include "mainform.h" #include "settings.h" #include "langselectdialog.h" //#define MEM_DEBUG #ifdef MEM_DEBUG #include #endif void parseCmdLine(const QStringList &args) { foreach (const QString &arg, args) { if (arg == "-h" || arg == "--help") { printf("Using:\n" " yagf\n" " yagf \n" " yagf [file name [file name]...]\n" "YAGF is a graphical interface for cuneiform and tesseract.\n" "\n" "Keys:\n" " -h, --help\t Show this message and exit\n" " -V, --version\t Show version string and exit\n"); exit(0); } else if (arg == "-V" || arg == "--version") { printf("YAGF version: %s\n", version.toUtf8().constData()); exit(0); } } } int main(int argc, char *argv[]) { #ifdef MEM_DEBUG mtrace(); #endif QApplication app(argc, argv); parseCmdLine(app.arguments()); Settings *settings = Settings::instance(); settings->readSettings(settings->workingDir()); settings->writeSettings(); QTranslator translator; QString qmName = "yagf_" + QLocale::system().name(); if (!settings->useNoLocale()) { translator.load(qmName, QString(QML_INSTALL_PATH)); app.installTranslator(&translator); } settings->makeLanguageMaps(); QTranslator translator2; translator2.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); if (!settings->useNoLocale()) app.installTranslator(&translator2); MainForm window; window.show(); int res = app.exec(); #ifdef MEM_DEBUG muntrace(); #endif return res; } yagf-0.9.5+repack1/src/pdfextractor.h000755 001750 001750 00000005026 13631520722 021101 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2010 Andrei Borovsky 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 . */ #ifndef PDFEXTRACTOR_H #define PDFEXTRACTOR_H #include #include #include #include class QDir; class PDFExtractor : public QObject { Q_OBJECT public: explicit PDFExtractor(QObject *parent = 0); ~PDFExtractor(); void setCommandStringPaged(const QString &cmdStr); void setConvertEntire(const QString &cmdStr); bool isConvertEntire(); void setSourcePDF(const QString &value); QString getSourcePDF(); void setOutputDir(); QString getOutputDir(); void setStartPage(const QString &value); int getStartPage(); void setStopPage(const QString &value); int getStopPage(); void setResolution(const QString &value); QString getResolution(); void setOutputPrefix(const QString &value); QString getOutputPrefix(); void setOutputExtension(const QString &value); QString getOutputExtension(); void run(); static bool findCProgram(); void removeRemaining(); signals: void processStarted(); void processFinished(bool error); void addPage(QString pageName, int current, int total); void extractingFinished(); void error(const QString &text); public slots: void cancelProcess(); private slots: void procFinished(); void procFinishedError(); protected: void sortDir(QDir &dir); virtual QStringList makeCommandString() = 0; private: void processFiles(); void clearFiles(); private: QString commandStringPaged; QString commandStringEntire; QString sourcePDF; QString outputDir; int startPage; int stopPage; QString resolution; QString outputPrefix; QString outputExtension; QStringList filters; QString lastFile; QProcess proc; bool convertEntire; }; #endif // PDFEXTRACTOR_H yagf-0.9.5+repack1/src/recognitiondialog.cpp000755 001750 001750 00000002501 13631520722 022422 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2015 Andrei Borovsky 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 . */ #include "recognitiondialog.h" #include "ui_recognitiondialog.h" RecognitionDialog::RecognitionDialog(QWidget *parent) : QDialog(parent), ui(new Ui::RecognitionDialog) { ui->setupUi(this); ui->widget_2->startAnimation(); connect(ui->pushButton, SIGNAL(clicked()), this, SIGNAL(rejected())); connect (this, SIGNAL(rejected()), this, SIGNAL(cancel()), Qt::QueuedConnection); } RecognitionDialog::~RecognitionDialog() { delete ui; } void RecognitionDialog::blockRecognized(int n) { ui->label_2->setText(trUtf8("block # %1").arg(n)); } yagf-0.9.5+repack1/src/recognitiondialog.h000755 001750 001750 00000002256 13631520722 022076 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2015 Andrei Borovsky 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 . */ #ifndef RECOGNITIONDIALOG_H #define RECOGNITIONDIALOG_H #include namespace Ui { class RecognitionDialog; } class RecognitionDialog : public QDialog { Q_OBJECT public: explicit RecognitionDialog(QWidget *parent = 0); ~RecognitionDialog(); signals: void cancel(); public slots: void blockRecognized(int n); private: Ui::RecognitionDialog *ui; }; #endif // RECOGNITIONDIALOG_H yagf-0.9.5+repack1/src/tpagecollection.cpp000755 001750 001750 00000027241 13631520722 022106 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2012 Andrei Borovsky 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 . */ #include "tpagecollection.h" #include "core/imageprocessor.h" #include "qsnippet.h" #include "settings.h" #include #include #include #include #include static QMutex lsGate; PageCollection *PageCollection::m_instance = NULL; PageCollection::PageCollection(QObject *parent) : QObject(parent), index(-1), pid(0) { } PageCollection::PageCollection(const PageCollection &) { } PageCollection::~PageCollection() { clear(); } bool PageCollection::appendPage(const QString &fileName) { unloadAll(); Page *p = new Page(++pid); connect(p,SIGNAL(refreshView(bool)), this, SIGNAL(loadPage(bool))); if (p->loadFile(fileName, 1, false)) { pages.append(p); index = pages.count() - 1; // if (Settings::instance()->getAutoDeskew()) { // deskew(); //p->cropYGF(); //p->reSaveTmpPage(); // } emit addSnippet(index); connect(p, SIGNAL(textOut(QString)), SLOT(textOut(QString))); return true; } else { delete p; pid--; return false; } } Page * PageCollection::newPage(const QString &fileName, qreal rotation, bool preprocessed, bool deskewed, bool cropped) { if (cp()) cp()->unload(); Page *p = new Page(++pid); connect(p,SIGNAL(refreshView(bool)), this, SIGNAL(loadPage(bool))); p->setDeskewed(deskewed); p->setPreprocessed(preprocessed); p->setCropped(cropped); if (p->loadFile(fileName, 1)) { pages.append(p); p->rotate(rotation); index = pages.count() - 1; emit addSnippet(index); makePageCurrent(index); return p; } return NULL; } int PageCollection::count() { return pages.count(); } QString PageCollection::text() { if (cp()) return cp()->recognizedText(); return ""; } void PageCollection::setText(const QString &t) { if (cp()) cp()->setRecognizedText(t); mTextSaved = false; } bool PageCollection::makePageCurrent(int index) { if (cp()) { cp()->unload(); } this->index = index; return index < pages.count(); } bool PageCollection::makePageCurrentByID(int id) { return makePageCurrent(id2Index(id)) >= 0; } void PageCollection::setBeforeFirst() { index = -1; } bool PageCollection::makeNextPageCurrent() { if (cp()) { cp()->unload(); } index++; if (index < count()) return true; index = -1; return false; } bool PageCollection::textAtNextId(int &cid, QString &text) { int tmpcid = 0x1000; int idx = 0; for(int i = 0; i < pages.count(); i++) { int pid = pages.at(i)->pageID(); if (pid > cid) { if (pid <= tmpcid) { tmpcid = pid; idx = i; } } } if (tmpcid != 0x1000) { text = pages.at(idx)->recognizedText(); cid = tmpcid; return true; } return false; } QSnippet *PageCollection::snippet() { if (!cp()) return NULL; QSnippet *s = new QSnippet(); s->setPage(cp()->pageID(), cp()->originalFileName(), cp()->thumbnail()); return s; } QPixmap PageCollection::pixmap() { if (!cp()) return QPixmap(); return cp()->displayPixmap(); } void PageCollection::savePageForRecognition(const QString &fileName) { if (!cp()) return; cp()->savePageForRecognition(fileName); } void PageCollection::SaveCurrentPageText(const QString &fileName, bool truncate) { if (!cp()) return; QFile textFile(fileName); if (truncate) textFile.open(QIODevice::ReadWrite | QIODevice::Truncate); else textFile.open(QIODevice::ReadWrite); //textFile.seek() textFile.write(currentText().toUtf8()); textFile.close(); if (pages.count() ==1) mTextSaved = true; } void PageCollection::saveAllText(const QString &fileName, bool truncate) { if (!cp()) return; int cid = currentId; QFile textFile(fileName); if (truncate) textFile.open(QIODevice::ReadWrite | QIODevice::Truncate); else textFile.open(QIODevice::ReadWrite); int _pid =-1; QString txt; while(textAtNextId(_pid, txt)) textFile.write(txt.toUtf8()); textFile.close(); makePageCurrentByID(cid); mTextSaved = true; } void PageCollection::saveRawBlockForRecognition(QRect r, const QString &fileName) { if (!cp()) return; cp()->saveRawBlockForRecognition(r, fileName); } void PageCollection::saveBlockForRecognition(QRect r, const QString &fileName, const QString &format) { if (!cp()) return; cp()->saveBlockForRecognition(r, fileName, format); } void PageCollection::saveBlockForRecognition(int index, const QString &fileName) { if (!cp()) return; if (index == 0) cp()->sortBlocksInternal(); cp()->saveBlockForRecognition(index, fileName); } int PageCollection::blockCount() { if (!cp()) return 0; return cp()->blockCount(); } Block PageCollection::getBlock(const QRect &r) { Block block(0,0,0,0); if (!cp()) return block; return cp()->getBlock(r); } Block PageCollection::getBlock(int index) { Block block(0,0,0,0); if (!cp()) return block; return cp()->getBlock(index); } void PageCollection::selectBlock(const QRect &r) { if (!cp()) return; cp()->selectBlock(r); } Block PageCollection::getSelectedBlock() { Block block(0,0,0,0); if (!cp()) return block; return cp()->getSelectedBlock(); } bool PageCollection::pageValid() { return cp() != 0; } QString PageCollection::fileName() { if (!cp()) return ""; return cp()->fileName(); } QString PageCollection::originalFileName() { if (!cp()) return ""; return cp()->originalFileName(); } bool PageCollection::hasPage() { return (cp() != 0); } bool PageCollection::savePageAsImage(const QString &fileName, const QString &format) { if (!cp()) return false; return cp()->savePageAsImage(fileName, format); } bool PageCollection::isDeskewed() { if (cp()) return cp()->isDeskewed(); return false; } bool PageCollection::isPreprocessed() { if (cp()) return cp()->isPreprocessed(); return false; } bool PageCollection::isCropped() { if (cp()) return cp()->isCropped(); return false; } qreal PageCollection::getRotation() { if (cp()) return cp()->getRotation(); return 0; } void PageCollection::setRotation(const qreal value) { if (cp()) cp()->rotate(value); } void PageCollection::setDeskewed(const bool value) { if (cp()) cp()->setDeskewed(value); } void PageCollection::setPreprocessed(const bool value) { if (cp()) cp()->setPreprocessed(value); } void PageCollection::reloadPage() { emit loadPage(true); } void PageCollection::unloadAll() { foreach(Page *p, pages) { p->unload(); } } void PageCollection::deskew(int x1, int y1, int x2, int y2) { if (cp()) cp()->deskew(x1,y1,x2,y2); emit loadPage(true); } QRect PageCollection::scaleRect(QRect &rect) { if (cp()) return cp()->scaleRect(rect); return QRect(0,0,0,0); } QRect PageCollection::scaleRect(QRect &rect, qreal scale) { QRect result(0,0,0,0); if (cp()) { result = cp()->scaleTo(rect, scale); } return result; } QRect PageCollection::scaleRectToPage(QRect &rect) { QRect result(0,0,0,0); if (cp()) { result = cp()->scaleRectToScale(rect); } return result; } void PageCollection::splitTable() { if (cp()) cp()->splitTable(); } void PageCollection::saveCurrentText(const QString &text) { if (cp()) cp()->setRecognizedText(text); } QString PageCollection::currentText() { if (cp()) return cp()->recognizedText(); return ""; } void PageCollection::storeCurrentIndex() { if (cp()) currentId = cp()->pageID(); else { if (pages.count() > 0) { makePageCurrent(0); currentId = cp()->pageID(); } } } void PageCollection::restoreCurrentIndex() { makePageCurrentByID(currentId); emit loadPage(true); } void PageCollection::makeLarger() { if (!cp()) return; if (lsGate.tryLock()) { cp()->makeLarger(); emit loadPage(true); lsGate.unlock(); } } void PageCollection::makeSmaller() { if (!cp()) return; if (lsGate.tryLock()) { cp()->makeSmaller(); emit loadPage(true); lsGate.unlock(); } } void PageCollection::rotate90CW() { if (!cp()) return; cp()->rotate90CW(); emit loadPage(true); } void PageCollection::rotate90CCW() { if (!cp()) return; cp()->rotate90CCW(); emit loadPage(true); } void PageCollection::rotate180() { if (!cp()) return; cp()->rotate180(); emit loadPage(true); } void PageCollection::deskew() { if (!cp()) return; if (cp()->textHorizontal()) cp()->deskew(); emit loadPage(true); } void PageCollection::blockAllText() { if (!cp()) return; cp()->blockAllText(); emit loadPage(true); } bool PageCollection::splitPage(bool preprocess) { if (!cp()) return false; bool res = cp()->splitPage(preprocess); emit loadPage(true); return res; } void PageCollection::addBlock(const QRect &rect) { if (!cp()) return; Block block(rect.x(), rect.y(), rect.width(), rect.height()); cp()->addBlock(block); } void PageCollection::addBlock(const QRect &rect, int num) { if (!cp()) return; Block block(rect.x(), rect.y(), rect.width(), rect.height()); cp()->addBlock(block, num); } void PageCollection::deleteBlock(const QRect &rect) { if (!cp()) return; cp()->deleteBlock(rect); } void PageCollection::clearBlocks() { if (!cp()) return; cp()->clearBlocks(); } void PageCollection::clear() { foreach (Page * p, pages) { delete p; } pages.clear(); emit cleared(); index = -1; pid = 0; } Page *PageCollection::cp() { if ((index < 0)|| (index >= count())) return (Page *) 0; return pages.at(index); } int PageCollection::id2Index(int id) { foreach (Page *p, pages) { if (p->pageID() == id) return pages.indexOf(p); } return -1; } void PageCollection::pageSelected(int id) { makePageCurrent(id2Index(id)); emit loadPage(true); } void PageCollection::pageRemoved(int id) { int index = id2Index(id); if (index >= 0) { delete pages.at(index); pages.remove(index); } if (index >= pages.count()) index = pages.count() - 1; makePageCurrent(index); emit loadPage(true); } void PageCollection::textOut(const QString &msg) { emit messagePosted(msg); } PageCollection *PageCollection::instance() { if (!m_instance) m_instance = new PageCollection(); return m_instance; } void PageCollection::clearCollection() { if (m_instance) m_instance->clear(); } void PageCollection::setOriginalFileName(const QString &fn) { if (cp()) cp()->setOriginalFileName(fn); } yagf-0.9.5+repack1/src/texteditor.cpp000755 001750 001750 00000015770 13631520722 021131 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2012 Andrei Borovsky 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 . */ #include "texteditor.h" #include "settings.h" #include "ycommon.h" #include "utils.h" #include #include #include #include #include #include #include #include #include TextEditor::TextEditor(QWidget *parent) : QTextEdit(parent), spellChecker(this) { hasCopy = false; setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint))); connect(document(), SIGNAL(cursorPositionChanged(const QTextCursor &)), this, SLOT(updateSP())); connect(this, SIGNAL(copyAvailable(bool)), this, SLOT(copyAvailable(bool))); connect(this, SIGNAL(textChanged()), this, SLOT(textChanged())); } TextEditor::~TextEditor() { } bool TextEditor::spellCheck(const QString &lang) { spellChecker.setLanguage(lang); return spellChecker.spellCheck(); } void TextEditor::unSpellCheck() { spellChecker.unSpellCheck(); } void TextEditor::enumerateDicts() { spellChecker.enumerateDicts(); } bool TextEditor::hasDict(const QString &shname) { return spellChecker.hasDict(shname); } void TextEditor::keyPressEvent(QKeyEvent *e) { if (e->modifiers() & Qt::ControlModifier) { if ((e->key() == Qt::Key_Plus) || (e->key() == Qt::Key_Equal)) { enlargeFont(); e->accept(); return; } else if (e->key() == Qt::Key_Minus) { decreaseFont(); e->accept(); return; } } QTextEdit::keyPressEvent(e); } void TextEditor::wheelEvent(QWheelEvent *e) { if (e->modifiers() & Qt::ControlModifier) { if (e->delta() > 0) enlargeFont(); else decreaseFont(); e->accept(); return; } QTextEdit::wheelEvent(e); } void TextEditor::replaceWord() { QAction *action = (QAction *) sender(); QTextCursor cursor = textCursor(); cursor.select(QTextCursor::WordUnderCursor); cursor.removeSelectedText(); cursor.insertText(action->text()); } void TextEditor::copyAvailable(bool yes) { hasCopy = yes; } void TextEditor::textChanged() { Settings *settings = Settings::instance(); QFont f(font()); f.setPointSize(settings->getFontSize()); setFont(f); } void TextEditor::copyClipboard() { if (!hasCopy) { QClipboard *clipboard = QApplication::clipboard(); clipboard->setText(toPlainText(), QClipboard::Clipboard); } else copy(); } void TextEditor::saveHtml(QFile *file) { QString text = document()->toHtml().toUtf8(); QString newDir = extractFilePath(file->fileName()) + extractFileName(file->fileName()) + ".files"; text.replace("", ""); /*text.replace(workingDir + "output_files", newDir); text.replace("[img src=", ""); text.replace(".bmp]", ".bmp>"); QDir dir(workingDir+"output_files"); dir.rename(workingDir+"output_files", newDir);*/ file->write(text.toAscii()); } void TextEditor::globalReplace(const QString &what, const QString &with) { moveCursor(QTextCursor::Start); while (find(what)) { QTextCursor cursor = textCursor(); cursor.removeSelectedText(); cursor.insertText(what); } } void TextEditor::contextMenuRequested(const QPoint &point) { QAction *action; QMenu *menu = new QMenu(this); QStringList sl = spellChecker.suggestions(); //if (sl.count() == 0) { action = new QAction(trUtf8("Undo\tCtrl+Z"), this); action->setShortcut(QKeySequence("Ctrl+Z")); connect(action, SIGNAL(triggered()), this, SLOT(undo())); menu->addAction(action); action = new QAction(trUtf8("Redo\tCtrl+Shift+Z"), this); action->setShortcut(QKeySequence("Ctrl+Shift+Z")); connect(action, SIGNAL(triggered()), this, SLOT(redo())); menu->addAction(action); action = new QAction("separator", this); action->setText(""); action->setSeparator(true); menu->addAction(action); action = new QAction(trUtf8("Select All\tCtrl+A"), this); action->setShortcut(QKeySequence("Ctrl+A")); connect(action, SIGNAL(triggered()), this, SLOT(selectAll())); menu->addAction(action); action = new QAction(trUtf8("Cut\tCtrl+X"), this); action->setShortcut(QKeySequence("Ctrl+X")); connect(action, SIGNAL(triggered()), this, SLOT(cut())); menu->addAction(action); action = new QAction(trUtf8("Copy\tCtrl+C"), this); action->setShortcut(QKeySequence("Ctrl+C")); connect(action, SIGNAL(triggered()), this, SLOT(copyClipboard())); menu->addAction(action); action = new QAction(trUtf8("Paste\tCtrl+V"), this); action->setShortcut(QKeySequence("Ctrl+V")); connect(action, SIGNAL(triggered()), this, SLOT(paste())); menu->addAction(action); action = new QAction("separator", this); action->setText(""); action->setSeparator(true); menu->addAction(action); action = new QAction(trUtf8("Larger Font\tCtrl++"), this); connect(action, SIGNAL(triggered()), this, SLOT(enlargeFont())); menu->addAction(action); action = new QAction(trUtf8("Smaller Font\tCtrl+-"), this); connect(action, SIGNAL(triggered()), this, SLOT(decreaseFont())); menu->addAction(action); //} if (sl.count() > 0) menu->addSeparator(); foreach(QString str, sl) { QAction *action = menu->addAction(str); connect(action, SIGNAL(triggered()), this, SLOT(replaceWord())); } menu->exec(mapToGlobal(point)); delete menu; } void TextEditor::enlargeFont() { Settings *settings = Settings::instance(); int fontSize = font().pointSize(); fontSize++; QFont f(font()); f.setPointSize(fontSize); setFont(f); settings->setFontSize(fontSize); } void TextEditor::decreaseFont() { Settings *settings = Settings::instance(); int fontSize = font().pointSize(); if (fontSize > 1) fontSize--; QFont f(font()); f.setPointSize(fontSize); setFont(f); settings->setFontSize(fontSize); } void TextEditor::updateSP() { Settings *settings = Settings::instance(); if (settings->getCheckSpelling()) spellChecker.checkWord(); } yagf-0.9.5+repack1/src/globallock.cpp000755 001750 001750 00000002233 13631520722 021035 0ustar00boradminboradmin000000 000000 #include "globallock.h" #include #include GlobalLock * GlobalLock::m_instance = NULL; static QAtomicInt state; GlobalLock *GlobalLock::instance() { if (!m_instance) m_instance = new GlobalLock(); return m_instance; } /* 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. */ bool GlobalLock::lock() { return state.testAndSetOrdered(0, 1); } void GlobalLock::unlock() { state.fetchAndStoreOrdered(0); } bool GlobalLock::isLocked() { return state == 1; } GlobalLock::GlobalLock() { } GlobalLock::GlobalLock(const GlobalLock &) { } Unlocker::Unlocker(bool locked): unlock(locked) { } Unlocker::~Unlocker() { if (unlock) GlobalLock::instance()->unlock(); } yagf-0.9.5+repack1/src/settings.cpp000755 001750 001750 00000064271 13631520722 020576 0ustar00boradminboradmin000000 000000 /* 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. */ #include "settings.h" #include "utils.h" #include #include #include #include Settings *Settings::m_instance = NULL; Settings::Settings() { //makeLanguageMaps(); } Settings::Settings(const Settings &) { upscale = false; } Settings::~Settings() { } Settings *Settings::instance() { if (!m_instance) m_instance = new Settings(); return m_instance; } void Settings::readSettings(const QString &path) { mPath = path; mPath = mPath.append("yagf.ini"); settings = new QSettings(mPath, QSettings::IniFormat); version = settings->value("program/version").toString(); if (version.isEmpty()) fr = true; else fr = false; lastDir = settings->value("mainwindow/lastDir").toString(); lastOutputDir = settings->value("mainwindow/lastOutputDir").toString(); QString defEngine; if (findProgram("tesseract")) defEngine = "tesseract"; else defEngine = "cuneiform"; QString engine = settings->value("ocr/engine", QVariant(defEngine)).toString(); if (engine == "cuneiform") selectedEngine = UseCuneiform; else selectedEngine = UseTesseract; language = settings->value("ocr/language", selectDefaultLanguageName()).toString(); //selectLangsBox->setCurrentIndex(selectLangsBox->findData(QVariant(language))); outputFormat = settings->value("ocr/outputFormat", QString("text")).toString(); if (outputFormat == "") outputFormat = "text"; checkSpelling = settings->value("mainWindow/checkSpelling", bool(true)).toBool(); bool ok; fontSize = settings->value("mainwindow/fontSize", int(12)).toInt(&ok); noLocale = settings->value("mainwindow/nolocale", QVariant(false)).toBool(); RussianLocale = settings->value("mainwindow/rulocale", QVariant(false)).toBool(); findTessDataPath(); tessdataPath = settings->value("ocr/tessData", QVariant(tessdataPath)).toString(); keepLines = settings->value("ocr/keepLines", QVariant(false)).toBool(); if (tessdataPath.isEmpty()) findTessDataPath(); languages = settings->value("ocr/selectedLanguages", QStringList(language)).toStringList(); rowBegin = settings->value("ocr/rowBegin", QVariant(QString("["))).toString(); rowEnd = settings->value("ocr/rowEnd", QVariant(QString("]"))).toString(); cellSeparator =settings->value("ocr/cellSeparator", QVariant("|")).toString(); rowFromNewLine = settings->value("ocr/rowFromNewLine", QVariant(true)).toBool(); cropLoaded = settings->value("processing/crop1", QVariant(true)).toBool(); autoDeskew = settings->value("processing/deskew", QVariant(true)).toBool(); preprocess = settings->value("processing/preprocess", QVariant(true)).toBool(); doublePreprocess = settings->value("processing/dpreprocess", QVariant(false)).toBool(); size = settings->value("mainwindow/size", QSize(800, 600)).toSize(); iconSize = settings->value("mainwindow/iconSize", QSize(24, 24)).toSize(); position = settings->value("mainwindow/pos", QPoint(0, 0)).toPoint(); fullScreen = settings->value("mainwindow/fullScreen", QVariant(false)).toBool(); darkBackgroundThreshold = settings->value("tweaks/darkBackgroundThreshold", QVariant(208)).toInt(); foregroundBrightenFactor = settings->value("tweaks/foregroundBrightenFactor", QVariant(32)).toInt(); globalBrightenFactor = settings->value("tweaks/globalBrightenFactor", QVariant(32)).toInt(); globalDarkenFactor = settings->value("tweaks/globalDarkenFactor", QVariant(20)).toInt(); globalDarkenThreshold = settings->value("tweaks/globalDarkenThreshold", QVariant(180)).toInt(); skipWidth = settings->value("tweaks/skipWidth", QVariant(5)).toInt(); uSeed = settings->value("tweaks/seed", QVariant(1)).toInt(); tiffPS = settings->value("tweaks/tiffPageSize", QVariant(4000)).toString(); tiffD = settings->value("tweaks/tiffDensity", QVariant(300)).toString(); projectDir = settings->value("projects/storage", QVariant(QDir::homePath())).toString(); recentProjects = settings->value("projects/recent", QVariant(QStringList())).toStringList(); maxRecentProjects = settings->value("projects/maxRecent", QVariant(8)).toInt(); autosaveInterval = settings->value("projects/autosaveInterval", QVariant(15)).toInt(); } bool Settings::firstRun() { return fr; } void Settings::writeSettings() { settings->setValue("program/version", QString::fromUtf8("0.9.5")); settings->setValue("mainwindow/size", size); settings->setValue("mainwindow/iconSize", iconSize); settings->setValue("mainwindow/pos", position); settings->setValue("mainwindow/fullScreen", fullScreen); settings->setValue("mainwindow/lastDir", lastDir); settings->setValue("mainWindow/checkSpelling", checkSpelling); settings->setValue("mainwindow/lastOutputDir", lastOutputDir); settings->setValue("mainwindow/fontSize", fontSize); settings->setValue("mainwindow/nolocale", noLocale); settings->setValue("mainwindow/rulocale", RussianLocale); settings->setValue("ocr/language", language); for (int i = languages.count()-1; i >= 0; i--) if (languages.at(i).contains("+")) languages.removeAt(i); if (!languages.contains("digits")) languages << "digits"; settings->setValue("ocr/selectedLanguages", languages); //settings->setValue("ocr/singleColumn", singleColumn); settings->setValue("ocr/outputFormat", outputFormat); QString engine = selectedEngine == UseCuneiform ? QString("cuneiform") : QString("tesseract"); settings->setValue("ocr/engine", engine); settings->setValue("ocr/tessData", tessdataPath); settings->setValue("processing/crop1", cropLoaded); if (doublePreprocess) autoDeskew = true; settings->setValue("processing/deskew", autoDeskew); settings->setValue("processing/preprocess", preprocess); settings->setValue("processing/dpreprocess", doublePreprocess); settings->setValue("ocr/keepLines", keepLines); settings->setValue("ocr/rowBegin", rowBegin); settings->setValue("ocr/rowEnd", rowEnd); settings->setValue("ocr/cellSeparator", cellSeparator); settings->setValue("ocr/rowFromNewLine", rowFromNewLine); settings->setValue("tweaks/darkBackgroundThreshold", darkBackgroundThreshold); settings->setValue("tweaks/foregroundBrightenFactor", foregroundBrightenFactor); settings->setValue("tweaks/globalBrightenFactor", globalBrightenFactor); settings->setValue("tweaks/globalDarkenFactor", globalDarkenFactor); settings->setValue("tweaks/globalDarkenThreshold", globalDarkenThreshold); settings->setValue("tweaks/tiffPageSize", tiffPS); settings->setValue("tweaks/tiffDensity", tiffD); settings->setValue("tweaks/skipWidth", skipWidth); settings->setValue("tweaks/seed", uSeed); settings->setValue("projects/storage", projectDir); settings->setValue("projects/recent", recentProjects); settings->setValue("projects/maxRecent", maxRecentProjects); settings->setValue("projects/autosaveInterval", autosaveInterval); settings->sync(); } QString Settings::getLanguage() { return language; } QString Settings::getOutputFormat() { return outputFormat; } QString Settings::getLastDir() { return lastDir; } QString Settings::getLastOutputDir() { return lastOutputDir; } bool Settings::getCheckSpelling() { return checkSpelling; } QString Settings::getTessdataPath() { if (!tessdataPath.endsWith("/")) tessdataPath = tessdataPath.append("/"); return tessdataPath; } SelectedEngine Settings::getSelectedEngine() { return selectedEngine; } QSize Settings::getSize() { return size; } QPoint Settings::getPosition() { return position; } bool Settings::getFullScreen() { return fullScreen; } int Settings::getFontSize() { return fontSize; } QStringList Settings::getRecentProjects() { return this->recentProjects; } int Settings::getMaxRecentProjects() { return maxRecentProjects; } void Settings::setMaxRecentProjects(const int value) { maxRecentProjects = value; } QString Settings::getFullLanguageName(const QString &abbr) { QMap * map; if (selectedEngine == UseCuneiform) map = &cuMap; if (selectedEngine == UseTesseract) map = &tesMap; return map->key(abbr, ""); } QString Settings::getFullLanguageName(const QString &abbr, const QString &engine) { QMap * map; if (engine == "cuneiform") map = &cuMap; if (engine == "tesseract") { map = &tesMap; if (abbr.contains("+")) { QStringList sl = abbr.split("+"); return map->key(sl[0], "") + "+" + map->key(sl[1], ""); } } return map->key(abbr, ""); } QString Settings::getShortLanguageName(const QString &lang) { QMap * map; if (selectedEngine == UseCuneiform) map = &cuMap; if (selectedEngine == UseTesseract) map = &tesMap; return map->value(lang, ""); } QString Settings::getShortLanguageName(const QString &lang, const QString &engine) { QMap * map; if (engine == "tesseract") map = &tesMap; if (engine == "cuneiform") map = &cuMap; return map->value(lang, ""); } bool Settings::getAutoDeskew() { return autoDeskew; } bool Settings::getCropLoaded() { return cropLoaded; } bool Settings::getPreprocessed() { return preprocess; } bool Settings::getDoublePreprocessed() { return doublePreprocess; } void Settings::setLanguage(const QString &value) { language = value; } void Settings::setOutputFormat(const QString &value) { outputFormat = value; } void Settings::setLastDir(const QString &value) { lastDir = value; } void Settings::setLastOutputDir(const QString &value) { lastOutputDir = value; } void Settings::setCheckSpelling(const bool value) { checkSpelling = value; } void Settings::setTessdataPath(const QString &value) { tessdataPath = value; } void Settings::setSelectedEngine(const SelectedEngine value) { selectedEngine = value; } void Settings::setSize(const QSize &value) { size = value; } void Settings::setPosition(const QPoint &value) { position = value; } void Settings::setFullScreen(const bool value) { fullScreen = value; } void Settings::setFontSize(const int &value) { fontSize = value; } void Settings::setCropLoaded(const bool value) { cropLoaded = value; } void Settings::setAutoDeskew(const bool value) { autoDeskew = value; } void Settings::setPreprocessed(const bool value) { preprocess = value; } void Settings::setDoublePreprocessed(const bool value) { doublePreprocess = value; } void Settings::setUpscale(bool value) { upscale = value; } bool Settings::getUpscale() { return upscale; } void Settings::setSkipWidth(int value) { skipWidth = value; } QString Settings::getRecognizeInputFile() const { return "input.bmp"; } QString Settings::getRecognizeOutputExt() const { return ".txt"; } QString Settings::getRecognizeOutputFile() const { return "output.txt"; } QString Settings::getRecognizeOutputBase() const { return "output"; } QString Settings::getScanOutputFile() const { return "input.png"; } int Settings::getSkipWidth() { return skipWidth; } QString Settings::uniqueSeed() { return QString::number(uSeed++); } QString Settings::tiffPageSize() { return tiffPS; } QString Settings::tiffDensity() { return tiffD; } int Settings::getDarkBackgroundThreshold() { return darkBackgroundThreshold; } int Settings::getForegroundBrightenFactor() { return foregroundBrightenFactor; } int Settings::getGlobalBrightenFactor() { return globalBrightenFactor; } int Settings::getGlobalDarkenFactor() { return globalDarkenFactor; } int Settings::getGlobalDarkenThreshold() { return globalDarkenThreshold; } int Settings::getAutosaveInterval() { return autosaveInterval; } QStringList Settings::fullLanguageNames() { QStringList res = tesMap.keys(); res << QObject::trUtf8("Russian-English"); return res; } QStringList Settings::getSelectedLanguages() { QStringList res; foreach (QString s, languages) { QString l = getFullLanguageName(s, "tesseract"); if (l!="") res.append(l); l = getFullLanguageName(s, "cuneiform"); if (l!="") res.append(l); } res.removeDuplicates(); return res; } QStringList Settings::selectedLanguagesAvailableTo(const QString &engine) { QStringList res; if (engine == "cuneiform") { foreach(QString s, languages) { if (cuMap.values().contains(s)) res.append(cuMap.key(s, "")); } } if (engine == "tesseract") { foreach(QString s, languages) { if (tesMap.values().contains(s)) res.append(tesMap.key(s, "")); } } return res; } QStringList Settings::languagesAvailableTo(const QString &engine) { if (engine == "cuneiform") return cuMap.keys(); if (engine == "tesseract") return tesMap.keys(); return QStringList(); } QStringList Settings::installedTesseractLanguages() { QString tessPath = tessdataPath + "/tessdata/"; QDir d(tessPath); QStringList res; QStringList sl = d.entryList(QStringList("*.traineddata")); foreach (QString s, tesMap.values()) { foreach(QString s1, sl) { if (s1.startsWith(s)) res.append(tesMap.key(s, "")); } } res.removeDuplicates(); return res; } QString Settings::getRowBegin() { return rowBegin; } QString Settings::getRowEnd() { return rowEnd; } QString Settings::getCellSeparator() { return cellSeparator; } bool Settings::getRowFromBNewLine() { return rowFromNewLine; } void Settings::setSelectedLanguages(const QStringList &value) { languages.clear(); foreach (QString s, value) { QString l = getShortLanguageName(s, "tesseract"); if (l!="") languages.append(l); l =getShortLanguageName(s, "cuneiform"); if (l!="") languages.append(l); } languages.removeDuplicates(); } QString Settings::workingDir() { QString wDir = QDir::homePath(); if (!wDir.endsWith("/")) wDir += '/'; QDir d(wDir + ".config"); if (d.exists()) wDir += ".config/"; QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); wDir = env.value("XDG_CONFIG_HOME", wDir); if (!wDir.endsWith("/")) wDir += '/'; wDir += "yagf/"; QDir dir(wDir); if (!dir.exists()) { dir.mkdir(wDir); fr = true; } else fr= false; return wDir; } void Settings::startLangPair() { lpi = 0; } bool Settings::getLangPair(QString &full, QString &abbr, bool forceTesseract) { QMap * map; if (selectedEngine == UseCuneiform) map = &cuMap; if (selectedEngine == UseTesseract) map = &tesMap; if (forceTesseract) map = &tesMap; if (lpi < map->count()) { full = map->keys().at(lpi); abbr = map->value(full); lpi++; return true; } return false; } void Settings::setProjectDir(const QString &dir) { projectDir = dir; } QString Settings::getProjectDir() { return projectDir; } void Settings::makeLanguageMaps() { cuMap.insert(QObject::trUtf8("Bulgarian"), "bul"); cuMap.insert(QObject::trUtf8("Czech"), "cze"); cuMap.insert(QObject::trUtf8("Danish"), "dan"); cuMap.insert(QObject::trUtf8("Dutch"), "dut"); cuMap.insert(QObject::trUtf8("English"), "eng"); cuMap.insert(QObject::trUtf8("French"), "fra"); cuMap.insert(QObject::trUtf8("German"), "ger"); cuMap.insert(QObject::trUtf8("Hungarian"), "hun"); cuMap.insert(QObject::trUtf8("Italian"), "ita"); cuMap.insert(QObject::trUtf8("Latvian"), "lav"); cuMap.insert(QObject::trUtf8("Lithuanian"), "lit"); cuMap.insert(QObject::trUtf8("Polish"), "pol"); cuMap.insert(QObject::trUtf8("Portuguese"), "por"); cuMap.insert(QObject::trUtf8("Romanian"), "rum"); cuMap.insert(QObject::trUtf8("Russian"), "rus"); cuMap.insert(QObject::trUtf8("Russian-English"), "ruseng"); cuMap.insert(QObject::trUtf8("Spanish"), "spa"); cuMap.insert(QObject::trUtf8("Serbian"), "srp"); cuMap.insert(QObject::trUtf8("Slovenian"), "slo"); cuMap.insert(QObject::trUtf8("Swedish"), "swe"); cuMap.insert(QObject::trUtf8("Ukrainian"), "ukr"); tesMap.insert(QObject::trUtf8("Afrikaans"), "afr"); tesMap.insert(QObject::trUtf8("Albanian"), "sqi"); tesMap.insert(QObject::trUtf8("Ancient Greek"), "grc"); tesMap.insert(QObject::trUtf8("Arabic"), "ara"); tesMap.insert(QObject::trUtf8("Azerbaijani"), "aze"); tesMap.insert(QObject::trUtf8("Belarusian"), "bel"); tesMap.insert(QObject::trUtf8("Bulgarian"), "bul"); tesMap.insert(QObject::trUtf8("Catalan"), "cat"); tesMap.insert(QObject::trUtf8("Chinese (Simplified)"), "chi_sim"); tesMap.insert(QObject::trUtf8("Chinese (Tradtional)"), "chi_tra"); tesMap.insert(QObject::trUtf8("Croatian"), "hrv"); tesMap.insert(QObject::trUtf8("Czech"), "ces"); tesMap.insert(QObject::trUtf8("Danish"), "dan"); tesMap.insert(QObject::trUtf8("Danish Gothic"), "dan-frak"); tesMap.insert(QObject::trUtf8("Dutch"), "nld"); tesMap.insert(QObject::trUtf8("English"), "eng"); tesMap.insert(QObject::trUtf8("Esperanto"), "epo"); tesMap.insert(QObject::trUtf8("Estonian"), "est"); tesMap.insert(QObject::trUtf8("Finnish"), "fin"); tesMap.insert(QObject::trUtf8("French"), "fra"); tesMap.insert(QObject::trUtf8("Galician"), "glg"); tesMap.insert(QObject::trUtf8("German"), "deu"); tesMap.insert(QObject::trUtf8("German Gothic"), "deu-frak"); tesMap.insert(QObject::trUtf8("Greek"), "ell"); tesMap.insert(QObject::trUtf8("Hebrew"), "heb"); tesMap.insert(QObject::trUtf8("Hindi"), "hin"); tesMap.insert(QObject::trUtf8("Hungarian"), "hun"); tesMap.insert(QObject::trUtf8("Indonesian"), "ind"); tesMap.insert(QObject::trUtf8("Icelandic"), "isl"); tesMap.insert(QObject::trUtf8("Italian"), "ita"); tesMap.insert(QObject::trUtf8("Japanese"), "jpn"); tesMap.insert(QObject::trUtf8("Kannada"), "kan"); tesMap.insert(QObject::trUtf8("Korean"), "kor"); tesMap.insert(QObject::trUtf8("Latvian"), "lav"); tesMap.insert(QObject::trUtf8("Lithuanian"), "lit"); tesMap.insert(QObject::trUtf8("Malay"), "msa"); tesMap.insert(QObject::trUtf8("Macedonian"), "mkd"); tesMap.insert(QObject::trUtf8("Middle English"), "enm"); tesMap.insert(QObject::trUtf8("Middle French"), "frm"); tesMap.insert(QObject::trUtf8("Norwegian"), "nor"); tesMap.insert(QObject::trUtf8("Polish"), "pol"); tesMap.insert(QObject::trUtf8("Portuguese"), "por"); tesMap.insert(QObject::trUtf8("Romanian"), "ron"); tesMap.insert(QObject::trUtf8("Russian"), "rus"); tesMap.insert(QObject::trUtf8("Serbian"), "srp"); tesMap.insert(QObject::trUtf8("Slovenian"), "slv"); tesMap.insert(QObject::trUtf8("Slovakian"), "slk"); tesMap.insert(QObject::trUtf8("Slovakian Gothic"), "slk-frak"); tesMap.insert(QObject::trUtf8("Spanish"), "spa"); tesMap.insert(QObject::trUtf8("Swahili"), "swa"); tesMap.insert(QObject::trUtf8("Swedish"), "swe"); tesMap.insert(QObject::trUtf8("Swedish Gothic"), "swe-frak"); tesMap.insert(QObject::trUtf8("Thai"), "tha"); tesMap.insert(QObject::trUtf8("Turkish"), "tur"); tesMap.insert(QObject::trUtf8("Ukrainian"), "ukr"); tesMap.insert(QObject::trUtf8("Vietnamese"), "vie"); tesMap.insert(QObject::trUtf8("Digits Only"), "digits"); setLangTess(); } QString Settings::tmpFileName() { return workingDir() + QString::fromUtf8("tmp-%1").arg(uniqueSeed()); } QString Settings::tmpYGFFileName() { return tmpFileName() + ".ygf"; } void Settings::setLangTess() { QStringList llanguages = languages; llanguages.removeAll("digits"); int lc = llanguages.count(); for (int i= 0; i < lc; i++) { for (int j = i+1; j < lc; j++) { if ((tesMap.values().contains(llanguages[j]))&&(tesMap.values().contains(llanguages[i]))) { QString nl = llanguages[i] + "+" + llanguages[j]; languages.append(nl); tesMap.insert(getFullLanguageName((nl), "tesseract"), nl); } } } } bool Settings::getKeepLines() const { return keepLines; } void Settings::setKeepLines(const bool value) { keepLines = value; } void Settings::setRowBegin(const QString &value) { rowBegin = value; } void Settings::setRowEnd(const QString &value) { rowEnd = value; } void Settings::setCellSeparator(const QString &value) { cellSeparator = value; } void Settings::setRowFromBNewLine(const bool value) { rowFromNewLine = value; } void Settings::addRecentProject(const QString &project) { if (project.contains("autosave")) return; for(int i = recentProjects.count()-1; i >= 0; i--) { QString p = recentProjects.at(i); if (!projectExists(p)) recentProjects.removeAll(p); } if(!recentProjects.contains(project)) { recentProjects.prepend(project); if (recentProjects.count() >= maxRecentProjects) recentProjects.removeLast(); } else { int i = recentProjects.indexOf(project); if (i > 0) recentProjects.swap(i, i-1); } } void Settings::removeRecentProject(const QString &project) { recentProjects.removeAll(project); } void Settings::setAutosaveInterval(const int value) { autosaveInterval = value; } bool Settings::projectExists(const QString &dir) { QString project = dir + "yagf_project.xml"; QFileInfo fi; fi.setFile(project); return fi.exists(); } void Settings::findTessDataPath() { QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); if (env.contains("TESSDATA_PREFIX")) { tessdataPath = env.value("TESSDATA_PREFIX"); if (tessdataPath.contains("$HOME")){ QString hp = QDir::homePath() +"/"; tessdataPath = tessdataPath.replace("$HOME", hp); tessdataPath = tessdataPath.replace("//", "/"); } return; } QDir dir; dir.setPath("/usr/share/tessdata"); if (dir.exists()) { tessdataPath = "/usr/share/"; return; } dir.setPath("/usr/local/share/tessdata"); if (dir.exists()) { tessdataPath = "/usr/local/share/"; return; } dir.setPath("/usr/local/share/tesseract-ocr/tessdata"); if (dir.exists()) { tessdataPath = "/usr/local/share/tesseract-ocr/"; return; } dir.setPath("/usr/share/tesseract-ocr/tessdata"); if (dir.exists()) { tessdataPath = "/usr/share/tesseract-ocr/"; return; } tessdataPath.clear(); return; } QString Settings::selectDefaultLanguageName() { QLocale loc = QLocale::system(); QString name = ""; QMap * map; if (selectedEngine == UseCuneiform) map = &cuMap; if (selectedEngine == UseTesseract) map = &tesMap; switch (loc.language()) { case QLocale::Bulgarian: name = map->value("Bulgarian"); break; case QLocale::Czech: name = map->value("Czech"); break; case QLocale::Danish: name = map->value("Danish"); break; case QLocale::German: name = map->value("German"); break; case QLocale::Dutch: name = map->value("Dutch"); break; case QLocale::Russian: name = map->value("Russian"); break; case QLocale::English: name = "eng"; break; case QLocale::Spanish: name = map->value("Spanish"); break; case QLocale::French: name = map->value("French"); break; case QLocale::Hungarian: name = map->value("Hungarian"); break; case QLocale::Italian: name = map->value("Italian"); break; case QLocale::Latvian: name = map->value("Latvian"); break; case QLocale::Lithuanian: name = map->value("Lithuanian"); break; case QLocale::Polish: name = map->value("Polish"); break; case QLocale::Portuguese: name = map->value("Portuguese"); break; case QLocale::Romanian: name = map->value("Romanian"); break; case QLocale::Swedish: name = map->value("Swedish"); break; case QLocale::Serbian: name = map->value("Serbian"); break; case QLocale::Slovenian: name = map->value("Slovenian"); break; case QLocale::Slovak: name = map->value("Slovak", "eng"); break; case QLocale::Ukrainian: name = map->value("Ukrainian"); break; case QLocale::Finnish: name = map->value("Finnish", "eng"); break; case QLocale::Greek: name = map->value("Greek", "eng"); break; case QLocale::Hebrew: name = map->value("Hebrew", "eng"); break; case QLocale::Norwegian: name = map->value("Norwegian", "eng"); break; case QLocale::Turkish: name = map->value("Turkish", "eng"); break; default: name = "eng"; break; } if (name == "") name = "eng"; return name; } QSize Settings::getIconSize() { return iconSize; } void Settings::setIconSize(const QSize &value) { iconSize = value; } bool Settings::useNoLocale() { return noLocale; } bool Settings::useRussianLocale() { return RussianLocale; } void Settings::setNoLocale(bool value) { noLocale = value; } void Settings::setRussianLocale(bool value) { RussianLocale = value; } yagf-0.9.5+repack1/src/pdf2ppt.cpp000755 001750 001750 00000002605 13631520722 020306 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2010 Andrei Borovsky 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 . */ #include "pdf2ppt.h" #include #include PDF2PPT::PDF2PPT() : PDFExtractor() { } QStringList PDF2PPT::makeCommandString() { QStringList args; args.append("pdftoppm"); args << "-jpeg"; if (getStopPage() > 0) { if (getStartPage() == 0) this->setStartPage("1"); args << "-f" << QString::number(getStartPage()) << "-l" << QString::number(getStopPage()); } args << "-rx" << "600" << "-ry" << "600" << this->getSourcePDF(); setOutputPrefix(getOutputDir().append("page")); args << getOutputPrefix(); setOutputExtension("jpg"); return args; } yagf-0.9.5+repack1/src/langselectdialog.h000755 001750 001750 00000002556 13631520722 021702 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #ifndef LANGSELECTDIALOG_H #define LANGSELECTDIALOG_H #include #include #include #include namespace Ui { class LangSelectDialog; } class LangSelectDialog : public QDialog { Q_OBJECT public: explicit LangSelectDialog(QWidget *parent = 0); ~LangSelectDialog(); protected: void accept(); private slots: void onItemClicked(QListWidgetItem *item); private: QStringList getRecognitionLanguages() const; void fillLangs(); private: Ui::LangSelectDialog *ui; QList items; }; #endif // LANGSELECTDIALOG_H yagf-0.9.5+repack1/src/mainform.cpp000755 001750 001750 00000123671 13631520722 020546 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2013 Andrei Borovsky 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 . */ #include "sidebar.h" #include "droplabel.h" #include "popplerdialog.h" #include "pdfextractor.h" #include "pdf2ppt.h" #include "ghostscr.h" #include "configdialog.h" #include "mainform.h" #include "tpagecollection.h" #include "scanner.h" #include "projectmanager.h" #include "langselectdialog.h" #include "tiffimporter.h" #include "busyform.h" #include "recognizerwrapper.h" #include "recognitiondialog.h" #include "extprocessdialog.h" #include "saveprojectdialog.h" #include "loadprojectdialog.h" #include "djvu2pdf.h" #include "menuaction.h" #include "autosaver.h" #include "waitwindow.h" #include "globallock.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "qgraphicsinput.h" #include "utils.h" #include "qxtunixsignalcatcher.h" #include #include #include #include #include #include #include #include #include MainForm::MainForm(QWidget *parent): QMainWindow(parent) { setupUi(this); pages = PageCollection::instance(); setWindowTitle("YAGF"); //spellChecker = new SpellChecker(textEdit); textEdit->enumerateDicts(); frame->show(); //toolBar->addWidget(label1); //toolBar->addWidget(selectLangsBox); graphicsInput = new QGraphicsInput(QRectF(0, 0, 2000, 2000), graphicsView) ; label->setListWidget(sideBar); pdfx = NULL; epd = NULL; dj2pf = NULL; connect(sideBar, SIGNAL(pageSelected(int)), pages, SLOT(pageSelected(int))); connect(label, SIGNAL(pageRemoved(int)), pages, SLOT(pageRemoved(int))); statusBar()->show(); useXSane = TRUE; scanner = NULL; //rotation = 0; m_menu = new QMenu(graphicsView); ifCounter = 0; dirty = false; connect(actionOpen, SIGNAL(triggered()), this, SLOT(loadImage())); connect(actionQuit, SIGNAL(triggered()), this, SLOT(close())); connect(this, SIGNAL(windowShown()), this, SLOT(onShowWindow()), Qt::QueuedConnection); connect(actionScan, SIGNAL(triggered()), this, SLOT(scanImage())); connect(actionPreviousPage, SIGNAL(triggered()), this, SLOT(loadPreviousPage())); connect(actionNextPage, SIGNAL(triggered()), this, SLOT(loadNextPage())); connect(actionRecognize, SIGNAL(triggered()), this, SLOT(recognize())); connect(action_Save, SIGNAL(triggered()), this, SLOT(saveAllText())); connect(actionAbout, SIGNAL(triggered()), this, SLOT(showAboutDlg())); connect(actionOnlineHelp, SIGNAL(triggered()), this, SLOT(showHelp())); connect(actionCopyToClipboard, SIGNAL(triggered()),textEdit, SLOT(copyClipboard())); connect(actionSelect_All_Text, SIGNAL(triggered()),textEdit, SLOT(selectAll())); connect(graphicsInput, SIGNAL(rightMouseClicked(int, int, bool)), this, SLOT(rightMouseClicked(int, int, bool))); connect(actionSelect_HTML_format, SIGNAL(triggered()), this, SLOT(selectHTMLformat())); connect(graphicsInput, SIGNAL(increaseMe()), this, SLOT(enlargeButtonClicked())); connect(graphicsInput, SIGNAL(decreaseMe()), this, SLOT(decreaseButtonClicked())); connect(sideBar, SIGNAL(filesDropped(QStringList)), SLOT(loadFiles(QStringList))); connect(pages, SIGNAL(loadPage(bool)), this, SLOT(loadPage(bool))); connect(graphicsInput, SIGNAL(blockCreated(QRect)), pages, SLOT(addBlock(QRect))); connect(graphicsInput, SIGNAL(blockCreated(QRect)), this, SLOT(markDirty())); connect(graphicsInput, SIGNAL(deleteBlock(QRect)), pages, SLOT(deleteBlock(QRect))); connect(graphicsInput, SIGNAL(deleteBlock(QRect)), this, SLOT(markDirty())); connect(sideBar, SIGNAL(fileRemoved(int)), pages, SLOT(pageRemoved(int))); connect(sideBar, SIGNAL(fileRemoved(int)), this, SLOT(markDirty())); connect (pages, SIGNAL(addSnippet(int)), this, SLOT(addSnippet(int))); connect(actionSelect_languages, SIGNAL(triggered()), this, SLOT(selectLanguages())); connect(graphicsInput, SIGNAL(clickMeAgain()), this, SLOT(clickMeAgain()), Qt::QueuedConnection); //connect(pdfx, SIGNAL(processStarted()), this, SLOT(extProcStarted())); selectLangsBox = new QComboBox(); selectLangsBox->setToolTip(trUtf8("Recognition language")); // connect(selectLangsBox->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(LangTextChanged(QString))); initSettings(); engineLabel = new QLabel(); statusBar()->addPermanentWidget(engineLabel, 0); if (settings->getSelectedEngine() == UseCuneiform) { //fillLanguagesBoxCuneiform(); engineLabel->setText(trUtf8("Using Cuneiform")); } if (settings->getSelectedEngine() == UseTesseract) { //fillLanguagesBoxTesseract(); engineLabel->setText(trUtf8("Using Tesseract")); } slAction = toolBar_6->insertWidget(0, selectLangsBox); //selectLangsBox->setStyleSheet("border: 1px solid blue; padding: 2px 2px 2px 18px; min-width: 6em; background-color: white; selection-background-color:blue; QComboBox::drop-down: { width: 0px; border-style: none}"); //selectLangsBox->setStyleSheet(label_2->text()); langLabel = new QLabel(); statusBar()->addPermanentWidget(langLabel); if (settings->getSelectedLanguages().count() == 1) { slAction->setVisible(false); langLabel->setText(trUtf8("Recognition Language") + ": " + settings->getFullLanguageName(settings->getLanguage())); } fillLangBox(); delTmpFiles(); QXtUnixSignalCatcher::connectUnixSignal(SIGUSR2); ba = new QByteArray(); connect(QXtUnixSignalCatcher::catcher(), SIGNAL(unixSignal(int)), this, SLOT(readyRead(int))); QPixmap l_cursor; l_cursor.load(":/resize.png"); resizeCursor = new QCursor(l_cursor); graphicsInput->setMagnifierCursor(resizeCursor); l_cursor.load(":/resize_block.png"); resizeBlockCursor = new QCursor(l_cursor); this->sideBar->show(); connect(actionRecognize_All_Pages, SIGNAL(triggered()), this, SLOT(recognizeAll())); QPixmap pm; pm.load(":/align.png"); pm.load(":/undo.png"); loadFromCommandLine(); emit windowShown(); if (findProgram("pdftoppm")) { pdfx = new PDF2PPT(); } else if (findProgram("gs")) { pdfx = new GhostScr(); } dj2pf = new Djvu2PDF(); epd = new ExtProcessDialog(this); epd->hide(); if (pdfx) { connect(pdfx, SIGNAL(processStarted()), this, SLOT(extProcStarted())); connect(pdfx, SIGNAL(processFinished(bool)), this, SLOT(showPDFprogress())); connect(pdfx, SIGNAL(addPage(QString, int, int)), this, SLOT(addPDFPage(QString, int, int)), Qt::DirectConnection); connect (pdfx, SIGNAL(extractingFinished()), this, SLOT(finishedPDF())); connect(epd, SIGNAL(rejected()), pdfx, SLOT(cancelProcess())); connect(pdfx, SIGNAL(error(QString)), this, SLOT(reportError(QString)), Qt::QueuedConnection); } if (dj2pf) { connect(dj2pf, SIGNAL(started()), this, SLOT(djvuStarted())); connect(dj2pf, SIGNAL(finished()), this, SLOT(djvuFinished())); connect(dj2pf, SIGNAL(error(QString)), this, SLOT(reportError(QString)), Qt::QueuedConnection); } rw = 0; rd = 0; createRecentMenu(); _asm = new AutoSaveManager(); connect(_asm, SIGNAL(startedAutoSave()), this, SLOT(startedAutoSave()), Qt::QueuedConnection); connect(_asm, SIGNAL(finishedAutoSave()), this, SLOT(autosaveFinished())); connect(_asm, SIGNAL(reportError(QString)), this, SLOT(reportError(QString))); connect(this, SIGNAL(callAfterConstructor()), this, SLOT(afterConstructor()), Qt::QueuedConnection); emit callAfterConstructor(); timerId = startTimer(settings->getAutosaveInterval()*60000); } void MainForm::onShowWindow() { actionKeep_Lines->setChecked(settings->getKeepLines()); connect(selectLangsBox, SIGNAL(currentIndexChanged(int)), this, SLOT(newLanguageSelected(int))); selectLangsBox->setCurrentIndex(selectLangsBox->findData(QVariant(settings->getLanguage()))); } void MainForm::loadFromCommandLine() { QStringList sl = QApplication::arguments(); if (sl.count() > 1) { if (QFile::exists(sl.at(1))) loadFile(sl.at(1)); for (int i = 2; i < sl.count(); i++) { QApplication::processEvents(); if (QFile::exists(sl.at(i))) loadFile(sl.at(i)); } sideBar->select(sl.at(1)); } } void MainForm::loadFiles(const QStringList &files) { if (files.count() == 1) { if (QFile::exists(files.at(0))) { if (files.at(0).endsWith(".tiff", Qt::CaseInsensitive)||files.at(0).endsWith(".tif", Qt::CaseInsensitive)) loadTIFF(files.at(0)); else { if (files.at(0).endsWith(".pdf", Qt::CaseInsensitive)) importPDF(files.at(0)); else { if (files.at(0).endsWith(".djvu", Qt::CaseInsensitive)) importDjVu(files.at(0)); else loadFile(files.at(0)); } } } return; } QProgressDialog pd(this); pd.setWindowTitle("YAGF"); pd.setLabelText(trUtf8("Loading files...")); pd.setRange(1, files.count()); pd.setValue(1); pd.show(); for (int i = 0; i < files.count(); i++) { if (QFile::exists(files.at(i))) { if (files.at(i).endsWith(".tiff", Qt::CaseInsensitive)||files.at(i).endsWith(".tif", Qt::CaseInsensitive)) loadTIFF(files.at(i)); else { if (files.at(i).endsWith(".pdf", Qt::CaseInsensitive)) importPDF(files.at(i)); else { if (files.at(i).endsWith(".djvu", Qt::CaseInsensitive)) importDjVu(files.at(i)); else loadFile(files.at(i)); } } } pd.setValue(i+1); QApplication::processEvents(); if (pd.wasCanceled()) // connectTC(true); break; } forbidAutoSave = false; } void MainForm::LangTextChanged(const QString &text) { if (selectLangsBox->findText(text, Qt::MatchStartsWith) < 0) selectLangsBox->lineEdit()->setText(""); } void MainForm::showConfigDlg() { ConfigDialog dialog(this); if (dialog.exec()) { //if (settings->getSelectedEngine() != ose) { QString oldLang = selectLangsBox->currentText(); selectLangsBox->clear(); if (settings->getSelectedEngine() == UseCuneiform) { engineLabel->setText(trUtf8("Using Cuneiform")); if (settings->selectedLanguagesAvailableTo("cuneiform").count() == 0) { styledWarningMessage(this, trUtf8("Cuneiform doesn't support any of selected recognition langualges.\nFalling back to tesseract. Please install tesseract.")); settings->setSelectedEngine(UseTesseract); engineLabel->setText(trUtf8("Using Tesseract")); } } if (settings->getSelectedEngine() == UseTesseract) { engineLabel->setText(trUtf8("Using Tesseract")); if (settings->selectedLanguagesAvailableTo("tesseract").count() == 0) { styledWarningMessage(this, trUtf8("Tesseract doesn't support any of selected recognition langualges.\nFalling back to cueniform. Please install cuneiform.")); settings->setSelectedEngine(UseCuneiform); engineLabel->setText(trUtf8("Using Cuneiform")); } } fillLangBox(); int newIndex = selectLangsBox->findText(oldLang); if (newIndex >= 0) { selectLangsBox->setCurrentIndex(newIndex); settings->setLanguage(selectLangsBox->itemData(newIndex).toString()); } else { settings->setLanguage("eng"); for (int i = 0; i < selectLangsBox->count(); i++) { QString s = selectLangsBox->itemData(i).toString(); if (s == "eng") { newLanguageSelected(i); selectLangsBox->setCurrentIndex(i); break; } } } //} else fillLangBox(); toolBar->setIconSize(settings->getIconSize()); if (selectLangsBox->count() > 1) { selectLangsBox->setStyleSheet(""); slAction->setVisible(true); langLabel->setText(""); } else { if (settings->getSelectedLanguages().count() == 1) { slAction->setVisible(false); langLabel->setText(trUtf8("Recognition Language") + ": " + settings->getFullLanguageName(settings->getLanguage())); } } killTimer(timerId); timerId = startTimer(settings->getAutosaveInterval()*60000); } } void MainForm::importPDF(const QString &fileName) { if (!pdfx) { styledCriticalMessage(this, trUtf8("No compatible PDF converter software could be found. Please install either the pdftoppm utility or the GhostScript package (from this the gs command will be required).")); return; } PopplerDialog dialog(this); dialog.setPDFFile(fileName); if (dialog.exec()) { pdfx->setSourcePDF(dialog.getPDFFile()); if (pdfx->getSourcePDF().isEmpty()) { styledCriticalMessage(this, trUtf8("PDF file name may not be empty")); return; } pdfx->setStartPage(dialog.getStartPage()); pdfx->setStopPage(dialog.getStopPage()); pdfx->setOutputDir(); globalDeskew = settings->getAutoDeskew(); settings->setAutoDeskew(dialog.getDeskew()); QApplication::processEvents(); pdfx->run(); } } void MainForm::importDjVu(const QString &fileName) { dj2pf->convert(fileName); } void MainForm::addPDFPage(QString pageName, int current, int total) { Unlocker unlocker(GlobalLock::instance()->lock()); if (pdfPD == 0) return; QFile fl(pageName); while (!fl.exists()) { if (pdfPD == 0) return; else if (!pdfPD->isVisible()) return; } while (!pages->appendPage(pageName)) { if (pdfPD == 0) return; else if (!pdfPD->isVisible()) return; } pages->setDeskewed(true); if (total != 0) { int ratio = (current*100)/total; pdfPD->setValue(ratio); } else pdfPD->setValue(pdfPD->value()+1); } void MainForm::finishedPDF() { delete pdfPD; pdfPD = 0; settings->setAutoDeskew(globalDeskew); } void MainForm::loadImage() { if(!GlobalLock::instance()->lock()) return; Unlocker unlocker(true); QFileDialog dialog(this, trUtf8("Open Image"), settings->getLastDir(), trUtf8("Image Files (*.png *.jpg *.jpeg *.bmp *.tiff *.tif *.gif *.pnm *.pgm *.pbm *.ppm *.pdf *.djvu)")); dialog.setFileMode(QFileDialog::ExistingFiles); if (dialog.exec()) { QStringList fileNames; fileNames = dialog.selectedFiles(); settings->setLastDir(dialog.directory().path()); foreach(QString fn, fileNames) { if (fn.endsWith(".pdf", Qt::CaseInsensitive)) importPDF(fn); } for (int i = fileNames.count()-1; i >= 0; i--) { if (fileNames.at(i).endsWith(".pdf", Qt::CaseInsensitive)) fileNames.removeAt(i); } if (fileNames.count() > 0) { loadFiles(fileNames); } } } void MainForm::singleColumnButtonClicked() { //singleColumn = singleColumnButton->isChecked(); } void MainForm::closeEvent(QCloseEvent *event) { killTimer(timerId); if (scanner) { delete scanner; scanner = NULL; } settings->setSize(size()); settings->setPosition(pos()); settings->setFullScreen(isFullScreen()); settings->writeSettings(); if (dirty) { QPixmap icon; icon.load(":/images/question.png"); QMessageBox messageBox(QMessageBox::NoIcon, "YAGF", trUtf8("There is an unsaved data. Do you want to save or to discard it?"), QMessageBox::Save | QMessageBox::Ignore, this); messageBox.setIconPixmap(icon); int result = messageBox.exec(); if (result == QMessageBox::Save){ if (projectName.isEmpty()) { SaveProjectDialog spd(settings->getProjectDir(), this); spd.exec(); projectName = spd.projectPath(); } if (!projectName.isEmpty()) { ProjectSaver ps; ps.save(projectName); } } } delTmpFiles(); delAutoSaveFiles(); event->accept(); QXtUnixSignalCatcher::catcher()->disconnectUnixSugnals(); pages->clear(); } void MainForm::rotateCWButtonClicked() { QCursor oldCursor = cursor(); setCursor(Qt::WaitCursor); pages->rotate90CW(); setCursor(oldCursor); if (!pages->hasPage()) styledWarningMessage(this, trUtf8("No image loaded")); } void MainForm::rotateCCWButtonClicked() { QCursor oldCursor = cursor(); setCursor(Qt::WaitCursor); pages->rotate90CCW(); setCursor(oldCursor); if (!pages->hasPage()) styledWarningMessage(this, trUtf8("No image loaded")); } void MainForm::rotate180ButtonClicked() { QCursor oldCursor = cursor(); setCursor(Qt::WaitCursor); pages->rotate180(); setCursor(oldCursor); if (!pages->hasPage()) styledWarningMessage(this, trUtf8("No image loaded")); } void MainForm::enlargeButtonClicked() { if (!pages->hasPage()) styledWarningMessage(this, trUtf8("No image loaded")); pages->makeLarger(); } void MainForm::decreaseButtonClicked() { if (!pages->hasPage()) styledWarningMessage(this, trUtf8("No image loaded")); pages->makeSmaller(); } void MainForm::initSettings() { settings = Settings::instance(); if (settings->getFullScreen()) showFullScreen(); else { move(settings->getPosition()); resize(settings->getSize()); } actionCheck_spelling->setChecked(settings->getCheckSpelling()); actionSelect_HTML_format->setChecked(settings->getOutputFormat() != "text"); QList li; li.append(1); li.append(1); splitter->setSizes(li); toolBar->setIconSize(settings->getIconSize()); } void MainForm::newLanguageSelected(int index) { if (index < 0) return; settings->setLanguage(selectLangsBox->itemData(index).toString()); actionCheck_spelling->setEnabled(textEdit->hasDict(settings->getLanguage())); if (settings->getCheckSpelling()) { settings->setCheckSpelling(textEdit->spellCheck(settings->getLanguage())); //actionCheck_spelling->setEnabled(checkSpelling); actionCheck_spelling->setChecked(settings->getCheckSpelling()); } } void MainForm::scanImage() { if (useXSane) { if (scanner) { delete scanner; } ScannerFactory *sf = new ScannerFactory(); scanner = sf->createScannerFE("xsane"); if (scanner == NULL) { styledWarningMessage(this, trUtf8("Scanning is impossible. No scanning front-end is found.\nPlease install XSane in order to perform scanning.")); return; } scanner->setOutputFile(settings->workingDir() + settings->getScanOutputFile()); delete sf; scanner->exec(); } } void MainForm::loadFile(const QString &fn, bool loadIntoView) { // dirty = true; QCursor oldCursor = cursor(); setCursor(Qt::WaitCursor); if (pages->appendPage(fn)) { if (loadIntoView) { pages->makePageCurrent(pages->count()-1); textEdit->clear(); loadPage(true); sideBar->item(sideBar->count()-1)->setSelected(true); } } else { styledWarningMessage(this, trUtf8("Failed to load image %1").arg(fn)); } setCursor(oldCursor); } void MainForm::loadTIFF(const QString &fn, bool loadIntoView) { TiffImporter ti(fn); ti.exec(); QStringList files = ti.extractedFiles(); if (!files.count()) { QMessageBox mb; mb.setWindowTitle("YAGF"); mb.setIconPixmap(QPixmap(":/critical.png")); mb.setText(trUtf8("Cannot open file %1. Make sure imagemagick and tifftopnm are installed.").arg(fn)); mb.addButton(QMessageBox::Close); mb.exec(); return; } loadFiles(files); } void MainForm::delTmpFiles() { QDir dir(settings->workingDir()); dir.setFilter(QDir::Files | QDir::NoSymLinks); for (uint i = 0; i < dir.count(); i++) { if (dir[i].endsWith("jpg") || dir[i].endsWith("bmp") || dir[i].endsWith("png") || dir[i].endsWith("txt") || dir[i].endsWith("ygf")) dir.remove(dir[i]); } if (pdfx) pdfx->setOutputDir(); delTmpDir(); } void MainForm::delAutoSaveFiles() { QString autosaveDir = settings->workingDir() +"autosave/"; QDir dir1(autosaveDir); foreach(QString s, dir1.entryList()) { QFile::remove(autosaveDir + s); } } void MainForm::loadNextPage() { } void MainForm::loadPreviousPage() { } void MainForm::showAboutDlg() { QPixmap icon; icon.load(":/yagf.png"); QMessageBox aboutBox(QMessageBox::NoIcon, trUtf8("About YAGF"), trUtf8("

YAGF - Yet Another Graphical Front-end for cuneiform and tesseract OCR engines

Version %1

Ⓒ 2009-2014 Andrei Borovsky

This is a free software distributed under GPL v3. Visit http://symmetrica.net/cuneiform-linux/yagf-en.html for more details.").arg(version), QMessageBox::Ok); aboutBox.setIconPixmap(icon); QList labels = aboutBox.findChildren(); for (int i = 0; i < labels.count(); i++) { QLabel *lab = labels.at(i); lab->setTextInteractionFlags(Qt::TextBrowserInteraction); } aboutBox.setTextFormat(Qt::RichText); aboutBox.exec(); } void MainForm::showHelp() { QDesktopServices::openUrl(QUrl(trUtf8("http://symmetrica.net/cuneiform-linux/yagf-en.html"))); } void MainForm::readyRead(int sig) { QFile f(settings->workingDir() + settings->getScanOutputFile()); QString newName = QString(settings->workingDir() + "scan-input-%1.png").arg(ifCounter); ifCounter++; QFileInfo fi(newName); if (fi.exists()) { QFile f2(newName); f2.remove(); } f.rename(newName); loadFile(newName); } void MainForm::delTmpDir() { QDir dir; dir.setPath(settings->workingDir() + "output_files"); dir.setFilter(QDir::Files | QDir::NoSymLinks); for (uint i = 0; i < dir.count(); i++) { if (dir[i].endsWith("jpg") || dir[i].endsWith("bmp") || dir[i].endsWith("ygf")) dir.remove(dir[i]); } dir.rmdir(settings->workingDir() + "output_files"); } void MainForm::fillLangBox() { if (!slAction->isVisible()) { if (settings->getSelectedLanguages().count() > 1) { slAction->setVisible(true); } } else { if (settings->getSelectedLanguages().count() == 1) { slAction->setVisible(false); } } disconnect(selectLangsBox, SIGNAL(currentIndexChanged(int)), this, SLOT(newLanguageSelected(int))); QStringList sl = Settings::instance()->getSelectedLanguages(); settings->startLangPair(); QString full; QString abbr; selectLangsBox->clear(); while (settings->getLangPair(full, abbr)) { if (sl.contains(full)||(sl.count()== 0)) selectLangsBox->addItem(full, QVariant(abbr)); } selectLangsBox->setCurrentIndex(-1); connect(selectLangsBox, SIGNAL(currentIndexChanged(int)), this, SLOT(newLanguageSelected(int))); if (selectLangsBox->model()->rowCount()) { int index = 0; QString s = Settings::instance()->getLanguage(); for (int i =0; i < selectLangsBox->count(); i++) { if (selectLangsBox->itemData(i) == s) { index = i; break; } } selectLangsBox->setCurrentIndex(index); } } void MainForm::createRW() { rw = new RecognizerWrapper(this); connect(rw, SIGNAL(finished(int)), this, SLOT(recognitionFinished()), Qt::QueuedConnection); connect(rw, SIGNAL(error(QString)), this, SLOT(recognitionError(QString)), Qt::QueuedConnection); connect(rw, SIGNAL(readOutput(QString, QChar)), this, SLOT(readOutput(QString, QChar)), Qt::QueuedConnection); rd = new RecognitionDialog(this); connect(rd, SIGNAL(rejected()), this, SLOT(cancelRecognition())); connect(rw, SIGNAL(blockRecognized(int)), rd, SLOT(blockRecognized(int))); rd->show(); } void MainForm::createRecentMenu() { QMenu * project = new QMenu(); QStringList sl = settings->getRecentProjects(); foreach (QString s, sl) { MenuAction * ma = new MenuAction(s); connect(ma, SIGNAL(triggered(QString)), this, SLOT(menuTriggered(QString))); project->addAction(ma); } actionRecent_Projects->setMenu(project); } void MainForm::loadProjectInternal(const QString &path) { WaitWindow * ww = new WaitWindow(this); ww->setWindowOpacity(0); ww->show(); QApplication::processEvents(); QApplication::processEvents(); pages->clear(); ProjectLoader pl; if (!pl.load(path)) styledWarningMessage(this, trUtf8("Failed to load project.")); else projectName = path; delete ww; } void MainForm::connectTC(bool doIt) { if (doIt) connect(textEdit, SIGNAL(textChanged()), this, SLOT(textChanged()), Qt::UniqueConnection); else disconnect(textEdit, SIGNAL(textChanged()), this, SLOT(textChanged())); } void MainForm::loadAutoSaved() { loadProjectInternal(settings->workingDir() + "autosave/" ); dirty = true; } void MainForm::saveTextInternal(bool allText) { if (pages->count()== 0) { styledWarningMessage(this, trUtf8("Nothing to save")); return; } Settings *settings = Settings::instance(); QString filter; //if (settings->getOutputFormat() == "text") filter = trUtf8("Text Files (*.txt)"); //else // filter = trUtf8("HTML Files (*.html)"); QString title = allText ? trUtf8("Save All Text") : trUtf8("Save Current Page Text"); QFileDialog dialog(this, title, settings->getLastOutputDir(), filter); // if (settings->getOutputFormat() == "text") dialog.setDefaultSuffix("txt"); // else // dialog.setDefaultSuffix("html"); dialog.setAcceptMode(QFileDialog::AcceptSave); if (dialog.exec()) { QStringList fileNames; fileNames = dialog.selectedFiles(); settings->setLastOutputDir(dialog.directory().path()); //if (settings->getOutputFormat() == "text") { if (allText) PageCollection::instance()->saveAllText(fileNames.at(0), true); else PageCollection::instance()->SaveCurrentPageText(fileNames.at(0), true); //} // else // saveHtml(&textFile); } } void MainForm::clickMeAgain() { QToolTip::showText(actPos, trUtf8("Click Me again!")); } void MainForm::setResizingCusor() { //scrollArea->widget()->setCursor(*resizeBlockCursor); } void MainForm::setUnresizingCusor() { //scrollArea->widget()->setCursor(QCursor(Qt::ArrowCursor)); } void MainForm::loadPage(bool show) { bool wasDirty = dirty; connectTC(false); textEdit->clear(); try { if (!pages->currentText().isEmpty()) textEdit->setText(pages->currentText()); } catch(...) { textEdit->clear(); } if (show) { graphicsInput->loadImage(pages->pixmap()); graphicsInput->clearBlocks(); } connectTC(true); QApplication::processEvents(); if (show) for (int i = 0; i < pages->blockCount(); i++) graphicsInput->addBlockColliding(pages->getBlock(i)); QFileInfo fi(pages->originalFileName()); setWindowTitle(QString("YAGF - %1").arg(fi.fileName())); dirty = wasDirty; } /*void MainForm::recognizeAll() { if (pages->count() == 0) return; QProgressDialog progress(trUtf8("Recognizing pages..."), trUtf8("Abort"), 0, pages->count(), this); progress.setWindowTitle("YAGF"); progress.show(); progress.setValue(0); pages->makePageCurrent(-1); for (int i = 0; i < pages->count(); i++) { progress.setValue(i); if (progress.wasCanceled()) break; pages->makeNextPageCurrent(); recognize(); } }*/ void MainForm::unalignButtonClicked() { /*if (((QSelectionLabel *) scrollArea->widget())->pixmap()->isNull()) return; int rot = ((FileToolBar *) m_toolBar)->getRotation(); int rrot = ((rot + 45)/90); rrot *=90; rotateImage(rrot - rot); rotation = rrot;*/ } void MainForm::on_ActionClearAllBlocks_activated() { if (!pages->hasPage()) { styledWarningMessage(this, trUtf8("No image loaded")); return; } pages->clearBlocks(); loadPage(true); } void MainForm::rightMouseClicked(int x, int y, bool inTheBlock) { m_menu->clear(); m_menu->addAction(ActionClearAllBlocks); if (inTheBlock) { m_menu->addAction(ActionDeleteBlock); m_menu->addAction(actionRecognize_block); m_menu->addAction(actionSave_block); m_menu->addAction(actionDeskew_by_Block); m_menu->addAction(actionSelect_Table); } else { m_menu->addAction(actionSelect_Text_Area); m_menu->addAction(actionSelect_multiple_blocks); } QPoint p = graphicsView->mapToGlobal(QPoint(x, y)); m_menu->move(p); m_menu->show(); } void MainForm::setupPDFPD() { pdfPD->setWindowTitle("YAGF"); pdfPD->setLabelText(trUtf8("Importing pages from the PDF document...")); pdfPD->setCancelButton(0); // pdfPD->setCancelButton(new QPushButton()); //pdfPD->setCancelButtonText(trUtf8("Cancel")); pdfPD->setMinimum(-1); pdfPD->setMaximum(-1); pdfPD->setModal(true); pdfPD->setWindowIcon(QIcon(":/yagf.png")); /*if (pdfx) { connect(pdfPD, SIGNAL(canceled()), pdfx, SLOT(cancel())); connect(pdfPD, SIGNAL(canceled()), this, SLOT(cancelPDF())); }*/ } void MainForm::on_ActionDeleteBlock_activated() { if (!pages->hasPage()) { styledWarningMessage(this, trUtf8("No image loaded")); return; } QRect r = graphicsInput->getCurrentBlock(); if (r.width() == 0) r = graphicsInput->getActiveBlock(); graphicsInput->deleteCurrentBlock(); graphicsInput->deleteActiveBlock(); pages->deleteBlock(r); } void MainForm::on_actionRecognize_block_activated() { connectTC(false); if (!RecognizerWrapper::findEngine(true)) { styledWarningMessage(this, trUtf8("Selected recognition engine not found.")); return; } if (graphicsInput->getCurrentBlock().isNull()) return; clearTmpFiles(); QRect r = graphicsInput->getCurrentBlock(); r = pages->scaleRect(r); pages->saveRawBlockForRecognition(r, settings->workingDir() + settings->getRecognizeInputFile()); createRW(); rw->startSingleBlock(); } void MainForm::recognize() { createRW(); rw->start(); } /*void MainForm::on_actionRecognize_activated() { }*/ void MainForm::on_actionCheck_spelling_triggered() { settings->setCheckSpelling(actionCheck_spelling->isChecked()); } void MainForm::on_actionSave_current_image_activated() { QCursor oc = cursor(); setCursor(Qt::WaitCursor); QString format; QString fn = getFileNameToSaveImage(format); if (!fn.isEmpty()) { if (!(pages->savePageAsImage(fn, format))) styledWarningMessage(this, QObject::trUtf8("Failed to save the image")); } setCursor(oc); } QString MainForm::getFileNameToSaveImage(QString &format) { QString jpegFilter = QObject::trUtf8("JPEG Files (*.jpg)"); QString pngFilter = QObject::trUtf8("PNG Files (*.png)"); QStringList filters; format = "JPEG"; filters << jpegFilter << pngFilter; QFileDialog dialog(this, trUtf8("Save Image"), settings->getLastOutputDir()); dialog.setFilters(filters); dialog.setAcceptMode(QFileDialog::AcceptSave); dialog.setDefaultSuffix("jpg"); if (dialog.exec()) { if (dialog.selectedNameFilter() == jpegFilter) { format = "JPEG"; dialog.setDefaultSuffix("jpg"); } else if (dialog.selectedNameFilter() == pngFilter) { format = "PNG"; dialog.setDefaultSuffix("png"); } QStringList fileNames; fileNames = dialog.selectedFiles(); settings->setLastOutputDir(dialog.directory().path()); return fileNames.at(0); } return ""; } MainForm::~MainForm() { closeAll(); delete _asm; delete resizeBlockCursor; delete resizeCursor; delete graphicsInput; delete ba; delete pdfx; delete dj2pf; delete epd; } void MainForm::on_actionSave_block_activated() { QString format; QString fn = getFileNameToSaveImage(format); if (!fn.isEmpty()) pages->saveBlockForRecognition(graphicsInput->getCurrentBlock(), fn, format); } void MainForm::on_actionCheck_spelling_activated() { settings->setCheckSpelling(actionCheck_spelling->isChecked()); if (settings->getCheckSpelling()) { actionCheck_spelling->setChecked(textEdit->spellCheck(settings->getLanguage())); } else textEdit->unSpellCheck(); } /*void MainForm::on_alignButton_clicked() { this->AnalizePage(); }*/ void MainForm::upscale() { Settings::instance()->setUpscale(!(Settings::instance()->getUpscale())); } void MainForm::on_actionSelect_HTML_format_activated() { if (actionSelect_HTML_format->isChecked()) settings->setOutputFormat("html"); else settings->setOutputFormat("text"); } void MainForm::pasteimage() { QClipboard *clipboard = QApplication::clipboard(); QPixmap pm = clipboard->pixmap(); if (pm.isNull()) { QMessageBox mb(this); mb.setIconPixmap(QPixmap(":/warning.png")); mb.setWindowTitle(trUtf8("Warning")); mb.setText(trUtf8("Clipboard doesn't contain an image.")); mb.setButtonText(0, trUtf8("OK")); mb.exec(); return; } QCursor oldCursor = cursor(); setCursor(Qt::WaitCursor); QString tmpFile = settings->tmpFileName() + ".png"; pm.save(tmpFile, "PNG"); loadFile(tmpFile); setCursor(oldCursor); dirty = true; } void MainForm::deskewByBlock() { pages->deskew(); } void MainForm::selectTextArea() { if (!pages->hasPage()) { styledWarningMessage(this, trUtf8("No image loaded")); return; } pages->blockAllText(); } void MainForm::addSnippet(int index) { sideBar->addItem(pages->snippet()); } void MainForm::preprocessPage() { if (!pages->hasPage()) { styledWarningMessage(this, trUtf8("No image loaded")); return; } QCursor oldCursor = cursor(); setCursor(Qt::WaitCursor); if (!pages->splitPage(true)) styledWarningMessage(this, trUtf8("Failed to detect text areas on this page.\nThe page possibly lacks contrast. Try to select blocks manually.")); setCursor(oldCursor); } void MainForm::saveProjectAs() { SaveProjectDialog sp(settings->getProjectDir(), this); sp.exec(); QString pp = sp.projectPath(); if (pp == "") return; QDir dir(pp); if (!dir.mkpath(pp)) { styledCriticalMessage(this, trUtf8("Cannot create the project directory ")); return; } QCursor oldCursor = cursor(); dirty = false; _asm->startAutoSave(); projectName = pp; setCursor(oldCursor); } void MainForm::saveProject() { if (projectName.contains(".config/yagf/autosave")) projectName = ""; if (projectName != "") { dirty = false; _asm->startAutoSave(); } else saveProjectAs(); } void MainForm::loadProject() { closeAll(); LoadProjectDialog lpd(settings->getProjectDir(), this); lpd.exec(); QString project = lpd.projectPath(); if (project != "") { loadProjectInternal(project); } dirty = false; } void MainForm::selectBlocks() { if (!pages->hasPage()) { styledWarningMessage(this, trUtf8("No image loaded")); return; } QCursor oldCursor = cursor(); setCursor(Qt::WaitCursor); if (!pages->splitPage(false)) styledWarningMessage(this, trUtf8("Failed to detect text areas on this page.\nThe page possibly lacks contrast. Try to select blocks manually.")); setCursor(oldCursor); } void MainForm::selectHTMLformat() { if (actionSelect_HTML_format->isChecked()) settings->setOutputFormat("html"); else settings->setOutputFormat("text"); } void MainForm::SelectRecognitionLanguages() { LangSelectDialog lsd; if (lsd.exec() == QDialog::Accepted) fillLangBox(); } void MainForm::selectLanguages() { LangSelectDialog lsd(this); // ;) lsd.exec(); fillLangBox(); } void MainForm::deskewByLine() { if (!pages->hasPage()) styledWarningMessage(this, trUtf8("No image loaded")); if (!graphicsInput->getDeskewMode()) { pages->clearBlocks(); graphicsInput->setDeskewMode(true); actPos = QCursor::pos(); QPoint gp = graphicsView->mapToGlobal(QPoint(16, 16)); QToolTip::showText(gp, trUtf8("Draw the line along a string of text with left mouse button"), graphicsView); } else { QLineF l = graphicsInput->getDeskData(); graphicsInput->clearDeskLine(); pages->deskew(l.x1(), l.y1(), l.x2(), l.y2()); } } void MainForm::timerEvent(QTimerEvent * e) { if (!GlobalLock::instance()->lock()) { e->accept(); QMainWindow::timerEvent(e); return; } GlobalLock::instance()->unlock(); if (pages->hasPage()) _asm->startAutoSave(); connectTC(false); e->accept(); QMainWindow::timerEvent(e); } void MainForm::on_actionKeep_Lines_toggled(bool arg1) { settings->setKeepLines(arg1); } void MainForm::readOutput(QString text, QChar separator) { textEdit->append(text); //textEdit->append(QString(separator)); if (settings->getCheckSpelling()) { actionCheck_spelling->setChecked(textEdit->spellCheck(settings->getLanguage())); } } void MainForm::recognitionFinished() { pages->setText(textEdit->toPlainText()); connectTC(true); delete rw; rw = 0; if (rd) delete(rd); rd = 0; dirty = true; } void MainForm::recognitionError(const QString &text) { connectTC(true); if (rd) delete(rd); rd = 0; styledWarningMessage(this, text); delete rw; rw = 0; } void MainForm::reportError(const QString &text) { connectTC(true); styledWarningMessage(this, text); } void MainForm::cancelRecognition() { connectTC(true); if (rw) rw->cancel(); delete rw; rw = 0; if (rd) delete(rd); rd = 0; } void MainForm::splitTable() { if (!pages->hasPage()) { styledWarningMessage(this, trUtf8("No image loaded")); return; } pages->splitTable(); loadPage(true); //textChanged(); } void MainForm::showPDFprogress() { epd->hide(); pdfPD = new QProgressDialog(this, Qt::Dialog|Qt::WindowStaysOnTopHint); setupPDFPD(); pdfPD->show(); pdfPD->setMinimum(0); pdfPD->setMaximum(100); dirty = true; } void MainForm::extProcStarted() { epd->setWindowTitle(trUtf8("Extracting PDF Pages")); epd->show(); } void MainForm::djvuStarted() { connect(epd, SIGNAL(rejected()), dj2pf, SLOT(cancel())); epd->setWindowTitle(trUtf8("Converting DjVu to PDF")); epd->show(); } void MainForm::djvuFinished() { disconnect(epd, SIGNAL(rejected()), dj2pf, SLOT(cancel())); epd->hide(); importPDF(dj2pf->pdfName()); } void MainForm::menuTriggered(const QString &text) { loadProjectInternal(text); } void MainForm::closeAll() { dirty = false; setWindowTitle("YAGF"); pages->clear(); sideBar->clear(); graphicsInput->clear(); textEdit->clear(); projectName = ""; } void MainForm::startedAutoSave() { _asm->work(projectName); epd->setWindowTitle(trUtf8("Autosave")); epd->show(); } void MainForm::autosaveFinished() { // graphicsInput->clearBlocks(); epd->hide(); if (projectName != "") dirty = false; connectTC(true); } void MainForm::testslot() { _asm->startAutoSave(); } void MainForm::textChanged() { dirty = true; if (pages->count() == 0) dirty = false; pages->setText(textEdit->toPlainText()); } void MainForm::afterConstructor() { QString autosaveDir = settings->workingDir() +"autosave/"; QDir dir(autosaveDir); if (!dir.exists()) dir.mkdir(autosaveDir); QFileInfo fi(autosaveDir + "yagf_project.xml"); if (fi.exists()) { QPixmap icon; icon.load(":/images/question.png"); QMessageBox messageBox(QMessageBox::NoIcon, "YAGF", trUtf8("There is an unsaved data left from the previous session. Do you want to open or discard it?"), QMessageBox::Open | QMessageBox::Ignore, this); messageBox.setIconPixmap(icon); int result = messageBox.exec(); if (result == QMessageBox::Open) loadAutoSaved(); delAutoSaveFiles(); } } void MainForm::markDirty() { dirty = true; } void MainForm::saveAllText() { saveTextInternal(true); } void MainForm::saveCurrentText() { saveTextInternal(false); } yagf-0.9.5+repack1/src/langselectdialog.ui000755 001750 001750 00000011372 13631520722 022064 0ustar00boradminboradmin000000 000000 LangSelectDialog 0 0 665 556 YAGF Languages Setup 1.000000000000000 800 24 12 75 true Select the recognition languages Qt::AlignCenter 16 Qt::Horizontal 40 20 Cuneiform Qt::AlignCenter 256 0 0 0 Tesseract Qt::AlignCenter 256 0 Qt::Horizontal 40 20 Qt::Horizontal 40 20 Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() LangSelectDialog accept() 248 254 157 274 buttonBox rejected() LangSelectDialog reject() 316 260 286 274 yagf-0.9.5+repack1/src/saveprojectdialog.ui000755 001750 001750 00000012740 13631520722 022270 0ustar00boradminboradmin000000 000000 SaveProjectDialog 0 0 600 390 Save Project QAbstractItemView::DragDrop 32 32 QListView::LeftToRight true 120 64 QListView::IconMode color: rgb(255, 85, 127); 23 25 23 25 Move Backwards :/images/back_arrow.png:/images/back_arrow.png 23 25 23 25 Move to the Upper Directory :/images/up_arrow.png:/images/up_arrow.png Qt::Horizontal 40 20 Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() SaveProjectDialog accept() 248 254 157 274 buttonBox rejected() SaveProjectDialog reject() 316 260 286 274 pushButton clicked() SaveProjectDialog goBackwards() 549 331 299 194 pushButton_2 clicked() SaveProjectDialog goUp() 578 331 299 194 lineEdit textChanged(QString) SaveProjectDialog lineEditTextChanged(QString) 270 331 299 194 goBackwards() goUp() lineEditTextChanged(QString) yagf-0.9.5+repack1/src/djvu2pdf.h000755 001750 001750 00000002446 13631520722 020123 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2015 Andrei Borovsky 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 . */ #ifndef DJVU2PDF_H #define DJVU2PDF_H #include #include class Djvu2PDF : public QObject { Q_OBJECT public: explicit Djvu2PDF(QObject *parent = 0); ~Djvu2PDF(); void convert(const QString &fileName); QString pdfName() const; signals: void started(); void finished(); void error(const QString &text); public slots: void onError(); void cancel(); void onFinished(); private: QProcess process; QString pdfout; private: void clearFiles(); }; #endif // DJVU2PDF_H yagf-0.9.5+repack1/src/extprocessdialog.cpp000755 001750 001750 00000002420 13631520722 022301 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #include "extprocessdialog.h" #include "ui_extprocessdialog.h" ExtProcessDialog::ExtProcessDialog(QWidget *parent) : QDialog(parent), ui(new Ui::ExtProcessDialog) { ui->setupUi(this); ui->widget->startAnimation(); } ExtProcessDialog::~ExtProcessDialog() { delete ui; } void ExtProcessDialog::hideButton() { ui->pushButton->hide(); } void ExtProcessDialog::hide() { ui->pushButton->show(); QDialog::hide(); } void ExtProcessDialog::on_pushButton_clicked() { close(); } yagf-0.9.5+repack1/src/fileobjectitem.cpp000755 001750 001750 00000003125 13631520722 021712 0ustar00boradminboradmin000000 000000 /* 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. */ #include "fileobjectitem.h" #include #include #include #include FileObjectItem::FileObjectItem(FileObjectItemType itemType, const QString &fullName, QListWidget *parent) : QListWidgetItem(parent), fName(fullName), _type(itemType) { extractShortName(); setText(lName); setToolTip(lName); } FileObjectItem::FileObjectItemType FileObjectItem::getItemType() { return _type; } QString FileObjectItem::getShortName() { return lName; } QString FileObjectItem::getPath() { return fName; } void FileObjectItem::extractShortName() { QStringList sl = fName.split("/", QString::SkipEmptyParts); if (sl.count() > 0) { lName = sl.at(sl.count()-1); } else lName = "/"; QString path; switch(_type) { case EmptyDirectory: path = ":/images/folder.png"; break; case Directory: path = ":/images/folder_nempty.png"; break; case Project: path = ":/images/project.png"; break; default: path = ""; } setIcon(QIcon(path)); } yagf-0.9.5+repack1/src/droplabel.h000755 001750 001750 00000002356 13631520722 020343 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #ifndef DROPLABEL_H #define DROPLABEL_H #include class QListWidget; class DropLabel : public QLabel { Q_OBJECT public: DropLabel(QWidget *parent = 0, Qt::WindowFlags f = 0); void setListWidget(QListWidget *w); signals: void pageRemoved(int id); protected: void dragEnterEvent(QDragEnterEvent *event); void dragLeaveEvent(QDragLeaveEvent *event); void dropEvent(QDropEvent *event); private: QListWidget *lw; }; #endif // DROPLABEL_H yagf-0.9.5+repack1/src/page.cpp000755 001750 001750 00000051321 13631520722 017642 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2012 Andrei Borovsky 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 . */ #include "page.h" #include "settings.h" #include "core/ccbuilder.h" #include "core/rotationcropper.h" #include "core/pageanalysis.h" #include "core/analysis.h" #include "core/imageprocessor.h" #include "core/subimagepp.h" #include "globallock.h" #include #include #include #include #include Page::Page(const int pid, QObject *parent) : QObject(parent), selectedBlock(0,0,0,0) { imageLoaded = false; loadedBefore = false; ccbuilder = NULL; rotation = 0; deskewed = false; preprocessed = false; cropped = false; originalFN.clear(); mFileName.clear(); this->pid = pid; scale = 1; text = ""; } Page::~Page() { delete ccbuilder; } bool Page::loadFile(QString fileName, int tiled, bool loadIntoView) { if (fileName == "") { if (mFileName.isEmpty()) return false; fileName = mFileName; } if (!fileName.endsWith(".ygf", Qt::CaseInsensitive)) originalFN = fileName; rotation = 0; crop1.setX(0); crop1.setY(0); crop1.setWidth(0); crop1.setHeight(0); scale = 0.5; ImageProcessor ip; try { img = ip.loadFromFile(fileName); } catch (...) { return false; } imageLoaded = !img.isNull(); if (!imageLoaded) return false; if (img.format() != QImage::Format_ARGB32) img = img.convertToFormat(QImage::Format_ARGB32); if (ccbuilder) { delete ccbuilder; ccbuilder = 0; } ip.loadImage(img); settings = Settings::instance(); if (settings->getCropLoaded()) { if (!cropped) { ip.crop(); setCropped(true); } } img = ip.gsImage(); if (settings->getPreprocessed()&&(!preprocessed)) { ip.loadImage(img); ip.binarize(); img = ip.gsImage(); preprocessed = true; } if (Settings::instance()->getAutoDeskew()) { if (textHorizontal()) if (deskew()) { if (mFileName.isEmpty()) { ImageProcessor ip; QImage img1 = ip.loadFromFile(fileName); if (img1.format() != QImage::Format_ARGB32) img1 = img1.convertToFormat(QImage::Format_ARGB32); ip.loadImage(img1); ip.binarize(); mFileName = Settings::instance()->tmpYGFFileName(); ip.saveYGF(ip.gsImage(), mFileName); } return true; } } rotateImageInternal(img, rotation); mFileName = saveTmpPage("YGF"); loadedBefore = true; return true; } QPixmap Page::displayPixmap() { return QPixmap::fromImage(currentImage()); } QImage Page::thumbnail() { return img.scaled(img.width()*0.125, img.height()*0.125); } QString Page::recognizedText() { return text; } void Page::setRecognizedText(const QString &t) { text = t; } bool Page::makeLarger() { clearIntersected(); if (scale >= 2.0) return false; if (scale < 0.2) { scale = 0.2; return true; } if (scale < 0.25) { scale = 0.25; return true; } if (scale < 0.3) { scale = 0.3; return true; } if (scale < 0.5) { scale = 0.5; return true; } if (scale < 0.75) { scale = 0.75; return true; } if (scale < 0.85) { scale = 0.85; return true; } if (scale < 1.0) { scale = 1.0; return true; } if (scale < 1.5) { scale = 1.5; return true; } if (scale < 2.0) { scale = 2.0; return true; } return true; } bool Page::makeSmaller() { clearIntersected(); if (scale <= 0.125) { return false; } if (scale > 0.75) { scale = 0.75; return true; } if (scale > 0.5) { scale = 0.5; return true; } if (scale > 0.3) { scale = 0.3; return true; } if (scale > 0.25) { scale = 0.25; return true; } if (scale > 0.2) { scale = 0.2; return true; } if (scale > 0.125) scale = 0.125; return true; } void Page::clearIntersected() { foreach (Block b, blocks) { QRect r = b; Block ir = includes(r); if (ir.width() != 0) { deleteBlock( (b.blockNumber() < ir.blockNumber() ? b : ir)); break; } } } void Page::rotate(qreal angle) { rotateImageInternal(img, angle); rotation += angle; clearBlocks(); } void Page::unload() { if (ccbuilder) { delete ccbuilder; ccbuilder = 0; } img = QImage(0,0,QImage::Format_ARGB32); imageLoaded = false; } inline bool qrects_equal(QRect &r1, QRect &r2) { if (abs(r1.x() - r2.x()) > 2) return false; if (abs(r1.y() - r2.y()) > 2) return false; if (abs(r1.width() - r2.width()) > 2) return false; if (abs(r1.height() - r2.height()) > 2) return false; return true; } Block Page::includes(const QRect &rect) { foreach (Block b, blocks) { QRect r = b; if (rect != r) { if (rect.intersected(r).width()*rect.intersected(r).height() > 64) return r; } } return QRect(0,0,0,0); } void Page::addBlock(Block block, int blocknum, int inTable) { QRect r = block; //normalizeRect(r); scaleRect(r); bool add = true; foreach (Block b, blocks) { QRect r1 = b; if (r == r1) { add = false; break; } QRect ir = includes(r); if (ir.width() != 0) { deleteBlock(r); } } if (blocknum != 0) block.setBlockNumber(blocknum); if (add) { block.setRect(r.x(), r.y(), r.width(), r.height()); blocks.append(block); } if (blocknum == 0) { sortBlocksInternal(); renumberBlocks(); } if (inTable == 1) { block.setTableCell(true); } } void Page::deleteBlock(const Block &b) { blocks.removeOne(b); sortBlocksInternal(); renumberBlocks(); } void Page::deleteBlock(const QRect &r) { QRect rx = r; scaleRect(rx); foreach (Block b, blocks) { QRect r1 = b; if (qrects_equal(rx, r1)) { blocks.removeAll(b); break; } } sortBlocksInternal(); renumberBlocks(); } Block Page::getBlock(const QRect &r) { QRect rn =r; scaleRectToScale(rn); //normalizeRect(rn); foreach (Block b, blocks) { QRect r1 = b; if (qrects_equal(rn,r1)) { scaleRect(b); return b; } } return Block(0,0,0,0); } Block Page::getBlock(int index) { Block b = blocks.at(index); scaleRectToScale(b); return b; } int Page::blockCount() { return blocks.count(); } void Page::clearBlocks() { blocks.clear(); } void Page::savePageForRecognition(const QString &fileName) { if(Settings::instance()->getCropLoaded()) { ImageProcessor ip; ip.loadImage(img); ip.crop(); ip.gsImage().save(fileName, "BMP"); } else img.save(fileName, "BMP"); } bool Page::savePageAsImage(const QString &fileName, const QString &format) { return img.save(fileName, format.toAscii().data()); } void Page::saveRawBlockForRecognition(QRect r, const QString &fileName) { saveBlockForRecognition(r, fileName, "BMP"); } void Page::saveSubimage(QRect r, const QString &fileName) { QImage image = img.copy(r); if (Settings::instance()->getUpscale()) { ImageProcessor ip; image = ip.upScale(image, true); } image.save(fileName); } void Page::saveBlockForRecognition(QRect r, const QString &fileName, const QString &format) { clearIntersected(); //QRect rs = scaleRect(r); QImage image = img.copy(r); if (Settings::instance()->getUpscale()) { ImageProcessor ip; image = ip.upScale(image, true); } SubimagePP spp(image); spp.fillComponents(); spp.removeBars(); spp.removeNoise(); //applyTransforms(image, 1); image.save(fileName, format.toAscii().data()); } void Page::saveBlockForRecognition(int index, const QString &fileName) { foreach(Block b, blocks) { if (b.blockNumber() == index+1) { saveBlockForRecognition(b, fileName, "BMP"); return; } } saveBlockForRecognition(blocks.at(index), fileName, "BMP"); } void Page::selectBlock(const QRect &r) { QRect rn =r; //normalizeRect(rn); foreach (Block b, blocks) { QRect r1 = b; if (rn == r1) { selectedBlock = b; break; } } } Block Page::getSelectedBlock() { return selectedBlock; } bool Page::deskew(bool recreateCB) { if (deskewed) return false; if (imageLoaded) { prepareCCBuilder(); CCAnalysis *an = new CCAnalysis(ccbuilder); qreal angle = 0; if (an->analize()) { { QImage timg; timg = tryRotate(img, -atan(an->getK())*360/6.283); CCBuilder *cb2 = new CCBuilder(timg); cb2->labelCCs(); CCAnalysis *an2 = new CCAnalysis(cb2); an2->analize(true); // If use bars Bars bars = an2->getBars(); qreal barsAngle = 0.0; if (bars.count()) { Rect bar = bars[0]; int maxdim = abs(bar.x2 - bar.x1) > abs(bar.y2 - bar.y1) ? abs(bar.x2 - bar.x1) : abs(bar.y2 - bar.y1); for (int i = 1; i < bars.count(); i++) { int maxdim1 = abs(bars[i].x2 - bars[i].x1) > abs(bars[i].y2 - bars[i].y1) ? abs(bars[i].x2 - bars[i].x1) : abs(bars[i].y2 - bars[i].y1); if (maxdim1 > maxdim) bar = bars[i]; } if ((bar.x2 - bar.x1 != 0) && (bar.y2 - bar.y1 !=0)) { if (abs(bar.x2 - bar.x1) > abs(bar.y2 - bar.y1)) barsAngle = atan(float(bar.y2 - bar.y1)/float(bar.x2 - bar.x1)); else barsAngle = atan(float(bar.x2 - bar.x1)/float(bar.y2 - bar.y1)); } barsAngle=barsAngle*360/6.283; } angle = -atan(an2->getK())*360/6.283; delete an2; delete cb2; if (abs(angle*10) >= abs(3)) angle += (-atan(an->getK())*360/6.283); else angle = -atan(an->getK())*360/6.283; if ((barsAngle != 0)&&(angle == 0)) angle = -barsAngle; if (abs(angle*100) < 1) { deskewed = true; return false; } rotation = angle; } if (settings->getDoublePreprocessed()) { ImageProcessor ip; QImage img1 = ip.loadFromFile(originalFileName()); if (img1.format() != QImage::Format_ARGB32) img1 = img1.convertToFormat(QImage::Format_ARGB32); rotateImageInternal(img1, rotation); ip.loadImage(img1); ip.binarize(); img = ip.gsImage(); } else { rotate(angle); } ImageProcessor::cropAngles(img); QString fn = saveTmpPage("YGF"); deskewed = true; loadFile(fn, 1); delete ccbuilder; ccbuilder = 0; if (recreateCB) prepareCCBuilder(); } delete an; } return true; } void Page::deskew(int x1, int y1, int x2, int y2) { float dx = x2-x1; if (dx == 0) return; float dy = y2-y1; float angle = -atan(dy/dx)*360/6.283; if (abs(angle) >= 45) return; deskewed = true; if (abs(angle*100) < 1) return; rotate(angle); rotation = angle; ImageProcessor::cropAngles(img); QString fn = saveTmpPage("YGF"); deskewed = true; loadFile(fn, 1); } void Page::rotate90CW() { deskewed = false; rotate(90); } void Page::rotate90CCW() { deskewed = false; rotate(-90); } void Page::rotate180() { deskewed = false; rotate(180); } void Page::blockAllText() { prepareCCBuilder(); clearBlocks(); BlockSplitter bs; bs.setImage(img, rotation, scale); QRect r = bs.getRootBlock(currentImage()); addBlock(r); } QList Page::splitInternal() { clearBlocks(); BlockSplitter bs; //rotation = 0; bs.setImage(img, 0, 1.0);// sideBar->getScale()); bs.splitBlocks(); return bs.getBlocks(); } void Page::prepareCCBuilder() { if (!ccbuilder) { ccbuilder = new CCBuilder(img); ccbuilder->labelCCs(); } } bool Page::splitPage(bool preprocess) { QList blocks; prepareCCBuilder(); if (preprocess) { QString fn = saveTmpPage("YGF"); loadedBefore = false; loadFile(fn, 1); blocks = splitInternal(); /*if (blocks.count() == 0) { deskew(); fn =Settings::instance()->workingDir() + QString::fromUtf8("tmp-%1.bmp").arg((quint64)img2.data_ptr()); saveTmpPage(fn, true, false); loadedBefore = false; loadFile(fn); blocks = splitInternal(); }*/ preprocessed = true; } else { deskew(); blocks = splitInternal(); } qreal sf = scale; foreach (Rect block, blocks) { QRect r; block.x1 *=sf; block.y1 *=sf; block.x2 *= sf; block.y2 *=sf; block.x1 -=4; block.y1 +=6; block.x2 -= 4; block.y2 +=6; r.setX(block.x1); r.setY(block.y1); r.setWidth(block.x2 - block.x1); r.setHeight(block.y2 - block.y1); addBlock(r); } return blocks.count() != 0; } bool Page::textHorizontal() { return ImageProcessor::isTextHorizontal(img); } QString Page::fileName() { return mFileName; } QString Page::originalFileName() const { if (originalFN.isEmpty()) return mFileName; return originalFN; } void Page::setOriginalFileName(const QString &fn) { originalFN = fn; } int Page::pageID() { return pid; } void Page::sortBlocksInternal() { bool allBlocksNumbered = true; foreach(Block b, blocks) if (b.blockNumber() == 0) allBlocksNumbered = false; if (allBlocksNumbered) return; sortBlocks(blocks); } bool Page::isDeskewed() { return deskewed; } bool Page::isCropped() { return cropped; } void Page::setCropped(bool value) { cropped = value; } bool Page::isPreprocessed() { return preprocessed; } qreal Page::getRotation() { return rotation; } void Page::setDeskewed(bool value) { deskewed = value; } void Page::setPreprocessed(bool value) { preprocessed = value; } void Page::applyTransforms(QImage &image, qreal scale) { scale = scale*2; if (!isCropped()) { QRect crop; crop.setX(crop1.x()*scale); crop.setY(crop1.y()*scale); crop.setWidth(crop1.width()*scale); crop.setHeight(crop1.height()*scale); image = image.copy(crop); } rotateImageInternal(image, rotation); setCropped(true); } void Page::rotateImageInternal(QImage &image, qreal angle) { qreal x = image.width() / 2; qreal y = image.height() / 2; image = image.transformed(QTransform().translate(-x, -y).rotate(angle).translate(x, y), Qt::SmoothTransformation); } QRect Page::scaleRect(QRect &rect) { qreal iscale = 1./scale; qreal oldw = rect.width(); qreal oldh = rect.height(); rect.setX(rect.x()*iscale); rect.setY(rect.y()*iscale); rect.setWidth(oldw*iscale); rect.setHeight(oldh*iscale); return rect; } QRect Page::scaleTo(QRect &rect, qreal newScale) { qreal iscale = newScale/scale; qreal oldw = rect.width(); qreal oldh = rect.height(); rect.setX(rect.x()*iscale); rect.setY(rect.y()*iscale); rect.setWidth(oldw*iscale); rect.setHeight(oldh*iscale); return rect; } bool blocksLessThan( Block &b1, Block &b2) { if ((b1.top()/8) < (b2.top()/8)) return true; else if ((b1.top()/8) > (b2.top()/8)) return false; if ((b1.left()) < (b2.left())) return true; return false; } int findLine(QVector table, int startFrom) { if (startFrom > table.count()) return 0; int baseY = table.at(startFrom - 1).y()/8; for (int i = startFrom; i < table.count(); i++) { int curY = table.at(i).y()/8; if (curY != baseY) return i; } return table.count(); } void sortBlocks2(QVector &blocks) { qSort(blocks.begin(), blocks.end(), blocksLessThan); } void Page::splitTable() { Block bblock(0,0,0,0); if (blockCount() == 1) { bblock = blocks.at(0); clearBlocks(); } if (bblock.x() < 0) bblock.setX(0); if (bblock.y() < 0) bblock.setY(0); if (bblock.x() + bblock.width() > img.width()) bblock.setWidth(img.width() - 1 - bblock.x()); if (bblock.y() + bblock.height() > img.height()) bblock.setHeight(img.height() - 1 - bblock.y()); if (blockCount() == 1) { } ImageProcessor ip0; ip0.loadImage(img); QRect r = ip0.deskewByTable(bblock); deskew(r.x(), r.y(), r.x()+r.width(), r.y() + r.height()); ImageProcessor ip; ip.loadImage(img); QList b; b = ip.splitTable(bblock); if (b.count() < 3) { ImageProcessor ip1; ip1.loadImage(img); b = ip1.splitTableForce(bblock); } Blocks bs; for (int i = 0; i < b.count(); i++) { Rect r = b.at(i); Block block(r.x1, r.y1, r.x2-r.x1, r.y2-r.y1); scaleRectToScale(block); bs.append(block); } QVector vb; for (int i = 0; i < bs.count(); i++) vb.append(bs.at(i)); sortBlocks2(vb); for (int i = 0; i < vb.count(); i++) { addBlock(vb.at(i), i+1, 1); } vb.last().setRowEnd(true); emit refreshView(true); } QRect Page::scaleRectToScale(QRect &rect) { qreal oldw = rect.width(); qreal oldh = rect.height(); rect.setX(rect.x()*scale); rect.setY(rect.y()*scale); rect.setWidth(oldw*scale); rect.setHeight(oldh*scale); return rect; } QRect Page::shiftRectBeforeScale(QRect &rect, int sx, int sy) { int w = rect.width(); int h = rect.height(); int tx = rect.x() + sx; int ty = rect.y() + sy; rect.setX(tx); rect.setY(ty); rect.setWidth(w); rect.setHeight(h); return rect; } QImage Page::tryRotate(QImage image, qreal angle) { qreal x = image.width() / 2; qreal y = image.height() / 2; return image.transformed(QTransform().translate(-x, -y).rotate(angle).translate(x, y), Qt::SmoothTransformation); } QImage Page::currentImage() { if (!imageLoaded) { ImageProcessor ip; img = ip.loadYGF(mFileName); if (img.isNull()) img.load(mFileName); applyTransforms(img, 0.5); imageLoaded=true; } try { if (!img.isNull()) return img.scaled(img.width()*scale, img.height()*scale); else { ImageProcessor ip; img = ip.loadYGF(mFileName); if (img.isNull()) img.load(mFileName); applyTransforms(img, scale); return img; } } catch (...) { return img; } } #include QString Page::saveTmpPage(const QString &format) { QString fileName =Settings::instance()->tmpFileName(); // booster.flatten(&image); if (format == "BMP") { fileName = fileName +".bmp"; img.save(fileName, "BMP"); } else { fileName = fileName +".ygf"; ImageProcessor ip; ip.saveYGF(img, fileName); } return fileName; } void Page::reSaveTmpPage() { ImageProcessor ip; ip.saveYGF(img, mFileName); } void Page::renumberBlocks() { for (int i = 0; i < blocks.count(); i++) { blocks[i].setBlockNumber(i+1); } } yagf-0.9.5+repack1/src/translations/000755 001750 001750 00000000000 13631520723 020737 5ustar00boradminboradmin000000 000000 yagf-0.9.5+repack1/src/translations/yagf_uk.ts000644 001750 001750 00000137400 13631520723 022741 0ustar00boradminboradmin000000 000000 ConfigDialog YAGF Settings Настройки YAGF OCR and Languages OCR та мови Image Processing Обробка зображення Program Appearance Вигляд програми OCR Engine OCR-засіб Cuneiform Cuneiform Tesseract Tesseract Path to Tesseract Data Files Шлях до файлів даних Tesseract ... ... Recognize Languages Мови розпізнавання Use Single Language: Використовувати одну мову: Choose Among Several Languages Обирати серед декількох мов Languages to Use... Використовувати мови... Enhance Image Quality Покращення якості зображення Crop Image When Loaded Обрізати зображення під час завантаження Deskew Loaded Images Усувати перекоси завантажених зображень Process after Deskew Обробляти після усунення перекосу Preprocess Images When Loaded Попередньо обробляти зображення під час завантаження Interface Language Мова інтерфейсу Force English Locale Примусово англійська локаль Default Font Size Розмір шрифту за замовчуванням Tesseract Data Directory Каталог даних Tesseract LangSelectDialog YAGF Languages Setup Налаштування мов YAGF Select the recognition languages Оберіть мови розпізнавання Cuneiform Cuneiform Tesseract Tesseract Installed Встановлено Not installed Не встановлено Digits Only Цифри тільки MainForm Recognition language Мова розпізнавання Using Cuneiform Використання Cuneiform Using Tesseract Використання Tesseract Recognition Language Мова розпізнавання Loading files... Завантаження файлів... Cuneiform doesn't support any of selected recognition langualges. Falling back to tesseract. Please install tesseract. Cuneiform не підтримує жодну з обраних мов розпізнавання. Повернення до tesseract... Будь ласка встановіть tesseract. Tesseract doesn't support any of selected recognition langualges. Falling back to cueniform. Please install cuneiform. Tesseract не підтримує жодну з обраних мов розпізнавання. Повернення до cueniform... Будь ласка встановіть cueniform. No compatible PDF converter software could be found. Please install either the pdftoppm utility or the GhostScript package (from this the gs command will be required). Жодного сумісного PDF-конвертера не знайдено. Будь ласка, встановіть будь-яку з двох: утиліту pdftoppm або пакет GhostScript (з нього буде потрібна команда gs). PDF file name may not be empty Ім’я PDF-файлу не може бути порожнім Open Image Відкрити зображення Image Files (*.png *.jpg *.jpeg *.bmp *.tiff *.tif *.gif *.pnm *.pgm *.pbm *.ppm *.pdf) Файли зображень (*.png *.jpg *.jpeg *.bmp *.tiff *.tif *.gif *.pnm *.pgm *.pbm *.ppm *.pdf) There is an unsaved text in the editor window. Do you want to save it? У вікні редактора є незбережений текст . Хочете зберегти його? No image loaded Жодного зображення не завантажено Scanning is impossible. No scanning front-end is found. Please install XSane in order to perform scanning. Сканування неможливе. Будь ласка встановіть XSane для виконання сканування. Failed to load image %1 Не вдалося завантажити зображення %1 Cannot open file %1. Make sure imagemagick and tifftopnm are installed. Неможливо відкрити файл %1. Будьте упевнені що imagemagick і tifftopnm встановлені. About YAGF Про YAGF <p align="center"><b>YAGF - Yet Another Graphical Front-end for cuneiform and tesseract OCR engines</b></p><p align="center">Version %1</p> <p align="center">Ⓒ 2009-2014 Andrei Borovsky</p> This is a free software distributed under GPL v3. Visit <a href="http://symmetrica.net/cuneiform-linux/yagf-en.html">http://symmetrica.net/cuneiform-linux/yagf-en.html</a> for more details. <p align="center"><b>YAGF — Ще один графічний інтерфейс для OCR-засобів cuneiform і tesseract</b></p><p align="center">Версія %1</p> <p align="center">Ⓒ 2009-2014 Андрєй Боровскій</p> Це відкрите програмне забезпечення, що розповсюджується під GPL v3. Відвідайте <a href="http://symmetrica.net/cuneiform-linux/yagf-en.html">http://symmetrica.net/cuneiform-linux/yagf-ru.html</a> для отримання додаткової інформації. http://symmetrica.net/cuneiform-linux/yagf-en.html http://symmetrica.net/cuneiform-linux/yagf-en.html Click Me again! Клацни на мені знову! Importing pages from the PDF document... Імпортування сторінок з PDF-документу... Selected recognition engine not found. Обраний засіб розпізнавання не знайдено. Save Image Зберегти зображення Warning Застереження Clipboard doesn't contain an image. Буфер обміну не містить зображення. OK Гаразд Failed to detect text areas on this page. The page possibly lacks contrast. Try to select blocks manually. Не вдалося виявити текстові області на цій сторінці. На сторінці, можливо, не вистачає контрастності. Спробуйте обрати блоки вручну. The selected directoy is not empty. Please select or create another one. Обраний каталог не порожній. Будь ласка оберіть або створіть інший. Failed to save the project. Не вдалося зберегти проект. Failed to load project. Не вдалося завантажити проект. Draw the line along a string of text with left mouse button Намалюйте лінію уздовж рядка тексту лівою кнопкою миші MainWindow MainWindow &File &Файл &Help &Довідка &Edit &Правка toolBar Image acquisition Отримання зображення toolBar_2 Image manpulation Обробка зображення toolBar_3 Recognition Розпізнавання toolBar_4 Text manipulation Обробка тексту toolBar_5 S&can... &Сканування... Scanning images using XSane... Сканування зображень через XSane... Ctrl+N Ctrl+N &Save text... &Зберегти текст... Ctrl+S Ctrl+S &Open Image... &Відкрити зображення... Open Image Відкрити зображення Ctrl+O Ctrl+O &Recognize &Розпізнати Recognizing text... Розпізнавання тексту... Ctrl+R Ctrl+R Choose &Language Обрати &Мову Quit Вийти Ctrl+Q Ctrl+Q Previous page Попередня сторінка Move to previous image Перейти до попереднього зображення Next page Наступна сторінка Move to next image Перейти до наступного зображення Online Help Мережева довідка About... Про... Copy Text to Clipboard Копіювати текст до буферу Copy recognized text to clipboard Копіювати розпізнаний текст до буферу Recognize &All Pages Розпізнати &усі сторінки Recognize All Pages Розпізнати усі сторінки Ctrl+A Ctrl+A Clear all blocks Очистити усі блоки Delete the current block Видалити поточний блок Recognize block Розпізнати блок Recognize this block Розпізнати цей блок Clear numbers Очистити нумерацію Crear block numbering Очистити нумерацію блоків Check spelling Перевірка орфограції Save current image... Зберегти поточне зображення... Save currently opened image in its real size Зберегти поточне відкрите зображення в його реальному розмірі Save block Зберегти блок Save the current block to the image file Зберегти поточний блок до файлу зображення Enlarge Page Script Збільшити символи Select HTML format Обрати HTML-формат Select HTML format as recognition output Обрати HTML-формат у якості виводу розпізнавання Larger view (Ctrl + Mouse Wheel) Збільшити вигляд (Ctrl + Mouse Wheel) Smaller view (Ctrl + Mouse Wheel) Зменшити вигляд (Ctrl + Mouse Wheel) Rotate 90 CCW Повернути на 90° проти годинникової стрілки Rotate 180 Повернути на 180° Rotate 90 CW Повернути на 90° за годинниковою стрілкою Align Page by Guideline Вирівняти сторінку за контрольною лінією Settings Настройки Paste Image Вставити зображення Paste image from clipboard Вставити зображення з буферу обміну Select Text Area Автоматично виділити область тексту Deskew Block Усунути перекос блоку Deskew the current block Усунути перекос поточного блоку Select multiple blocks Виділити декілька блоків Splits text into several blocks Розділити текст на декілька блоків Toggle Large/Small Icons Перемикнути великі/малі значки Select Recognition Language Обрати мову розпізнавання Save Project... Зберегти проект... Load Project... Завантажити проект... Select Recognition Languages... Обрати мови розпізнавання... Select Recognition Languages Обрати мови розпізнавання Select All Text Виділити увесь текст Select all the recognized text Виділити увесь розпізнаний текст Select languages for recognition Обрати мови для розпізнавання Keep Lines Зберігати розподіл на рядки Keep line-breaks in the scanned text Зберігати розриви рядків у відсканованому тексті PopplerDialog Import from PDF Імпортувати з PDF File Name Ім’я файлу Select... Обрати... Pages Сторінки From З To до Entire Document Увесь документ Don't Deskew Pages Не усувати перекоси зображень QObject Failed to save the image Не вдалося зберегти зображення JPEG Files (*.jpg) Файли JPEG (*.jpg) PNG Files (*.png) Файли PNG (*.png) Select Project Directory Оберіть каталог проекту Required spelling dictionary (%1) is not found. Spell-checking is disabled. Try to install an appropriate aspell dictionary. Потрібний орфографічний словник (%1) не знайдено. Перевірка орфографії відключена. Спробуйте встановити відповідний aspell-словник. Russian-English Російська-Англійська Bulgarian Болгарська Czech Чеська Danish Датська Dutch Голландська English Англійська French Французька German Німецька Hungarian Угорська Italian Італійська Latvian Латиська Lithuanian Литовська Polish Польська Portuguese Португальська Romanian Румунська Russian Російська Spanish Іспанська Serbian Сербська Slovenian Словенська Swedish Шведська Ukrainian Українська Afrikaans Африкаанс Albanian Албанська Ancient Greek Давньогрецька Arabic Арабська Azerbaijani Азербайджанська Belarusian Білоруська Catalan Каталонська Chinese (Simplified) Китайська (спрощена) Chinese (Tradtional) Китайська (Традиційна) Croatian Хорватська Danish Gothic Датська готська Esperanto Есперанто Estonian Естонська Finnish Фінська Galician Галісійська German Gothic Германська готська Greek Грецька Hebrew Іврит Hindi Хінді Indonesian Індонезійська Icelandic Ісландська Japanese Японська Kannada Каннада Korean Корейська Malay Малайська Macedonian Македонська Middle English Середньоанглійська Middle French Середньофранцузька Norwegian Норвезька Slovakian Словацька Slovakian Gothic Словацька готська Swahili Суахілі Swedish Gothic Шведська готська Thai Тайська Turkish Турецька Vietnamese В’єтнамська RecognitionDialog Recognizing... Розпізнавання... Cancel Скасувати block # %1 блок # %1 SideBar Drop files here Перетягніть файли сюди yagf-0.9.5+repack1/src/translations/ts_update.sh000644 001750 001750 00000000474 12470517140 023267 0ustar00boradminboradmin000000 000000 #!/bin/sh lupdate -noobsolete ../mainform.cpp ../mainform.ui ../popplerdialog.ui ../configdialog.ui ../langselectdialog.ui ../main.cpp ../spellchecker.cpp ../sidebar.cpp ../settings.cpp ../configdialog.cpp ../langselectdialog.cpp ../recognitiondialog.ui ../recognitiondialog.cpp -ts yagf_ru.ts yagf_fr.ts yagf_uk.ts yagf-0.9.5+repack1/src/translations/yagf_fr.ts000755 001750 001750 00000153227 13631520723 022741 0ustar00boradminboradmin000000 000000 AutoSaver failed to save the project ConfigDialog YAGF Settings Les paramètres du YAGF OCR and Languages OCR et langues Image Processing Traitement des images Program Behavoir Table Recognition OCR Engine Engin OCR Cuneiform Cuneiform Tesseract Tesseract Path to Tesseract Data Files L'accès aux données de tesseract ... ... Recognize Languages Reconnaître les langues Use Single Language: Une seule langue: Choose Among Several Languages Choisir de quelques langues Languages to Use... Les langues utilisées... Enhance Image Quality Améliorer la qualité de l'image Crop Image When Loaded Recadrer les images lors de l'ouverture de fichiers Deskew Loaded Images Corriger l'inclinaison des images Process after Deskew Preprocess Images When Loaded Le prétraitement des images Interface Language La langue de l'interface Force English Locale Default Font Size Enable Autosave Autosave interval (minutes) Remember Recent Projects Recognize Modes Recognize separate cells Recognize each row as a single cell Recognize each column as a single cell Cell Separator Row Separator Tesseract Data Directory Le dictionnaire des données du tesseract Djvu2PDF The ddjvu utility from the DjVuLibre package has not been found. Please make sure the package is installed. Failed to convert djvu to pdf LangSelectDialog YAGF Languages Setup Choix des langues Select the recognition languages Choisir les langues pour la reconnaissance Cuneiform Cuneiform Tesseract Tesseract Installed installé Not installed Non installé Digits Only LoadProjectDialog Load Project MainForm Recognition language La langue pour la reconnaissance Using Cuneiform Utilisation de Cuneiform Using Tesseract Utilisation de Tesseract Recognition Language La langue pour la reconnaissance Loading files... Chargement des fichiers... Cuneiform doesn't support any of selected recognition langualges. Falling back to tesseract. Please install tesseract. Cuneiform ne fonctionne pas avec les langualges de reconnaissance sélectionnés.Mise à tesseract. Tesseract doesn't support any of selected recognition langualges. Falling back to cueniform. Please install cuneiform. Tesseract ne fonctionne pas avec les langualges de reconnaissance sélectionnés.Mise à cuneiform. No compatible PDF converter software could be found. Please install either the pdftoppm utility or the GhostScript package (from this the gs command will be required). Pas de convertisseur de PDF est installé.Installez soit pdftoppm ou GhostScript s'il vous plaît. PDF file name may not be empty Nom du fichier PDF ne peut pas être vide Open Image Charger un fichier image Failed to load image %1 Cannot open file %1. Make sure imagemagick and tifftopnm are installed. Impossible de charger le fichier %1. Assurez-vous que tifftoppm et imagemagick sont installés. No image loaded Aucun fichier d'image est chargé Image Files (*.png *.jpg *.jpeg *.bmp *.tiff *.tif *.gif *.pnm *.pgm *.pbm *.ppm *.pdf *.djvu) There is an unsaved data. Do you want to save or to discard it? Scanning is impossible. No scanning front-end is found. Please install XSane in order to perform scanning. About YAGF <p align="center"><b>YAGF - Yet Another Graphical Front-end for cuneiform and tesseract OCR engines</b></p><p align="center">Version %1</p> <p align="center">Ⓒ 2009-2014 Andrei Borovsky</p> This is a free software distributed under GPL v3. Visit <a href="http://symmetrica.net/cuneiform-linux/yagf-en.html">http://symmetrica.net/cuneiform-linux/yagf-en.html</a> for more details. http://symmetrica.net/cuneiform-linux/yagf-en.html Nothing to save Text Files (*.txt) Save All Text Save Current Page Text Click Me again! Importing pages from the PDF document... Importation de pages du document PDF... Cannot create the project directory Draw the line along a string of text with left mouse button Extracting PDF Pages Converting DjVu to PDF Autosave There is an unsaved data left from the previous session. Do you want to open or discard it? Warning Avertissement Selected recognition engine not found. Save Image Enregistrer le fichier Clipboard doesn't contain an image. OK Failed to detect text areas on this page. The page possibly lacks contrast. Try to select blocks manually. Impossible de détecter les modules de texte. Failed to load project. Impossible de charger le projet. MainWindow MainWindow &File &Fichier &Help A&ide &Edit &Edition toolBar Image acquisition toolBar_2 Image manpulation toolBar_3 Recognition toolBar_4 Text manipulation toolBar_5 S&can... S&canner... Scanning images using XSane... Numériser des images avec XSane... Ctrl+N Ctrl+S &Open Image... &Charger un fichier image... selectLangsBox->setStyleSheet("border: 1px solid blue; padding: 2px 2px 2px 18px; min-width: 6em; background-color: white; selection-background-color:blue; QComboBox::drop-down: { width: 0px; border-style: none}"); toolBar_6 &Save All Text... Ctrl+X Open Image Charger un fichier image Ctrl+O &Recognize &Reconnaître Recognizing text... reconnaissance... Ctrl+R Choose &Language Choisir la &langue Quit Quitter Ctrl+Q Previous page Page précédente Move to previous image Déplacer à l'image précédente Next page Page suivante Move to next image Déplacer à l'image suivante Online Help Aide en ligne About... Sur le programme... Copy Text to Clipboard Copier le texte dans le presse-papier Copy recognized text to clipboard Copier le texte dans le presse-papier Recognize &All Pages Reconnaître &toutes les pages Recognize All Pages Reconnaître toutes les pages Ctrl+A Clear all blocks Enlever tous les modules Delete the current block Enlever le module actif Recognize block Reconnaître le module Recognize this block Reconnaître cet module Clear numbers Enlever numération Crear block numbering Enlever numération des modules Check spelling Vérifier l'orthographe Save current image... Enregistrer l'image active... Save currently opened image in its real size Enregistrer l'image active dans sa taille réelle Save block Enregistrer le module Save the current block to the image file Enregistrer le module actif comme l'image Enlarge Page Script Larger view (Ctrl + Mouse Wheel) Smaller view (Ctrl + Mouse Wheel) Align Page by Guideline Select multiple blocks Save Project As... Keep Lines Keep line-breaks in the scanned text Select Table Recent Projects Close All Save Project TestAction Save Text on the Page... Select HTML format Choisir le format HTML Select HTML format as recognition output Choisir le format HTML Rotate 90 CCW Tourner 90 CCW Rotate 180 Tourner 180 Rotate 90 CW Tourner 90 CW Settings Réglages Paste Image Coller une image Paste image from clipboard Coller une image du presse-papiers Select Text Area Sélectionner le texte module Deskew Block Corriger l'inclinaison du module Deskew the current block Corriger l'inclinaison du module actif Splits text into several blocks Diviser la page en plusieurs modules Toggle Large/Small Icons Changer la taille de boutons Select Recognition Language Choisir la langue pour la reconnaissance Load Project... Charger le projet... Select Recognition Languages... Choisir les langues pour la reconnaissance... Select Recognition Languages Choisir les langues pour la reconnaissance Select All Text Sélectionner tout le texte Select all the recognized text Sélectionner tout le texte reconnu Select languages for recognition Choisir les langues pour la reconnaissance PDFExtractor There was an error while extracting PDF pages. PopplerDialog Import from PDF Importer de pdf File Name Nom de fichier Select... Choisir... Pages Pages From de To jusqu'à Entire Document Tout le document Don't Deskew Pages Ne pas corriger des inclinaisons Open PDF File PDF Files (*.pdf) QObject Failed to save the image Impossible d'enregistrer le fichier JPEG Files (*.jpg) Fichiers JPEG PNG Files (*.png) Fichiers PNG Required spelling dictionary (%1) is not found. Spell-checking is disabled. Try to install an appropriate aspell dictionary. Le dictionnaire d'orthographe (%1) n'est pas trouvé. Essayez de télécharger le dictionnaire convenable. Russian-English Russe-Englaise Bulgarian Bulgare Czech Tchèque Danish Danoise Dutch Hollandaise English Anglaise French Française German Allemande Hungarian Hongroise Italian Italienne Latvian Lettonne Lithuanian Lituanienne Polish Polonaise Portuguese Portugaise Romanian Roumaine Russian Russe Spanish Espagnole Serbian Serbe Slovenian Slovène Swedish Suédoise Ukrainian Ukrainienne Afrikaans Albanian Albanaise Ancient Greek Grec ancien Arabic Azerbaijani Azerbaïdjanaise Belarusian Catalan Chinese (Simplified) Chinese (Tradtional) Croatian Croate Danish Gothic Danoise gothique Esperanto Estonian Estonienne Finnish Finnoise Galician German Gothic Allemande gothique Greek Grecque Hebrew Hébreu Hindi Indonesian Icelandic Islandaise Japanese Kannada Korean Malay Macedonian Macédonienne Middle English Anglaise du moyen-âge Middle French Française du moyen-âge Norwegian Norvégienne Slovakian Slovaque Slovakian Gothic Slovaque gothique Swahili Swedish Gothic Suédoise gothique Thai Turkish Turque Vietnamese Digits Only Warning Avertissement OK Information Error RecognitionDialog Recognizing... Cancel block # %1 RecognizerWrapper Recognizer error. SaveProjectDialog Save Project Move Backwards Move to the Upper Directory Add project name Save project to this folder? SideBar Drop files here Déposez les fichiers ici TextEditor Undo Ctrl+Z Redo Ctrl+Shift+Z Select All Ctrl+A Cut Ctrl+X Copy Ctrl+C Paste Ctrl+V Larger Font Ctrl++ Smaller Font Ctrl+- yagf-0.9.5+repack1/src/translations/yagf_ru.ts000755 001750 001750 00000120503 13631520723 022747 0ustar00boradminboradmin000000 000000 AutoSaver failed to save the project Ошибка сохранения проекта ConfigDialog OCR Engine Программа распознавания YAGF Settings Настройки YAGF OCR and Languages Распознавание Image Processing Обработка изображений Cuneiform Tesseract Path to Tesseract Data Files Расположение данных Tesseract ... ... Recognize Languages Распознавать языки Use Single Language: Только один язык: Choose Among Several Languages Несколько языков Languages to Use... Языки... Enhance Image Quality Улучшить качество изображения Crop Image When Loaded Обрезать изображение при загрузке Deskew Loaded Images Автоматически корректировать наклон Preprocess Images When Loaded Корректировать изображения при загрузке Interface Language Язык интерфейса Tesseract Data Directory Расположение данных Tesseract Force English Locale Использовать английский Default Font Size Размер шрифта по умолчанию Process after Deskew Обработка после исправления наклона Program Behavoir Параметры Table Recognition Enable Autosave Включить автосохранение Autosave interval (minutes) Интервал автосохранения (минуты) Remember Запоминать Recent Projects Недавние проекты Recognize Modes Recognize separate cells Recognize each row as a single cell Recognize each column as a single cell Cell Separator Row Separator Djvu2PDF The ddjvu utility from the DjVuLibre package has not been found. Please make sure the package is installed. Утилита ddjvu из пакета DjVuLibre не найдена. Убедитесь: что пакет установлен. Failed to convert djvu to pdf Ошибка преобразования djvu в pdf LangSelectDialog YAGF Languages Setup Выбор языков для распознавания Select the recognition languages Выбрать языки для распознавания Cuneiform Tesseract Installed Установлен Not installed Не установлен Digits Only Только цифры LoadProjectDialog Load Project Загрузить проект MainForm Recognition language Язык распознавания Open Image Открыть файл Warning Предупреждение No image loaded Изображение не загружено About YAGF О программе http://symmetrica.net/cuneiform-linux/yagf-en.html http://symmetrica.net/cuneiform-linux/yagf-ru.html Save Image Сохранить изображение Importing pages from the PDF document... Импорт страниц из документа PDF... No compatible PDF converter software could be found. Please install either the pdftoppm utility or the GhostScript package (from this the gs command will be required). Не найдены подходящие конвертeры PDF. Установите, пожалуйста, утилиту pdftoppm или пакет GhostScript (из которого требуется программа gs). PDF file name may not be empty Необходимо указать имя файла PDF Using Cuneiform Используется Cuneiform Using Tesseract Используется Tesseract Failed to detect text areas on this page. The page possibly lacks contrast. Try to select blocks manually. Не удалось найти текстовые области на странице. Возможно, изображение было сканировано со слишком низким контрастом. Попробуйте выделить блоки вручную. Failed to load project. Невозможно открыть проект. Loading files... Загрузка файлов... <p align="center"><b>YAGF - Yet Another Graphical Front-end for cuneiform and tesseract OCR engines</b></p><p align="center">Version %1</p> <p align="center">Ⓒ 2009-2014 Andrei Borovsky</p> This is a free software distributed under GPL v3. Visit <a href="http://symmetrica.net/cuneiform-linux/yagf-en.html">http://symmetrica.net/cuneiform-linux/yagf-en.html</a> for more details. <p align="center"><b>YAGF — графическая оболочка для программ распознавания текста cuneiform и tesseract</b></p><p align="center">Версия %1</p> <p align="center">Ⓒ 2009-2014 Андрей Боровский</p> YAGF — открытое программное обеспечение, которое распространяется на условиях лицензии GPL v3. Вы найдёте подробности на странице <a href="http://symmetrica.net/cuneiform-linux/yagf-en.html">http://symmetrica.net/cuneiform-linux/yagf-ru.html</a>. Recognition Language Язык распознавания Cannot open file %1. Make sure imagemagick and tifftopnm are installed. Невозможно открыть файл %1. Проверьте, установлен ли imagemagick. Cuneiform doesn't support any of selected recognition langualges. Falling back to tesseract. Please install tesseract. Cuneiform не поддерживает ни один из выбранных языков. Используйте Tesseract. Tesseract doesn't support any of selected recognition langualges. Falling back to cueniform. Please install cuneiform. Tesseract не поддерживает ни один из выбранных языков. Используйте Cuneiform. Scanning is impossible. No scanning front-end is found. Please install XSane in order to perform scanning. Сканирование невозможно, так как в систем не установлен XSane. Click Me again! Нажми меня еще раз! Clipboard doesn't contain an image. Буфер обмена не содержит изображений. OK Да Draw the line along a string of text with left mouse button Проведите линиии вдоль строки текста (левой кнопкой мыши) Failed to load image %1 Невозможно открыть файл %1 Selected recognition engine not found. Выбранная программа распознавания не найдена. Image Files (*.png *.jpg *.jpeg *.bmp *.tiff *.tif *.gif *.pnm *.pgm *.pbm *.ppm *.pdf *.djvu) Файлы изображений (*.png *.jpg *.jpeg *.bmp *.tiff *.tif *.gif *.pnm *.pgm *.pbm *.ppm *.pdf *.djvu) There is an unsaved data. Do you want to save or to discard it? Данные не были сохранены. Сохранить? Nothing to save Нет данных Text Files (*.txt) Текстовые файлы (*.txt) Save All Text Сохранить весь текст Save Current Page Text Сохранить текст на текущей странице Cannot create the project directory Невозможно создать директорию проекта Extracting PDF Pages Извлечение страниц PDF Converting DjVu to PDF Преобразование djvu в pdf Autosave Автосохранение There is an unsaved data left from the previous session. Do you want to open or discard it? На диске остались данные прощлого сеанса работы. Сохранить? MainWindow S&can... С&канировать... Scanning images using XSane... Сканируем страницу с помощью XSane... &Open Image... &Открыть графический файл... Open Image Открыть графический файл &Recognize &Распознать Recognizing text... Распознать текст... Choose &Language &Выбрать язык Quit Выйти Previous page Предыдущее изображение Move to previous image Перейти к предыдущему изображению Next page Следующее изображение Move to next image Перейти к следующему изображению Online Help Справка онлайн About... О программе... Clear all blocks Очистить все блоки Delete the current block Удалить этот блок Recognize block Распознать блок Recognize this block Распознать этот блок Clear numbers Очистить нумерацию Crear block numbering Очистить нумерацию блоков Check spelling Проверить орфографию Save current image... Сохранить изображение... Save currently opened image in its real size Сохраняет полученное изображение в реальном размере Save block Сохранить блок Save the current block to the image file Сохранить этот блок в графическом файле Select HTML format Выбрать формат HTML Select HTML format as recognition output Выбрать HTML в качестве формата вывода распознанного текста Rotate 90 CCW Повернуть на 90 градусов против часовой стрелки Rotate 180 Повернуть на 180 градусов Rotate 90 CW Повернуть на 90 градусов по часовой стрелке &File &Файл &Help &Справка Copy recognized text to clipboard Копировать текст в буфер обмена MainWindow toolBar Ctrl+N Ctrl+N Ctrl+S Ctrl+S Ctrl+O Ctrl+O Ctrl+R Ctrl+R Ctrl+Q Ctrl+Q Recognize &All Pages Распознать &всё Recognize All Pages Распознать все страницы Ctrl+A Ctrl+A Paste Image Вставить изображение Paste image from clipboard Вставить страницу из буфера обмена Select Text Area Автоматически выделить текстовую область Deskew Block Выровнять блок Deskew the current block Выровнять выделенный блок Splits text into several blocks Разбить текст на блоки Toggle Large/Small Icons Большие/маленькие значки toolBar_2 Select Recognition Language Выбор языка распознавания Load Project... Загрузить проект... toolBar_3 Select Recognition Languages... Выбрать языки для распознавания... Select Recognition Languages Выбрать языки для распознавания &Edit &Правка Copy Text to Clipboard Скопировать текст в буфер обмена Settings Настройки Select All Text Выделить весь текст Select all the recognized text Выделить весь распознанный текст Select languages for recognition Выбрать языки для распознавания Image acquisition Получение изображений toolBar_4 toolBar_5 Enlarge Page Script Увеличить символы Align Page by Guideline Выровнять страницу по заданной линии Select multiple blocks Выделить несколько блоков Image manpulation Обработка изображения Recognition Распознавание Text manipulation Работа с текстом Larger view (Ctrl + Mouse Wheel) Приблизить (Ctrl+колесо мыши) Smaller view (Ctrl + Mouse Wheel) Отдалить (Ctrl+колесо мыши) Keep Lines Сохранять разбиение на строки Keep line-breaks in the scanned text Сохранять строки в отсканированном тексте, как в оригинале selectLangsBox->setStyleSheet("border: 1px solid blue; padding: 2px 2px 2px 18px; min-width: 6em; background-color: white; selection-background-color:blue; QComboBox::drop-down: { width: 0px; border-style: none}"); toolBar_6 &Save All Text... &Сохранить весь текст... Ctrl+X Save Project As... Сохранить проект как... Select Table Выделить таблицу Recent Projects Недавние проекты Close All Закрыть все Save Project Сохранить проект TestAction Save Text on the Page... Сохранить текст на текущей странице... PDFExtractor There was an error while extracting PDF pages. Ошибка импорта страниц из документа PDF. PopplerDialog Import from PDF Импорт из документа PDF File Name Имя файла PDF Select... Выбрать... Pages Страницы From С To по Entire Document Весь документ Don't Deskew Pages Отключить исправление наклона страниц Open PDF File Открыть файл PDF PDF Files (*.pdf) Файлы PDF (*.pdf) QObject JPEG Files (*.jpg) Файлы JPEG (*.jpg) PNG Files (*.png) Файлы PNG (*.png) Failed to save the image Не удалось сохранить файл Required spelling dictionary (%1) is not found. Spell-checking is disabled. Try to install an appropriate aspell dictionary. Требуемый орфографический словарь (%1) не найден. Проверка орфографии будет отключена. Попробуйте установить соответствующий словарь aspell. Bulgarian Болгарский Czech Чешский Danish Датский Dutch Голландский English Английский French Французский German Немецкий Hungarian Венгерский Italian Итальянский Latvian Латышский Lithuanian Литовский Polish Польский Portuguese Португальский Romanian Румынский Russian Русский Russian-English Русский-английский Spanish Испанский Serbian Сербский Slovenian Словенский Swedish Шведский Ukrainian Украинский Finnish Финский German Gothic Немецкий готический Greek Греческий Hebrew Иврит Norwegian Норвежский Swedish Gothic Шведский готический Turkish Турецкий Albanian Албанский Ancient Greek Древнегреческий Azerbaijani Азербайджанский Croatian Хорватский Danish Gothic Датский готический Estonian Эстонский Icelandic Исландский Macedonian Македонский Middle English Старо-английский Middle French Старо-французский Slovakian Словацкий Slovakian Gothic Словацкий готический Arabic Арабский Hindi Хинди Indonesian Индонезийский Malay Малайский Swahili Суахили Vietnamese Вьетнамский Afrikaans Африкаанс Belarusian Белорусский Catalan Каталанский Chinese (Simplified) Китайский (упрощенный) Chinese (Tradtional) Китайский (традиционный) Esperanto Эсперанто Galician Галисийский Japanese Японский Kannada Каннада Korean Корейский Thai Тайский Digits Only Только цифры Warning Предупреждение OK Да Information Сообщение Error Ошибка RecognitionDialog Recognizing... Распознавание... Cancel Отмена block # %1 блок %1 RecognizerWrapper Recognizer error. Ошибка распознавания. SaveProjectDialog Save Project Сохранить проект Move Backwards Вернуться Move to the Upper Directory На директорию выше Add project name Задайте имя проекта Save project to this folder? Сохранить проект в этой директории? SideBar Drop files here Перетащите файлы сюда TextEditor Undo Ctrl+Z Отменить Ctrl+Z Redo Ctrl+Shift+Z Вернуть Ctrl+Shift+Z Select All Ctrl+A Выбрать все Ctrl+A Cut Ctrl+X Вырезать Ctrl+X Copy Ctrl+C Копировать Ctrl+C Paste Ctrl+V Вставить Ctrl+V Larger Font Ctrl++ Увеличить шрифт Ctrl++ Smaller Font Ctrl+- Уменьшить шрифт Ctrl+- yagf-0.9.5+repack1/src/page.h000755 001750 001750 00000007464 13631520722 017320 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2012 Andrei Borovsky 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 . */ #ifndef TPAGE_H #define TPAGE_H #include "tblock.h" #include "core/analysis.h" #include #include #include #include class CCBuilder; class Settings; class Page : public QObject { Q_OBJECT public: explicit Page(const int pid, QObject *parent = 0); ~Page(); bool loadFile(QString fileName, int tiled, bool loadIntoView = true); QPixmap displayPixmap(); QImage thumbnail(); QString recognizedText(); void setRecognizedText(const QString &t); bool makeLarger(); bool makeSmaller(); void rotate(qreal angle); void unload(); void addBlock(Block block, int blocknum = 0, int inTable = 0); void deleteBlock(const Block &b); void deleteBlock(const QRect &r); Block getBlock(const QRect &r); Block getBlock(int index); int blockCount(); void clearBlocks(); void savePageForRecognition(const QString &fileName); bool savePageAsImage(const QString &fileName, const QString &format); void saveRawBlockForRecognition(QRect r, const QString &fileName); void saveSubimage(QRect r, const QString &fileName); void saveBlockForRecognition(QRect r, const QString &fileName, const QString &format); void saveBlockForRecognition(int index, const QString &fileName); void selectBlock(const QRect &r); Block getSelectedBlock(); bool deskew(bool recreateCB = true); void deskew(int x1, int y1, int x2, int y2); void rotate90CW(); void rotate90CCW(); void rotate180(); void blockAllText(); bool splitPage(bool preprocess); bool textHorizontal(); QString fileName(); QString originalFileName() const; void setOriginalFileName(const QString &fn); int pageID(); void sortBlocksInternal(); bool isDeskewed(); bool isCropped(); void setCropped(bool value); bool isPreprocessed(); qreal getRotation(); void setDeskewed(bool value); void setPreprocessed(bool value); void reSaveTmpPage(); QRect scaleRect(QRect &rect); QRect scaleTo(QRect &rect, qreal newScale); QRect scaleRectToScale(QRect &rect); void splitTable(); signals: void refreshView(bool show); void textOut(const QString &msg); public slots: private: void renumberBlocks(); void applyTransforms(QImage &image, qreal scale); void rotateImageInternal(QImage &image, qreal angle); QRect shiftRectBeforeScale(QRect &rect, int sx, int sy); QImage tryRotate(QImage image, qreal angle); QImage currentImage(); QString saveTmpPage(const QString &format); QList splitInternal(); void prepareCCBuilder(); Block includes(const QRect &rect); void clearIntersected(); private: QString originalFN; qreal scale; qreal rotation; QRect crop1; QRect crop2; bool deskewed; bool cropped; QImage img; Blocks blocks; bool imageLoaded; bool loadedBefore; bool preprocessed; QString mFileName; CCBuilder *ccbuilder; Settings *settings; int blockPointer; int pid; Block selectedBlock; QString text; }; #endif // TPAGE_H yagf-0.9.5+repack1/src/projectfiles.cpp000755 001750 001750 00000011356 13631520722 021423 0ustar00boradminboradmin000000 000000 #include "projectfiles.h" #include "settings.h" #include #include #include #include ProjectFiles::ProjectFiles(const QString &rootDir) { cd(rootDir); } ProjectFiles::~ProjectFiles() { } QStringList ProjectFiles::directories() { return dirs; } void ProjectFiles::cd(const QString &newRoot) { QString newRoot1 = newRoot; if (newRoot1 !="") if (!newRoot.startsWith("/")) newRoot1 = root + newRoot1; QFileInfo fi(newRoot1); if (!fi.isDir()) return; dirs.clear(); projs.clear(); QDir dir(newRoot1); root =newRoot1; if (!root.endsWith("/")) root=root + "/"; isPD= false; QFileInfoList fil = dir.entryInfoList(); QStringList tmp; foreach(QFileInfo fi, fil) { if (fi.fileName() == "yagf_project.xml") { isPD = true; tmp.clear(); break; } if (fi.isDir()) tmp.append(fi.absoluteFilePath()); } foreach (QString d, tmp) { if(!d.endsWith("/")) d = d+"/"; QFile f(d + "yagf_project.xml"); if (f.exists()) projs.append(d); else dirs.append(d); } } bool ProjectFiles::pathExists(const QString &path) { if (!path.startsWith("/")){ QFileInfo fi(root + path); if (fi.exists()) return true; } else { QFileInfo fi(path); if(fi.exists()) return true; } return false; } bool ProjectFiles::canCdTo(const QString &path) { QString lPath = path; if (!path.startsWith("/")) lPath = root + path; QFileInfo fi(lPath); if (fi.isDir()) return !isProjectDir(path); return false; } bool ProjectFiles::canCdToUpper(const QString &path) { QString lPath = upDir(path); return canCdTo(lPath); return false; } QString ProjectFiles::upDir(const QString &path) { QString lPath; if (!path.startsWith("/")) lPath = root + path; else lPath = path; QStringList sl = lPath.split("/", QString::SkipEmptyParts); if (sl.count()>0) { sl.removeLast(); if (sl.count() == 0) return "/"; QString nPath= sl.join("/"); if (!nPath.startsWith("/")) nPath = "/"+nPath; if (!nPath.endsWith("/")) nPath = nPath +"/"; return nPath; } return "/"; } QString ProjectFiles::currentDir() { return root; } QString ProjectFiles::projectName(const QString &path) { QString lPath; if (!path.startsWith("/")) lPath = root + path; else lPath = path; if (!lPath.endsWith("/")) lPath = lPath +"/"; QFileInfo fi(lPath); if (fi.isDir()) { if (pathExists(lPath+"yagf_project.xml")) { QStringList sl = lPath.split("/", QString::SkipEmptyParts); if (sl.count() > 0) return sl.last(); else return ""; } else return ""; } else { if (lPath.endsWith("yagf_project.xml")) { QStringList sl = lPath.split("/", QString::SkipEmptyParts); if (sl.count() > 1) return sl.at(sl.count() -1); else return ""; } else return ""; } return ""; } bool ProjectFiles::isDirEmpty(const QString &dirName) { QDir dir(dirName); if (dir.entryList().count() == 2) return true; QFileInfoList fil = dir.entryInfoList(); fil.removeAt(0); fil.removeAt(0); foreach(QFileInfo fi, fil) if (fi.isDir()) return false; return true; } bool ProjectFiles::canProjectBeSavedToDir(const QString &name) { QString path; if (!name.startsWith("/")) path = root + name; else path = name; QFileInfo fi(path); if (!fi.isDir()) return false; QDir dir(path); return dir.entryList().count() == 2; } bool ProjectFiles::isProjectDir() { return isPD; } bool ProjectFiles::isProjectDir(const QString &path) { if (!path.startsWith("/")){ return isProjectDirInternal(root +path); } else { return isProjectDirInternal(path); } return false; } bool ProjectFiles::hasTemporaryData() { QString wd = Settings::instance()->workingDir() + "autosave/"; QDir dir(wd); return dir.entryList().count() > 2; } QStringList ProjectFiles::projects() { return projs; } bool ProjectFiles::isProjectDirInternal(const QString &path) { QFileInfo fi(path); if (fi.isDir()) { QDir d; if (!path.startsWith("/")) d.setPath(root + path); else d.setPath(path); QStringList sl = d.entryList(); if (sl.contains("yagf_project.xml")) return true; else return false; } return false; } yagf-0.9.5+repack1/src/fileobjectitem.h000755 001750 001750 00000002313 13631520722 021355 0ustar00boradminboradmin000000 000000 /* 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. */ #ifndef FILEOBJECTITEM_H #define FILEOBJECTITEM_H #include class FileObjectItem : public QListWidgetItem { public: enum FileObjectItemType { Directory, EmptyDirectory, Project }; Q_DECLARE_FLAGS(FOItemType, FileObjectItemType) explicit FileObjectItem(FileObjectItemType itemType, const QString &fullName, QListWidget *parent = 0); FileObjectItemType getItemType(); QString getShortName(); QString getPath(); signals: public slots: private: QString fName; QString lName; FileObjectItemType _type; private: void extractShortName(); }; Q_DECLARE_OPERATORS_FOR_FLAGS(FileObjectItem::FOItemType) #endif // FILEOBJECTITEM_H yagf-0.9.5+repack1/src/mainform.h000755 001750 001750 00000012650 13631520722 020205 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2012 Andrei Borovsky 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 . */ #include "settings.h" #include #include #include "ui_mainform.h" #include #include //#include "ui_popplerdialog.h" class QComboBox; class QCheckBox; class QLabel; class QCloseEvent; class QPixmap; class QProcess; class QByteArray; class QFile; class SpellChecker; class QCursor; class QGraphicsInput; class QMenu; class PDFExtractor; class ccbuilder; class QLabel; class QAction; class QPoint; class RecognizerWrapper; class RecognitionDialog; class ExtProcessDialog; class Djvu2PDF; class AutoSaveManager; const QString version = "0.9.5"; class PageCollection; class ScannerBase; class MainForm : public QMainWindow, public Ui::MainWindow { Q_OBJECT public: MainForm(QWidget *parent = 0); ~MainForm(); signals: void windowShown(); void callAfterConstructor(); private slots: //void on_actionRecognize_activated(); void on_actionSelect_HTML_format_activated(); void upscale(); //void on_alignButton_clicked(); void on_actionCheck_spelling_activated(); void on_actionSave_block_activated(); void on_actionSave_current_image_activated(); void on_actionCheck_spelling_triggered(); void on_actionRecognize_block_activated(); void recognize(); void on_ActionDeleteBlock_activated(); void on_ActionClearAllBlocks_activated(); void loadImage(); void rotateCWButtonClicked(); void rotateCCWButtonClicked(); void rotate180ButtonClicked(); void enlargeButtonClicked(); void decreaseButtonClicked(); void singleColumnButtonClicked(); void newLanguageSelected(int index); void scanImage(); void loadNextPage(); void loadPreviousPage(); //void recognizeAll(); void showAboutDlg(); void showHelp(); void unalignButtonClicked(); void importPDF(const QString &fileName); void importDjVu(const QString &fileName); void showConfigDlg(); void addPDFPage(QString pageName, int current, int total); void finishedPDF(); void pasteimage(); void deskewByBlock(); void selectTextArea(); void selectBlocks(); void selectHTMLformat(); void loadFiles(const QStringList &files); void LangTextChanged(const QString &text); void SelectRecognitionLanguages(); void selectLanguages(); void deskewByLine(); protected: void timerEvent(QTimerEvent * e); private: virtual void closeEvent(QCloseEvent *event); void initSettings(); void loadFile(const QString &fn, bool loadIntoView = true); void loadTIFF(const QString &fn, bool loadIntoView = true); void delTmpFiles(); void delAutoSaveFiles(); void delTmpDir(); QString getFileNameToSaveImage(QString &format); void loadFromCommandLine(); void fillLangBox(); void createRW(); void createRecentMenu(); void loadProjectInternal(const QString&path); void connectTC(bool doIt); void loadAutoSaved(); void saveTextInternal(bool allText); private: QComboBox *selectLangsBox; QGraphicsInput *graphicsInput; QString fileName; QCursor *resizeCursor; QCursor *resizeBlockCursor; bool useXSane; ScannerBase *scanner; QByteArray *ba; //SpellChecker *spellChecker; QMenu *m_menu; PDFExtractor *pdfx; Djvu2PDF * dj2pf; QProgressDialog *pdfPD; int ifCounter; Settings *settings; PageCollection *pages; QLabel *engineLabel; QLabel *langLabel; QAction *slAction; bool globalDeskew; QPoint actPos; QString oldooltip; int timerId; RecognizerWrapper * rw; RecognitionDialog * rd; ExtProcessDialog * epd; AutoSaveManager * _asm; QString projectName; bool dirty; bool forbidAutoSave; private slots: void clickMeAgain(); void readyRead(int sig); void setResizingCusor(); void setUnresizingCusor(); void loadPage(bool show); void rightMouseClicked(int x, int y, bool inTheBlock); void setupPDFPD(); void onShowWindow(); void addSnippet(int index); void preprocessPage(); void saveProjectAs(); void saveProject(); void loadProject(); void on_actionKeep_Lines_toggled(bool arg1); void readOutput(QString text, QChar separator); void recognitionFinished(); void recognitionError(const QString &text); void reportError(const QString &text); void cancelRecognition(); void splitTable(); void showPDFprogress(); void extProcStarted(); void djvuStarted(); void djvuFinished(); void menuTriggered(const QString &text); void closeAll(); void startedAutoSave(); void autosaveFinished(); void testslot(); void textChanged(); void afterConstructor(); void markDirty(); void saveAllText(); void saveCurrentText(); }; yagf-0.9.5+repack1/src/recognizerwrapperinternal.h000755 001750 001750 00000021772 13631520722 023707 0ustar00boradminboradmin000000 000000 /* 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. */ #ifndef RECOGNIZERWRAPPERINTERNAL_H #define RECOGNIZERWRAPPERINTERNAL_H #include "settings.h" #include "tpagecollection.h" #include "utils.h" #include #include #include #include #include "globallock.h" #include class RWHelper { public: RWHelper() { } ~RWHelper() { GlobalLock::instance()->unlock(); } }; class RecognizerWrapperInternal : public QObject { Q_OBJECT friend class RecognizerWrapper; public: RecognizerWrapperInternal(QObject * parent) : QObject(parent) { connect(&proc, SIGNAL(finished(int)), this, SLOT(onFinished(int))); connect(&proc, SIGNAL(error(QProcess::ProcessError)), this, SIGNAL(error(QProcess::ProcessError))); supressErros = false; } ~RecognizerWrapperInternal() { proc.kill(); proc.waitForFinished(100); } void init() { settings = Settings::instance(); pc = PageCollection::instance(); } void recognize() { QFile::remove(settings->workingDir() + "input*.bmp"); if (!pc->pageValid()) { emit error(trUtf8("No image loaded")); return; } if (!findEngine()) return; if (pc->blockCount() > 0) { blockIndex = 0; prepareBlockForRecognition(0); emit blockRecognized(0); recognizeInternal(); } else { preparePageForRecognition(); recognizeInternal(); } } signals: void finished(int); void error(QProcess::ProcessError); void error(const QString &text); void blockRecognized(int n); void readOutput(QString text, QChar separator = QChar::fromAscii('\n')); public slots: void onFinished(int i) { sendOutput(); blockIndex++; if (blockIndex < pc->blockCount()) { prepareBlockForRecognition(blockIndex); emit blockRecognized(blockIndex+1); recognizeInternal(); } else emit finished(i); } private: // variables Settings * settings; PageCollection * pc; QProcess proc; bool supressErros; int blockIndex; private: // functions void sendOutput() { bool res = GlobalLock::instance()->lock(); if (!res) return; RWHelper h; QFile textFile(settings->workingDir() + settings->getRecognizeOutputFile()); textFile.open(QIODevice::ReadOnly); QString textData; QTextCodec *codec = QTextCodec::codecForName("UTF-8"); if (settings->getKeepLines()) { while (!textFile.atEnd()) { QByteArray text = textFile.readLine(); textData += codec->toUnicode(text); } } else { QByteArray text = textFile.readAll(); textData = codec->toUnicode(text); textData =textData.replace(QString::fromUtf8("—")+'\n', QString::fromUtf8("— ")); textData = textData.replace(QString::fromUtf8("-")+'\n', QString::fromUtf8("- ")); textData = textData.replace(QString::fromUtf8("\n"), QString::fromUtf8(" ")); } textFile.close(); textData = textData.replace(" ,", ","); QChar sep = QChar::fromAscii(']'); if (pc->blockCount() > blockIndex) { if (pc->getBlock(blockIndex).isTableCell()) sep = QChar::fromAscii('|'); } emit readOutput(textData, sep); } void recognizeInternal() { if (settings->getSelectedEngine() == UseCuneiform) { if (useCuneiform(settings->getRecognizeInputFile(), settings->getRecognizeOutputFile())) return; } if (settings->getSelectedEngine() == UseTesseract) { if (useTesseract(settings->getRecognizeInputFile())) return; } } bool useTesseract(const QString &inputFile) { if (!findProgram("tesseract")) return false; proc.setWorkingDirectory(settings->workingDir()); QStringList sl; sl.append(inputFile); sl.append(settings->getRecognizeOutputBase()); if (settings->getLanguage() != "digits") sl.append("-l"); sl.append(settings->getLanguage()); //sl.append("-psm"); //sl.append("0"); QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); env.insert("TESSDATA_PREFIX", settings->getTessdataPath()); QDir dir(settings->getTessdataPath()+"tessdata/"); QStringList sl1; sl1 << QString::fromUtf8("*%1.*").arg(settings->getLanguage()); if ((!settings->getLanguage().contains("+"))&&(settings->getLanguage() != "digits")) if (dir.entryList(sl1, QDir::Files).count() == 0) { emit error(trUtf8("You have selected recognising %1 language using tesseract OCR. Currently the data for this language is not installed in your system. Please install the tesseract data files for \"%2\" from your system repository.").arg(settings->getFullLanguageName(settings->getLanguage())).arg(settings->getLanguage())); return false; } proc.setProcessEnvironment(env); proc.start("tesseract", sl); /*if (proc.exitCode()) { QByteArray stdoutBytes = proc.readAllStandardOutput(); QByteArray stderrBytes = proc.readAllStandardError(); QString output = QString(stdoutBytes) + QString(stderrBytes); styledCriticalMessage(this, trUtf8("Starting tesseract failed") + (output != "" ? "" : trUtf8("Program not found."))); return false; }*/ return true; } bool useCuneiform(const QString &inputFile, const QString &outputFile) { if (!findProgram("cuneiform")) return false; proc.setWorkingDirectory(settings->workingDir()); QStringList sl; sl.append("-l"); sl.append(settings->getLanguage()); sl.append("-f"); if (settings->getOutputFormat() == "text") sl.append("text"); else sl.append("html"); sl.append("-o"); sl.append(settings->workingDir() + outputFile); sl.append(settings->workingDir() + inputFile); proc.start("cuneiform", sl); /*if (proc.exitCode()) { QByteArray stdoutBytes = proc.readAllStandardOutput(); QByteArray stderrBytes = proc.readAllStandardError(); QString output = QString(stdoutBytes) + QString(stderrBytes); styledCriticalMessage(this, trUtf8("Starting cuneiform failed") + (output != "" ? "" : trUtf8("Program not found."))); return false; }*/ return true; } static bool findEngine(bool findSelected = false) { Settings * settings = Settings::instance(); if (settings->getSelectedEngine() == UseCuneiform) { if (!findProgram("cuneiform")) { if (findSelected) return false; if (findProgram("tesseract")) { //emit error(trUtf8("Cuneiform not found, switching to Tesseract OCR")); settings->setSelectedEngine(UseTesseract); } else { //emit error(trUtf8("No recognition engine found.\nPlease install either Cuneiform or Tesseract OCR")); return false; } } } if (settings->getSelectedEngine() == UseTesseract) { if (!findProgram("tesseract")) { if (findSelected) return false; if (findProgram("cuneiform")) { //emit error(trUtf8("Tesseract not found, switching to Cuneiform")); settings->setSelectedEngine(UseCuneiform); } else { //emit error(trUtf8("No recognition engine found.\nPlease install either Cuneiform or Tesseract OCR")); return false; } } } return true; } void preparePageForRecognition() { clearTmpFiles(); pc->savePageForRecognition(settings->workingDir() + settings->getRecognizeInputFile()); } void prepareBlockForRecognition(const QRect &r) { clearTmpFiles(); pc->saveBlockForRecognition(r, settings->workingDir() + settings->getRecognizeInputFile()); } void prepareBlockForRecognition(int index) { clearTmpFiles(); pc->saveBlockForRecognition(index, settings->workingDir() + settings->getRecognizeInputFile()); } }; #endif // RECOGNIZERWRAPPERINTERNAL_H yagf-0.9.5+repack1/src/SkewAnalysis.cpp000755 001750 001750 00000014342 13631520722 021345 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #include "SkewAnalysis.h" #include #include #include #include #include #include #include SkewAnalysis::SkewAnalysis(QPointList *pointList, int width, int height) { /* for (int i = 0; i < 360; i++) for (int j = 0; j < 2000; j++) bin[i][j] = 0; for (int i = 0; i < 360; i++) { for (int j = 0; j < pointList->count(); j+=2) { long int r = pointList->at(j).x()*cos(i/360*M_2_PI) + pointList->at(j).y()*cos(i/360*M_2_PI); r = r/4; bin[i][r]++; } } long int sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0; int phi1 = 0, phi2 = 0, phi3 = 0, phi4 = 0; long int tmpsum = 0; //for (int i = 0; i < 360; i++) // for (int j = 0; j < 2000; j++) // if (bin[i][j] < 9) bin[i][j] = 0; for (int i = 0; i < 360; i++) { for (int j = 0; j < 2000; j++) // tmpsum += bin[i][j]; if (tmpsum < bin[i][j]) tmpsum = bin[i][j]; if ((tmpsum > sum4) || (tmpsum > sum3) || (tmpsum > sum2 || (tmpsum > sum1))) { if (sum1 < sum2) {sum1 = sum2; phi1 = phi2;} if (sum2 < sum3) {sum2 = sum3; phi2 = phi3;} if (sum3 < sum4) {sum3 = sum4; phi3 = phi4;} sum4 = tmpsum; phi4 = i; tmpsum =0; } } FILE * f = fopen("/home/andrei/hough.txt", "w"); for (int i = 0; i < 360; i++) { for (int j = 0; j < 1000; j++) fprintf(f, "%i:, %i, ", i, bin[i][j]); fprintf(f, "\n"); } fclose(f);*/ this->pointList = pointList; m_width = width; m_height = height; p1 = new QPoint(); p2 = new QPoint(); } SkewAnalysis::~SkewAnalysis() { delete p1; delete p2; } signed int SkewAnalysis::getSkew() { int minLeftDist = 10000; int minRightDist = 0; for (int i = 0; i < pointList->count(); i++) { if (!(i%2)) { if (minLeftDist > pointList->at(i).x()) minLeftDist = pointList->at(i).x(); } else { if (minRightDist < pointList->at(i).x()) minRightDist = pointList->at(i).x(); } } minRightDist = m_width - minRightDist; signed int res; if (minRightDist > minLeftDist) { phi = getRightPhi(); } else { phi = getLeftPhi(); } res = (phi/(2*M_PI))*360+1; if (res > 45) return 90 - res; if (res < 45) return -(90 + res); return -res; } double SkewAnalysis::getPhi() { return getSkew()*2*M_PI/(double)360; //if (phi > 0.7854) return M_PI_2 - phi; //if (phi < 0.7854) return -(M_PI_2 + phi); } double SkewAnalysis::getRightPhi() { double phi = 0; int maxx = 0, maxy = 0, minx = 10000, miny = 10000; for (int i = 1; i < pointList->count(); i +=2) { if (maxx< pointList->at(i).x()) { maxx = pointList->at(i).x(); maxy = pointList->at(i).y(); } if (miny > pointList->at(i).y()) { minx = pointList->at(i).x(); miny = pointList->at(i).y(); } } phi = 0; if (maxy-miny < m_height - maxy) { miny = 0; for (int i = 1; i < pointList->count(); i +=2) if (miny < pointList->at(i).y()) { minx = pointList->at(i).x(); miny = pointList->at(i).y(); } } else { miny = 10000; for (int i = 1; i < pointList->count(); i +=2) if (miny > pointList->at(i).y()) { minx = pointList->at(i).x(); miny = pointList->at(i).y(); } } if (maxx-minx == 0) return 0; if (m_height/abs(maxx-minx) >=100 ) return 0; // if (maxy > miny) p1->setX(maxx); p1->setY(maxy); p2->setX(minx); p2->setY(miny); phi = atan((double)(maxy-miny)/(double)(maxx-minx)); //else //phi = atan((double)(miny - maxy)/(double)(maxx-minx)); // phi = - (M_PI_2 -phi); return phi; } double SkewAnalysis::getLeftPhi() { double phi = 0; int maxx = 0, maxy = 0, minx = 10000, miny = 10000; for (int i = 0; i < pointList->count(); i +=2) { if (minx > pointList->at(i).x()) { minx = pointList->at(i).x(); miny = pointList->at(i).y(); } if (maxy > pointList->at(i).y()) { maxx = pointList->at(i).x(); maxy = pointList->at(i).y(); } } phi = 0; if (miny < m_height - miny) { maxy = 0; for (int i = 0; i < pointList->count(); i +=2) if ((maxy < pointList->at(i).y()) && (pointList->at(i).y() < 0.9*m_height)) { maxx = pointList->at(i).x(); maxy = pointList->at(i).y(); } } else { maxy = 10000; for (int i = 0; i < pointList->count(); i +=2) if ((maxy > pointList->at(i).y()) && (pointList->at(i).y() < 0.9*m_height)) { maxx = pointList->at(i).x(); maxy = pointList->at(i).y(); } } p1->setX(maxx); p1->setY(maxy); p2->setX(minx); p2->setY(miny); if (maxx-minx == 0) return 0; if (m_height/abs(maxx-minx) >=100 ) return 0; phi = atan((double)(maxy-miny)/(double)(maxx-minx)); return phi; } QPixmap SkewAnalysis::drawTriangle(QPixmap &pm) { QImage img = pm.toImage(); QPainter p(&img); QPen pen; pen.setColor(QColor(255, 0, 0)); p.setPen(pen); p.drawLine(*p1, *p2); // p. return QPixmap::fromImage(img); } yagf-0.9.5+repack1/src/qxtunixsignalcatcher.h000755 001750 001750 00000002533 13631520722 022644 0ustar00boradminboradmin000000 000000 /* 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. */ #ifndef QXTUNIXSIGNALCTACHER_H #define QXTUNIXSIGNALCTACHER_H #include class QMutex; class QXtUnixSignalCatcherInternal; class QXtUnixSignalCatcher : public QObject { Q_OBJECT public: static QXtUnixSignalCatcher *catcher(); static bool connectUnixSignal(int sig_num); void disconnectUnixSugnals(); signals: void unixSignal(int sig_num); private slots: void doEmit(int sig_num); private: QXtUnixSignalCatcher(QObject *parent = 0); QXtUnixSignalCatcher(); QXtUnixSignalCatcher(QXtUnixSignalCatcher &); ~QXtUnixSignalCatcher(); static void signalHandler(int sig_num); void emitSignal(int sig_num); bool connectUnixSignalInternal(int sig_num); private: static QXtUnixSignalCatcher *sc; static QMutex *mutex; QXtUnixSignalCatcherInternal *sci; }; #endif // QXTUNIXSIGNALCTACHER_H yagf-0.9.5+repack1/src/loadprojectdialog.h000755 001750 001750 00000002572 13631520722 022065 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2015 Andrei Borovsky 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 . */ #ifndef LOADPROJECTDIALOG_H #define LOADPROJECTDIALOG_H #include "saveprojectdialog.h" class LoadProjectDialog : public SaveProjectDialog { Q_OBJECT public: explicit LoadProjectDialog(const QString &path, QWidget *parent = 0); QString projectPath(); QString projectName(); signals: public slots: protected slots: void accept(); void reject(); private slots: void onProjectClicked(const QString &path, const QString &name); protected: virtual void onLineEditTextChanged(QLineEdit * le, const QString &arg1); private: QString pPath; QString pName; }; #endif // LOADPROJECTDIALOG_H yagf-0.9.5+repack1/src/tpagecollection.h000755 001750 001750 00000007611 13631520722 021552 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2012 Andrei Borovsky 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 . */ #ifndef TPAGECOLLECTION_H #define TPAGECOLLECTION_H #include "page.h" #include #include #include class QSnippet; class PageCollection : public QObject { Q_OBJECT public: static PageCollection *instance(); static void clearCollection(); bool appendPage(const QString &fileName); Page * newPage(const QString &fileName, qreal rotation, bool preprocessed, bool deskewed, bool cropped); int count(); QString text(); void setText(const QString &t); bool makePageCurrent(int index); bool makePageCurrentByID(int id); void setBeforeFirst(); // the page pointer is set before the first page bool makeNextPageCurrent(); bool textAtNextId(int &cid, QString &text); QSnippet *snippet(); QPixmap pixmap(); void savePageForRecognition(const QString &fileName); void SaveCurrentPageText(const QString &fileName, bool truncate = true); void saveAllText(const QString &fileName, bool truncate); void saveRawBlockForRecognition(QRect r, const QString &fileName); void saveBlockForRecognition(QRect r, const QString &fileName, const QString &format = "BMP"); void saveBlockForRecognition(int index, const QString &fileName); int blockCount(); Block getBlock(const QRect &r); Block getBlock(int index); void selectBlock(const QRect &r); Block getSelectedBlock(); bool pageValid(); QString fileName(); QString originalFileName(); void setOriginalFileName(const QString &fn); bool hasPage(); bool savePageAsImage(const QString &fileName, const QString &format); bool isDeskewed(); bool isPreprocessed(); bool isCropped(); qreal getRotation(); void setRotation(const qreal value); void setDeskewed(const bool value); void setPreprocessed(const bool value); void reloadPage(); void unloadAll(); void deskew(int x1, int y1, int x2, int y2); QRect scaleRect(QRect &rect); QRect scaleRect(QRect &rect, qreal scale); QRect scaleRectToPage(QRect &rect); void splitTable(); void saveCurrentText(const QString &text); QString currentText(); void storeCurrentIndex(); void restoreCurrentIndex(); public slots: void makeLarger(); void makeSmaller(); void rotate90CW(); void rotate90CCW(); void rotate180(); void deskew(); void blockAllText(); bool splitPage(bool preprocess); void addBlock(const QRect &rect); void addBlock(const QRect &rect, int num); void deleteBlock(const QRect &rect); void clearBlocks(); void clear(); signals: void loadPage(bool show); // The page is already current void addSnippet(int index); void cleared(); void messagePosted(const QString &msg); private slots: void pageSelected(int id); void pageRemoved(int id); void textOut(const QString &msg); private: PageCollection(QObject *parent = 0); PageCollection(const PageCollection &); ~PageCollection(); Page *cp(); int id2Index(int id); private: QVector pages; int index; int pid; int currentId; bool mTextSaved; static PageCollection *m_instance; }; #endif // TPAGECOLLECTION_H yagf-0.9.5+repack1/src/proginfowindow.ui000755 001750 001750 00000001561 13631520722 021635 0ustar00boradminboradmin000000 000000 ProgInfoWindow 0 0 400 300 Dialog 280 260 98 27 Close 60 40 256 192 yagf-0.9.5+repack1/src/texteditor.h000755 001750 001750 00000003252 13631520722 020566 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2012 Andrei Borovsky 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 . */ #ifndef TEXTEDITOR_H #define TEXTEDITOR_H #include #include #include "spellchecker.h" class TextEditor : public QTextEdit { Q_OBJECT public: explicit TextEditor(QWidget *parent = 0); ~TextEditor(); bool spellCheck(const QString &lang); void unSpellCheck(); void enumerateDicts(); bool hasDict(const QString &shname); protected: void keyPressEvent ( QKeyEvent *e ); void wheelEvent ( QWheelEvent *e ); private slots: void contextMenuRequested(const QPoint &point); void enlargeFont(); void decreaseFont(); void updateSP(); void replaceWord(); void copyAvailable(bool yes); void textChanged(); void copyClipboard(); private: void saveHtml(QFile *file); void globalReplace(const QString &what, const QString &with); private: SpellChecker spellChecker; bool hasCopy; // bool mTextSaved; }; #endif // TEXTEDITOR_H yagf-0.9.5+repack1/src/qsnippet.cpp000755 001750 001750 00000002706 13631520722 020574 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2010 Andrei Borovsky 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 . */ #include "qsnippet.h" QSnippet::QSnippet(QListWidget *parent) : QListWidgetItem(parent) { } bool QSnippet::setPage(int id, const QString &name, const QImage &image) { if (image.isNull()) { QImage img(name); if (img.isNull()) return false; setIcon(QPixmap::fromImage(img)); } else setIcon(QPixmap::fromImage(image)); this->name = name; setToolTip(name); pid = id; ih = image.height(); iw = image.width(); return true; } QString QSnippet::getName() { return name; } int QSnippet::pageID() { return pid; } int QSnippet::imageHeight() { return ih; } int QSnippet::imageWidth() { return iw; } yagf-0.9.5+repack1/src/recognitiondialog.ui000755 001750 001750 00000007056 13631520722 022267 0ustar00boradminboradmin000000 000000 RecognitionDialog Qt::NonModal 0 0 400 160 YAGF true Recognizing... background-color: rgb(194, 186, 174); QFrame::StyledPanel QFrame::Raised Qt::Horizontal 194 20 50 50 50 50 Qt::Horizontal 193 20 Qt::Horizontal 40 20 Cancel true Qt::Vertical 20 40 QBusyIndicator QWidget
QBusyIndicator.h
1
yagf-0.9.5+repack1/src/busyform.cpp000755 001750 001750 00000002100 13631520722 020563 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #include "busyform.h" #include "ui_busyform.h" BusyForm::BusyForm(QWidget *parent) : QSplashScreen(parent), ui(new Ui::BusyForm) { ui->setupUi(this); //setAttribute(Qt::WA_DeleteOnClose, true); } BusyForm::~BusyForm() { delete ui; } void BusyForm::textOut(const QString &text) { } yagf-0.9.5+repack1/src/qgraphicsinput.cpp000755 001750 001750 00000044626 13631520722 022001 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #include "qgraphicsinput.h" #include "qxtgraphicsview.h" #include "qxtgraphicsproxywidget.h" #include "core/pageanalysis.h" #include "math.h" #include "ycommon.h" #include "tblock.h" #include #include #include #include #include #include #include #include #include QGraphicsInput::QGraphicsInput(const QRectF &sceneRect, QGraphicsView *view) : QGraphicsScene(sceneRect) { setView(view); m_image = 0; selecting = NoSelect; hasImage = false; m_LastSelected = 0; buttonPressed = Qt::NoButton; near_res = 0; magnifierCursor = new QCursor(Qt::SizeAllCursor); redRect.setX(0); redRect.setY(0); redRect.setWidth(0); redRect.setHeight(0); xred = false; deskewMode = false; deskLine = 0; deskewing = false; } QGraphicsInput::~QGraphicsInput() { delete magnifierCursor; } bool QGraphicsInput::loadImage(const QPixmap &pixmap) { clear(); m_LastSelected = 0; m_CurrentBlockRect = 0; m_image = addPixmap(pixmap); setSceneRect(pixmap.rect()); m_image->setZValue(-1); QApplication::processEvents(); this->setFocus(); m_image->setFocus(); m_image->setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton | Qt::MidButton); m_image->setAcceptHoverEvents(true); m_image->setData(1, "image"); if (m_view) { m_view->centerOn(0, 0); m_view->show(); update(); hasImage = true; return true; } else return false; } void QGraphicsInput::setDeskewMode(bool value) { deskewMode = value; } bool QGraphicsInput::getDeskewMode() { return deskewMode; } void QGraphicsInput::setView(QGraphicsView *view) { m_view = view; if (m_view) m_view->setScene(this); } void QGraphicsInput::mousePressEvent(QGraphicsSceneMouseEvent *event) { QGraphicsScene::mousePressEvent(event); // QMessageBox::critical(0, "MOUS111", "MOUSE"); if (!hasImage) return; if (buttonPressed == Qt::LeftButton) { if (event->buttons() != Qt::LeftButton) mouseReleaseEvent(event); event->accept(); return; } if (event->buttons() == Qt::LeftButton) { if (deskewMode) { if (deskewing) { setDeskLine(event->scenePos().x(), event->scenePos().y()); return; } if (deskLine) { clearDeskLine(); } else { setDeskLine(event->scenePos().x(), event->scenePos().y()); deskewing = true; return; } } else { if (deskLine) clearDeskLine(); } buttonPressed = Qt::LeftButton; if (selecting == NoSelect) { if ((near_res = nearActiveBorder(event->scenePos().x(), event->scenePos().y())) != 0) { m_CurrentBlockRect = m_LastSelected; selecting = Selecting; blockRect = m_CurrentBlockRect->rect(); emit deleteBlock(QRectF2Rect(blockRect)); } else { selecting = StartSelect; blockRect.setLeft(event->lastScenePos().x()); blockRect.setTop(event->lastScenePos().y()); blockRect.setWidth(10); blockRect.setHeight(10); } } else { //TODO!!! } } else buttonPressed = Qt::RightButton; } void QGraphicsInput::deleteBlockRect(QGraphicsRectItem *item) { if (item == 0) return; if (item == m_CurrentBlockRect) m_CurrentBlockRect = 0; if (item == m_LastSelected) m_LastSelected = 0; removeItem(item); } void QGraphicsInput::setDeskLine(int x, int y) { if (deskLine == 0) { deskLine = new QGraphicsLineItem(m_image); QPen pen = QPen(QColor(80, 80, 0)); pen.setWidth(2); deskLine->setPen(pen); deskLine->setLine(x, y, x, y); } else { QLineF l = deskLine->line(); deskLine->setLine(l.x1(), l.y1(), x, y); desData = deskLine->line(); } deskLine->show(); } QLineF QGraphicsInput::getDeskData() { return desData; } void QGraphicsInput::clearDeskLine() { delete deskLine; deskLine = 0; deskewMode = false; deskewing = false; desData = QLineF(0,0,0,0); } void QGraphicsInput::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) { QGraphicsScene::mouseReleaseEvent(mouseEvent); if (deskewing) emit clickMeAgain(); if (buttonPressed == Qt::LeftButton) { if (deskewing) emit clickMeAgain(); if (selecting == Selecting) { selecting = NoSelect; if ((blockRect.width() < 12) || (blockRect.height() < 12)) { if (m_CurrentBlockRect == m_LastSelected) m_LastSelected = 0; deleteBlockRect(m_CurrentBlockRect); //clik!!! leftMouseRelease(mouseEvent->scenePos().x(), mouseEvent->scenePos().y()); } else emit blockCreated(QRectF2Rect(m_CurrentBlockRect->rect())); if (xred) emit deleteBlock(redRect); xred = false; m_CurrentBlockRect = 0; } if (selecting == StartSelect) { selecting = NoSelect; m_CurrentBlockRect = 0; leftMouseRelease(mouseEvent->scenePos().x(), mouseEvent->scenePos().y()); } } deskewing = false; if (buttonPressed == Qt::RightButton) { this->rightMouseRelease(mouseEvent->scenePos().x(), mouseEvent->scenePos().y()); } buttonPressed = Qt::NoButton; } QGraphicsRectItem *QGraphicsInput::newBlock(QRectF rect) { QPen p(Qt::SolidLine); QBrush b(Qt::SolidPattern); b.setColor(QColor(0, 0, 127, 127)); p.setWidth(2); p.setColor(QColor(0, 0, 255)); QGraphicsRectItem *res; if (rect.width() + rect.x() > m_image->boundingRect().width()) rect.setWidth(m_image->boundingRect().width() - rect.x()-1); if (rect.x() < 0) rect.setX(0); if (rect.height() + rect.y() > m_image->boundingRect().height()) rect.setHeight(m_image->boundingRect().height() - rect.y()-1); if (rect.y() < 0) rect.setY(0); res = this->addRect(rect, p, b); res->setAcceptHoverEvents(true); res->setZValue(1); res->setData(1, "block"); res->setData(2, "no"); return res; } bool QGraphicsInput::addBlock(const QRectF &rect, bool removeObstacles) { QGraphicsRectItem *block = newBlock(rect); if (!removeObstacles) { if (block->collidingItems().size() > 0) { deleteBlockRect(block); return false; } } else { for (int i = block->collidingItems().size() - 1; i >= 0; i--) { if (block->collidingItems().at(i)->data(1) == "block") deleteBlockRect((QGraphicsRectItem *) block->collidingItems().at(i)); } } m_CurrentBlockRect = block; return true; } void QGraphicsInput::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent) { QGraphicsScene::mouseMoveEvent(mouseEvent); if (deskewing) { setDeskLine(mouseEvent->scenePos().x(), mouseEvent->scenePos().y()); } if (selecting == StartSelect) { selecting = Selecting; m_CurrentBlockRect = newBlock(blockRect); } if ((mouseEvent->modifiers() & Qt::ControlModifier) == 0) if (mouseEvent->buttons() == Qt::NoButton) { near_res = nearActiveBorder(mouseEvent->scenePos().x(), mouseEvent->scenePos().y()); switch (near_res) { case 0: m_view->viewport()->setCursor(Qt::ArrowCursor); break; case 1: m_view->viewport()->setCursor(Qt::SplitHCursor); break; case 2: m_view->viewport()->setCursor(Qt::SplitVCursor); break; case 3: m_view->viewport()->setCursor(Qt::SplitHCursor); break; case 4: m_view->viewport()->setCursor(Qt::SplitVCursor); break; default: break; } } QRectF newRect; if (near_res && (mouseEvent->buttons()&Qt::LeftButton)) { if (!xred) redRect = QRectF2Rect(m_LastSelected->rect()); xred = true; QRectF newRect = m_LastSelected->mapRectToScene(m_LastSelected->rect()); switch (near_res) { case 1: newRect.setLeft(mouseEvent->lastScenePos().x()); break; case 2: newRect.setTop(mouseEvent->lastScenePos().y()); break; case 3: newRect.setRight(mouseEvent->lastScenePos().x()); break; case 4: newRect.setBottom(mouseEvent->lastScenePos().y()); break; default: break; } m_CurrentBlockRect = m_LastSelected; m_CurrentBlockRect->setRect(m_LastSelected->mapRectFromScene(newRect)); for (int i = 0; i < m_CurrentBlockRect->collidingItems().size(); ++i) if (m_CurrentBlockRect->collidingItems().at(i)->data(1) == "block") { m_CurrentBlockRect->setRect(m_LastSelected->mapRectFromScene(selBlockRect)); return; } selBlockRect = newRect; return; } if (selecting == Selecting) { newRect = blockRect; if (newRect.left() < mouseEvent->lastScenePos().x()) newRect.setRight(mouseEvent->lastScenePos().x()); else newRect.setLeft(mouseEvent->lastScenePos().x()); if (newRect.top() < mouseEvent->lastScenePos().y()) newRect.setBottom(mouseEvent->lastScenePos().y()); else newRect.setTop(mouseEvent->lastScenePos().y()); m_CurrentBlockRect->setRect(newRect); for (int i = 0; i < m_CurrentBlockRect->collidingItems().size(); ++i) if (m_CurrentBlockRect->collidingItems().at(i)->data(1) == "block") { m_CurrentBlockRect->setRect(blockRect); return; } blockRect = newRect; return; } } void QGraphicsInput::leftMouseRelease(qreal x, qreal y) { QGraphicsItem *it = this->itemAt(x, y); if (it) { if (it->data(1).toString() == "block") { QGraphicsRectItem *r = (QGraphicsRectItem *) it; QPen p(Qt::SolidLine); QBrush b(Qt::SolidPattern); b.setColor(QColor(0, 0, 127, 127)); p.setColor(QColor(0, 0, 255)); p.setWidth(2); if (r->data(2).toString() == "no") { //select block!!!! if (m_LastSelected) { m_LastSelected->setPen(p); m_LastSelected->setBrush(b); m_LastSelected->setData(2, "no"); } b.setColor(QColor(127, 0, 0, 127)); p.setColor(QColor(255, 0, 0)); r->setData(2, "yes"); m_LastSelected = r; selBlockRect = m_LastSelected->rect(); redRect = QRectF2Rect(selBlockRect); // ATT // emit addBlock(QRectF2Rect(selBlockRect)); } else { m_LastSelected = 0; r->setData(2, "no"); } r->setPen(p); r->setBrush(b); // m_CurrentBlockRect = r; } } else m_CurrentBlockRect = 0; emit leftMouseClicked(m_view->mapFromScene(x, y).x(), m_view->mapFromScene(x, y).y(), m_CurrentBlockRect != 0); } void QGraphicsInput::rightMouseRelease(qreal x, qreal y) { QGraphicsItem *it = this->itemAt(x, y); if (it) { if (it->data(1).toString() == "block") { m_CurrentBlockRect = (QGraphicsRectItem *) it; } } else m_CurrentBlockRect = 0; emit rightMouseClicked(m_view->mapFromScene(x, y).x(), m_view->mapFromScene(x, y).y(), m_CurrentBlockRect != 0); } int QGraphicsInput::nearActiveBorder(qreal x, qreal y) { if (m_LastSelected == 0) return 0; x = m_LastSelected->mapFromScene(x, y).x(); y = m_LastSelected->mapFromScene(x, y).y(); qreal xcenter = m_LastSelected->rect().center().x(); qreal ycenter = m_LastSelected->rect().center().y(); qreal xcd = abs(m_LastSelected->rect().right() - xcenter) + 8; qreal ycd = abs(m_LastSelected->rect().bottom() - ycenter) + 8; if ((abs(x - m_LastSelected->rect().left()) <= 4)) { if (abs(y - ycenter) < ycd) return 1; else return 0; } if ((abs(m_LastSelected->rect().top() - y) <= 4)) { if (abs(x - xcenter) < xcd) return 2; else return 0; } if ((abs(x - m_LastSelected->rect().right()) <= 4)) { if (abs(y - ycenter) < ycd) return 3; else return 0; } if ((abs(m_LastSelected->rect().bottom() - y) <= 4)) { if (abs(x - xcenter) < xcd) return 4; else return 0; } return 0; } QRect QGraphicsInput::getActiveBlock() { if (m_LastSelected) return QRectF2Rect(m_LastSelected->rect()); return QRectF2Rect(QRect(0,0,0,0)); } QRect QGraphicsInput::getCurrentBlock() { if (m_CurrentBlockRect) { int x =m_CurrentBlockRect->rect().x(); int y = m_CurrentBlockRect->rect().y(); int w = m_CurrentBlockRect->rect().width(); int h = m_CurrentBlockRect->rect().height(); bool reframe = false; if (x < 0) { x = 0; reframe = true; } if (y < 0) { y = 0; reframe = true; } if (x >= m_image->boundingRect().width()) { x = 0; reframe = true; } if (y >= m_image->boundingRect().height()) { y = 0; reframe = true; } if (w+x >= m_image->boundingRect().width()) { w = m_image->boundingRect().width() - x -1; reframe = true; } if (w+x < 0) { w = -x + 1; reframe = true; } if (h+y >= m_image->boundingRect().height()) { w = m_image->boundingRect().height() - y - 1; reframe = true; } if (w+y < 0) { w = -y + 1; reframe = true; } if (reframe) { return QRect(x, y, w, h); } return QRectF2Rect(m_CurrentBlockRect->rect()); } return QRectF2Rect(QRect(0,0,0,0)); } void QGraphicsInput::deleteCurrentBlock() { if (m_CurrentBlockRect != 0) deleteBlockRect(m_CurrentBlockRect); } void QGraphicsInput::deleteActiveBlock() { if (m_LastSelected) deleteBlockRect(m_LastSelected); m_LastSelected = 0; } void QGraphicsInput::deleteBlock(int index) { int count = 0; for (int i = 0; i < items().count(); i++) { if (items().at(i)->data(1) == "block") { if (index == count) { deleteBlockRect((QGraphicsRectItem *)items().at(i)); return; } count++; } } } void QGraphicsInput::clearBlocks() // KEEP { for (int i = items().count() - 1; i >= 0; i--) { if (items().at(i)->data(1) == "block") { deleteBlockRect((QGraphicsRectItem *)items().at(i)); } } } void QGraphicsInput::setMagnifierCursor(QCursor *cursor) { delete magnifierCursor; magnifierCursor = new QCursor(cursor->pixmap()); } void QGraphicsInput::wheelEvent(QGraphicsSceneWheelEvent *wheelEvent) { if (wheelEvent->modifiers() == Qt::ControlModifier) { int delta = wheelEvent->delta(); qreal coeff = delta < 0 ? 1 / (1 - delta / (360.)) : 1 + delta / (240.); if (coeff >= 1) emit increaseMe(); else emit decreaseMe(); wheelEvent->accept(); m_view->viewport()->setCursor(*magnifierCursor); } else QGraphicsScene::wheelEvent(wheelEvent); } void QGraphicsInput::keyReleaseEvent(QKeyEvent *keyEvent) { if (keyEvent->key() == Qt::Key_Control) m_view->viewport()->setCursor(Qt::ArrowCursor); if (keyEvent->modifiers() & Qt::ControlModifier) { if ((keyEvent->key() == Qt::Key_Plus) || (keyEvent->key() == Qt::Key_Equal)) { emit increaseMe(); return; } if ((keyEvent->key() == Qt::Key_Minus) || (keyEvent->key() == Qt::Key_Underscore)) { emit decreaseMe(); return; } } if (keyEvent->key() > Qt::Key_F1) { emit keyPressed((int)keyEvent->key()); } } void QGraphicsInput::clearTransform() { if (m_view) { QTransform tr = m_view->transform(); tr.reset(); m_view->setTransform(tr); } } void QGraphicsInput::keyPressEvent(QKeyEvent *keyEvent) { if (keyEvent->key() == Qt::Key_Control) { m_view->viewport()->setCursor(*magnifierCursor); //QApplication:: } } void QGraphicsInput::drawLine(int x1, int y1, int x2, int y2) { QPen pen(QColor("red")); pen.setWidth(2); this->addLine(x1, y1, x2, y2, pen); } void QGraphicsInput::imageOrigin(QPoint &p) { p.setX(m_image->mapToScene(0,0).x()); p.setY(m_image->mapToScene(0,0).y()); } QPixmap QGraphicsInput::getCurrentImage() { return (m_image->pixmap()); } void QGraphicsInput::addBlockColliding(Block block) { QGraphicsRectItem *gi = newBlock(block); m_CurrentBlockRect = gi; QGraphicsTextItem *gte = new QGraphicsTextItem(QString::number(block.blockNumber()), gi); gte->setFont(QFont("Arial", 16)); gte->setDefaultTextColor(QColor("white")); gte->moveBy(block.x(), block.y()); } yagf-0.9.5+repack1/src/settings.h000755 001750 001750 00000013024 13631520722 020231 0ustar00boradminboradmin000000 000000 /* 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. */ #ifndef _SETTINGS_H_ #define _SETTINGS_H_ #include #include #include #include #include #include #include enum SelectedEngine { UseCuneiform, UseTesseract }; class Settings { public: static Settings *instance(); void readSettings(const QString &path); bool firstRun(); void writeSettings(); QString getLanguage(); bool useNoLocale(); void setNoLocale(bool value); void setRussianLocale(bool value); QString getOutputFormat(); QString getLastDir(); QString getLastOutputDir(); bool getCheckSpelling(); QString getTessdataPath(); SelectedEngine getSelectedEngine(); QSize getSize(); QSize getIconSize(); QPoint getPosition(); bool getFullScreen(); int getFontSize(); QStringList getRecentProjects(); int getMaxRecentProjects(); void setMaxRecentProjects(const int value); QString getFullLanguageName(const QString &abbr); QString getFullLanguageName(const QString &abbr, const QString &engine); QString getShortLanguageName(const QString &lang); QString getShortLanguageName(const QString &lang, const QString &engine); bool getAutoDeskew(); bool getCropLoaded(); bool getPreprocessed(); bool getDoublePreprocessed(); void setLanguage(const QString &value); void setOutputFormat(const QString &value); void setLastDir(const QString &value); void setLastOutputDir(const QString &value); void setCheckSpelling(const bool value); void setTessdataPath(const QString &value); void setSelectedEngine(const SelectedEngine value); void setSize(const QSize &value); void setIconSize(const QSize &value); void setPosition(const QPoint &value); void setFullScreen(const bool value); void setFontSize(const int &value); void setCropLoaded(const bool value); void setAutoDeskew(const bool value); void setPreprocessed(const bool value); void setDoublePreprocessed(const bool value); void setUpscale(bool value); bool getUpscale(); void setSkipWidth(int value); QString getRecognizeInputFile() const; QString getRecognizeOutputExt() const; QString getRecognizeOutputFile() const; QString getRecognizeOutputBase() const; QString getScanOutputFile() const; int getSkipWidth(); QString uniqueSeed(); QString tiffPageSize(); QString tiffDensity(); int getDarkBackgroundThreshold(); int getForegroundBrightenFactor(); int getGlobalBrightenFactor(); int getGlobalDarkenFactor(); int getGlobalDarkenThreshold(); int getAutosaveInterval(); QStringList fullLanguageNames(); QStringList getSelectedLanguages(); QStringList selectedLanguagesAvailableTo(const QString &engine); QStringList languagesAvailableTo(const QString &engine); QStringList installedTesseractLanguages(); QString getRowBegin(); QString getRowEnd(); QString getCellSeparator(); bool getRowFromBNewLine(); void setSelectedLanguages(const QStringList &value); QString workingDir(); void startLangPair(); bool getLangPair(QString &full, QString &abbr, bool forceTesseract = false); void setProjectDir(const QString &dir); QString getProjectDir(); void makeLanguageMaps(); QString tmpFileName(); QString tmpYGFFileName(); void setLangTess(); bool getKeepLines() const; void setKeepLines(const bool value); void setRowBegin(const QString &value); void setRowEnd(const QString &value); void setCellSeparator(const QString &value); void setRowFromBNewLine(const bool value); void addRecentProject(const QString &project); void removeRecentProject(const QString &project); void setAutosaveInterval(const int value); bool projectExists(const QString &dir); private: void findTessDataPath(); QString selectDefaultLanguageName(); Settings(); Settings(const Settings &); bool useRussianLocale(); ~Settings(); private: QString language; QString outputFormat; QString lastDir; QString lastOutputDir; QString projectDir; QString version; bool checkSpelling; QString tessdataPath; SelectedEngine selectedEngine; QSize size; QSize iconSize; QPoint position; bool fullScreen; int fontSize; bool cropLoaded; bool preprocess; bool fr; QMap cuMap; QMap tesMap; int lpi; bool noLocale; bool RussianLocale; bool autoDeskew; int darkBackgroundThreshold; int globalBrightenFactor; int foregroundBrightenFactor; int globalDarkenFactor; int globalDarkenThreshold; int uSeed; QStringList languages; QString mPath; QSettings *settings; static Settings *m_instance; QString tiffPS; QString tiffD; bool upscale; int skipWidth; bool keepLines; bool doublePreprocess; QString rowBegin; QString rowEnd; QString cellSeparator; bool rowFromNewLine; QStringList recentProjects; int maxRecentProjects; int autosaveInterval; }; #endif yagf-0.9.5+repack1/src/yagf.qrc000755 001750 001750 00000006046 12470517140 017663 0ustar00boradminboradmin000000 000000 images/smaller.png images/larger.png images/yagf.png images/document_save_as.png images/editcopy.png images/scanner.png images/warning.png images/critical.png images/info.png images/resize.png images/resize_block.png images/save_all.png images/batch.png images/remove.png images/undo.png images/scanner_s2.png images/recblocks.png images/check_spelling.png images/savpicas.png images/saveblock.png images/deskew2.png images/stock_new_html.png images/application_pdf.png images/selecttext.png images/edit_paste.png images/selectmulti.png images/eISet.png images/recognition.png images/advanced.png images/installed.png images/box.png images/notinst.png images/Align.png images/Copy.png images/cut.png images/Flip.png images/open.png images/Paste.png images/Recognize.png images/RemoveBlock.png images/Rotateat90.png images/save.png images/Settings.png images/SingleBlock.png images/Spellcheck.png images/split.png images/upscale.png images/ZoomIn.png images/ZoomOut.png images/Trashcan.png images/languages.png images/RemoveBlocks.png images/disc.png images/lines.png images/question.png images/Rotatem90.png images/table.png images/folder.png images/folder_nempty.png images/project.png images/up_arrow.png images/back_arrow.png images/sand_clock.png isrc/MAFY/cogs.svg isrc/MAFY/twicks.svg isrc/MAFY/eye.svg isrc/MAFY/table-1.svg isrc/MAFY/Align.svg isrc/MAFY/open.svg isrc/MAFY/save.svg yagf-0.9.5+repack1/src/spellchecker.h000755 001750 001750 00000003634 13631520722 021043 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2012 Andrei Borovsky 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 . */ #ifndef SPELLCHECKER_H #define SPELLCHECKER_H #include #include #include typedef QMap StringMap; class QTextEdit; class QRegExp; class QTextCursor; class QStringList; class SpellChecker { public: SpellChecker(QTextEdit *textEdit); ~SpellChecker(); void unSpellCheck(); void setLanguage(const QString &lang); bool spellCheck(); //Returns false only if the dictionary not found. Otherwise always true. void checkWord(); bool hasHyphen(QTextCursor *cursor); bool hasLongHyphen(QTextCursor *cursor); QString checkConcatenation(QTextCursor *cursor); void enumerateDicts(); bool hasDict(const QString &shname); QStringList suggestions(); private: void _checkWord(QTextCursor *cursor); bool checkWordSpelling(const QString &word); QTextEdit *m_textEdit; QRegExp *m_regExp; QString m_lang1; QString m_lang2; StringMap *m_map; AspellConfig *spell_config1; AspellConfig *spell_config2; AspellSpeller *spell_checker1; AspellSpeller *spell_checker2; QStringList *dictList; QString bad_language; }; #endif // SPELLCHECKER_H yagf-0.9.5+repack1/src/tblock.cpp000755 001750 001750 00000004045 13631520722 020205 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2012 Andrei Borovsky 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 . */ #include "tblock.h" #include Block::Block(int x, int y, int width, int height) : QRect(x, y, width, height), number(-1), center(QRect::x()+QRect::width()/2, QRect::y()+QRect::height()/2), tableCell(false), rowEnd(false), language("default") { } Block::Block(const QRect &r) : QRect(r.x(), r.y(), r.width(), r.height()), number(-1), center(QRect::x()+QRect::width()/2, QRect::y()+QRect::height()/2), tableCell(false), language("default") { } Block::Block() { } int Block::blockNumber() { return number; } void Block::setBlockNumber(const int value) { number = value; } void Block::setLanguage(const QString &lang) { language = lang; } void Block::setTableCell(const bool value) { tableCell = value; } bool Block::isTableCell() { return tableCell; } void Block::setRowEnd(bool value) { rowEnd = value; } bool Block::isRowEnd() { return rowEnd; } QString Block::getLanguage() { return language; } QPoint Block::getCenter() { return center; } bool rectLessThan(const QRect &r1, const QRect &r2) { if (r1.y() < r2.y()) return true; if (r1.x() < r2.x()) return true; return false; } void sortBlocks(Blocks &blocks) { qSort(blocks.begin(), blocks.end(), rectLessThan); } yagf-0.9.5+repack1/src/projectmanager.cpp000755 001750 001750 00000025624 13631520722 021736 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2011 Andrei Borovsky 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 . */ #include "projectmanager.h" #include "tpagecollection.h" #include "settings.h" #include "globallock.h" #include #include #include #include #include #include #include #include const QString URI = "symmetrica.net/yagf"; const QString VERSION = "0.9.5"; inline QString boolToString(bool value) { return value ? "true" : "false"; } ProjectSaver::ProjectSaver(QObject *parent) : QObject(parent) { } bool ProjectSaver::save(const QString &dir) { bool res = GlobalLock::instance()->lock(); if (!res) return false; Unlocker unlocker(true); directory = dir; if (!directory.endsWith("/")) directory = directory + "/"; QDir _dir(directory); if (QFile::exists(directory+"yagf_project.old")) { QFile f(directory+"yagf_project.old"); f.remove(); } if (QFile::exists(directory+"yagf_project.xml")) { QFile f(directory+"yagf_project.xml"); f.copy(directory+"yagf_project.old"); } if (!_dir.exists()) _dir.mkdir(directory); QString fileName = directory+"yagf_project.xml"; QFile f(fileName); if (!f.open(QIODevice::WriteOnly|QIODevice::Truncate)) { return false; } stream = new QXmlStreamWriter(&f); stream->setAutoFormatting(true); stream->writeStartDocument(); stream->writeStartElement(URI, "yagf"); stream->writeAttribute(URI, "version", VERSION); writeSettings(); writePages(); stream->writeEndDocument(); f.flush(); delete stream; f.close(); Settings::instance()->addRecentProject(dir); deleteGarbageFiles(); return true; } void ProjectSaver::writePages() { PageCollection *pc = PageCollection::instance(); if (pc->count()) pc->storeCurrentIndex(); for (int i =0; i < pc->count(); i++) { stream->writeStartElement(URI, "page"); pc->makePageCurrent(i); stream->writeAttribute(URI, "image", copyFile(pc->fileName())); QFileInfo fi(pc->fileName()); imagesSaved.append(fi.fileName()); stream->writeAttribute(URI, "title", pc->originalFileName()); stream->writeAttribute(URI, "deskewed", boolToString(pc->isDeskewed())); stream->writeAttribute(URI, "rotation", QString::number(pc->getRotation())); stream->writeAttribute(URI, "preprocessed", boolToString(pc->isPreprocessed())); stream->writeAttribute(URI, "cropped", boolToString(pc->isCropped())); stream->writeAttribute(URI, "rtext", pc->text()); writeBlocks(); stream->writeEndElement(); } if (pc->count()) pc->restoreCurrentIndex(); } void ProjectSaver::writeBlocks() { PageCollection *pc = PageCollection::instance(); for (int i = 0; i < pc->blockCount(); i++) { stream->writeStartElement(URI, "block"); Block b =pc->getBlock(i); if (b.blockNumber()>0) stream->writeAttribute(URI, "number", QString::number(b.blockNumber())); b = pc->scaleRect(b, 1); stream->writeAttribute(URI, "left", QString::number(b.left())); stream->writeAttribute(URI, "top", QString::number(b.top())); stream->writeAttribute(URI, "width", QString::number(b.width())); stream->writeAttribute(URI, "height", QString::number(b.height())); // stream->writeAttribute(URI, "language", "eng"); stream->writeEndElement(); } } void ProjectSaver::writeSettings() { stream->writeStartElement(URI, "settings"); Settings *settings = Settings::instance(); QString engine; if (settings->getSelectedEngine() == UseCuneiform) engine = "cuneiform"; if (settings->getSelectedEngine() == UseTesseract) engine = "tesseract"; stream->writeAttribute(URI, "engine", engine); stream->writeAttribute(URI, "defaultlanguage", settings->getLanguage()); stream->writeEndElement(); } QString ProjectSaver::copyFile(const QString &source) { QFileInfo fi(source); QString dir = fi.absolutePath(); if (!dir.endsWith("/")) dir = dir + "/"; QString base = fi.baseName(); QString fileName = base+".ygf"; if (dir == directory) return fileName; QString newName = directory + fileName; if (source.endsWith(".ygf", Qt::CaseInsensitive)) { if (QFile::copy(source, newName)) return fileName; else { QFileInfo fs(newName); return fs.fileName(); } } else { QImage image(source); if (image.save(newName)) return fileName; else return ""; } return ""; } void ProjectSaver::deleteGarbageFiles() { QDir dir; dir.setPath(directory); QFileInfoList fil = dir.entryInfoList(); foreach (QFileInfo fi, fil) { if (!imagesSaved.contains(fi.fileName())) if ((!fi.fileName().endsWith(".xml"))&&(!fi.fileName().endsWith(".old"))) dir.remove(fi.filePath()); } } ProjectLoader::ProjectLoader(QObject *parent): QObject(parent) { } bool ProjectLoader::load(const QString &dir) { bool res = GlobalLock::instance()->lock(); if (!res) return false; Unlocker unlocker(true); if (loadInternal(dir, "yagf_project.xml")) return true; return loadInternal(dir, "yagf_project.old"); } bool ProjectLoader::readSettings() { Settings *settings = Settings::instance(); if (!readNextElement()) return false; version = stream->attributes().value(URI, "version").toString(); QStringRef n; while ((n = stream->name()) != "settings") if (!readNextElement()) return false; QStringRef engine = stream->attributes().value(URI, "engine"); if (engine == "tesseract") settings->setSelectedEngine(UseTesseract); if (engine == "cuneiform") settings->setSelectedEngine(UseCuneiform); emit engineChanged(); QString language = stream->attributes().value(URI, "defaultlanguage").toString(); if (!language.isEmpty()) settings->setLanguage(language); emit languageChanged(); return true; } int versionToInt(const QString &version) { int res = 0; for (int i = 0; i < version.count(); i++) if (version.at(i).isDigit()) { res *=10; res += version.at(i).digitValue(); } return res; } void ProjectLoader::loadPage() { QString image = stream->attributes().value(URI, "image").toString(); QString fn = directory + image; filesLoaded.append(image); bool oldcl = Settings::instance()->getCropLoaded(); Settings::instance()->setCropLoaded(false); PageCollection *pc = PageCollection::instance(); Settings::instance()->setCropLoaded(oldcl); //pc->appendPage(fn); QString value = stream->attributes().value(URI, "rotation").toString(); bool deskewed = false; bool preprocessed =false; bool cropped = false; qreal rotation = 0; if (!value.isEmpty()) { rotation = (value.toDouble()); } value = stream->attributes().value(URI, "deskewed").toString(); if (!value.isEmpty()) { deskewed = value.endsWith("true", Qt::CaseInsensitive) ? true : false; } value = stream->attributes().value(URI, "cropped").toString(); if (!value.isEmpty()) { cropped = value.endsWith("true", Qt::CaseInsensitive) ? true : false; } value = stream->attributes().value(URI, "preprocessed").toString(); if (!value.isEmpty()) { preprocessed = (value.endsWith("true", Qt::CaseInsensitive) ? true : false); } QString title = stream->attributes().value(URI, "title").toString(); Page * page = pc->newPage(fn,rotation,preprocessed, deskewed, cropped); if (versionToInt(version) >= 94) { value = stream->attributes().value(URI, "rtext").toString(); if (page) { page->setRecognizedText(value); page->setOriginalFileName(title); } } } bool ProjectLoader::readPages() { if (!readNextElement()) return false; QString name; if ((name = stream->name().toString()) != "page") return false; while (stream->name() == "page") { loadPage(); if (!readBlocks()) break; } PageCollection::instance()->reloadPage(); return true; } bool ProjectLoader::readBlocks() { if (!readNextElement()) return false; while (stream->name() == "block") { int top = stream->attributes().value(URI, "top").toString().toInt(); int left = stream->attributes().value(URI, "left").toString().toInt(); int width = stream->attributes().value(URI, "width").toString().toInt(); int height = stream->attributes().value(URI, "height").toString().toInt(); int bn = stream->attributes().value(URI, "number").toString().toInt(); QRect r(left, top, width, height); // r = PageCollection::instance()->scaleRect(r); r = PageCollection::instance()->scaleRectToPage(r); if (bn > 0) PageCollection::instance()->addBlock(r, bn); else PageCollection::instance()->addBlock(r); if (!readNextElement()) return false; } return true; } bool ProjectLoader::readNextElement() { while (!stream->readNextStartElement()) if (stream->atEnd()) return false; return true; } bool ProjectLoader::loadInternal(const QString &dir, const QString &fn) { directory = dir; if (!directory.endsWith("/")) directory = directory + "/"; QString fileName = directory+fn; QFile f(fileName); if (!f.open(QIODevice::ReadOnly)) return false; stream = new QXmlStreamReader(&f); stream->setNamespaceProcessing(true); if (!readSettings()) return false; if (!readPages()) return false; f.close(); Settings::instance()->addRecentProject(dir); deleteGarbageFiles(); return true; } void ProjectLoader::deleteGarbageFiles() { QDir dir; dir.setPath(directory); QFileInfoList fil = dir.entryInfoList(); foreach (QFileInfo fi, fil) { if (!filesLoaded.contains(fi.fileName())) { QString bm =fi.fileName(); if (!bm.endsWith(".xml")) dir.remove(fi.filePath()); } } } yagf-0.9.5+repack1/src/preload.c000755 001750 001750 00000004030 12470517140 020007 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2010 Andrei Borovsky 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 . */ #include #include #include #include #include #include #include #define _GNU_SOURCE #define __USE_GNU #include //static int fd = 0; static FILE * f; /*int open(const char *pathname, int flags) { printf("called %s\n", pathname); }*/ FILE* fopen(const char* path, const char* mode) { printf("called %s\n", path); FILE* (*real_fopen)(const char*, const char*) = dlsym(RTLD_NEXT, "fopen"); if (strstr(path, "input.png")== NULL) return real_fopen(path, mode); if (strstr(mode, "r")) return 0; //if (fd <= 0) //fd = open("/var/tmp/yagf.fifo", O_WRONLY); f = real_fopen(path, mode); return f; } /*size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) { FILE* (*real_fwrite)(const void *ptr, size_t size, size_t nmemb, FILE *stream) = dlsym(RTLD_NEXT, "fwrite"); if (stream == f) write(fd, ptr, size*nmemb); return real_fwrite(ptr, size, nmemb, stream); }*/ int fclose(FILE *fp) { int (* real_fclose)(FILE *fp) = dlsym(RTLD_NEXT, "fclose"); if (f == fp) { // write(fd, endmark, 6); int ppid = getppid(); kill(ppid, SIGUSR2); } return real_fclose(fp); } yagf-0.9.5+repack1/src/tiffimporter.h000755 001750 001750 00000002340 13631520722 021102 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #ifndef TIFFIMPORTER_H #define TIFFIMPORTER_H #include #include #include class TiffImporter : public QObject { Q_OBJECT public: explicit TiffImporter(const QString &fileName, QObject *parent = 0); void exec(); QStringList extractedFiles(); signals: void error(); void finished(const QStringList &files); public slots: private: QStringList files; QString tiffName; }; #endif // TIFFIMPORTER_H yagf-0.9.5+repack1/src/ghostscr.cpp000755 001750 001750 00000003030 13631520722 020554 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #include "ghostscr.h" #include #include GhostScr::GhostScr() : PDFExtractor() { } QStringList GhostScr::makeCommandString() { QStringList args; args.append("gs"); args << "-SDEVICE=jpeg" << "-r1200x1200" << "-sPAPERSIZE=letter" << "-dNOPAUSE" << "-dBATCH"; if (getStopPage() > 0) { if (getStartPage() == 0) this->setStartPage("1"); args << QString("-dFirstPage=").append(QString::number(getStartPage())) << QString("-dLastPage=").append(QString::number(getStopPage())); } setOutputPrefix(getOutputDir().append("page")); args << QString("-sOutputFile=").append(getOutputPrefix()).append("_%04d.jpg"); args << "--" << this->getSourcePDF(); setOutputExtension("jpg"); return args; } yagf-0.9.5+repack1/src/popplerdialog.h000755 001750 001750 00000002466 13631520722 021242 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #ifndef POPPLERDIALOG_H #define POPPLERDIALOG_H #include namespace Ui { class PopplerDialog; } class PopplerDialog : public QDialog { Q_OBJECT public: explicit PopplerDialog(QWidget *parent = 0); ~PopplerDialog(); void setPDFFile(const QString fileName); QString getPDFFile(); QString getStartPage(); QString getStopPage(); bool getDeskew(); private slots: void on_checkBox_toggled(bool checked); void on_pushButton_clicked(); private: Ui::PopplerDialog *ui; }; #endif // POPPLERDIALOG_H yagf-0.9.5+repack1/src/spellchecker.cpp000755 001750 001750 00000031300 13631520722 021365 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-end Copyright (C) 2009-2012 Andrei Borovsky 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 . */ #include #include #include #include #include #include #include #include "spellchecker.h" SpellChecker::SpellChecker(QTextEdit *textEdit): m_textEdit(textEdit) { m_regExp = new QRegExp("[^\\s]*"); //m_cursor= new QTextCursor(m_textEdit->document()); spell_config1 = new_aspell_config(); spell_config2 = new_aspell_config(); aspell_config_replace(spell_config1, "lang", m_lang1.toAscii()); aspell_config_replace(spell_config2, "lang", m_lang2.toAscii()); aspell_config_replace(spell_config1, "encoding", "utf-8"); aspell_config_replace(spell_config2, "encoding", "utf-8"); m_map = new StringMap(); m_map->insert("ara", "ar"); m_map->insert("ruseng", "ru"); m_map->insert("rus", "ru"); m_map->insert("bul", "bg"); m_map->insert("cze", "cs"); m_map->insert("dan", "da"); m_map->insert("dut", "nl"); m_map->insert("nld", "nl"); m_map->insert("ell", "el"); m_map->insert("eng", "en"); m_map->insert("est", "et"); m_map->insert("fin", "fi"); m_map->insert("fra", "fr"); m_map->insert("ger", "de"); m_map->insert("deu", "de"); m_map->insert("deu-frak", "de-alt"); m_map->insert("heb", "he"); m_map->insert("hin", "hi"); m_map->insert("hrv", "hr"); m_map->insert("hun", "hu"); m_map->insert("ind", "in"); m_map->insert("isl", "is"); m_map->insert("ita", "it"); m_map->insert("lav", "lv"); m_map->insert("lit", "lt"); m_map->insert("mkd", "mk"); m_map->insert("msa", "ms"); m_map->insert("nor", "no"); m_map->insert("pol", "pl"); m_map->insert("por", "pt_PT"); m_map->insert("rum", "ro"); //m_map->insert("rus", "ru"); m_map->insert("ron", "ro"); m_map->insert("slo", "sl"); m_map->insert("slk", "sk"); m_map->insert("spa", "es"); m_map->insert("srp", "sr"); m_map->insert("swa", "sw"); m_map->insert("swe", "sv"); m_map->insert("swef", "sv"); m_map->insert("tur", "tr"); m_map->insert("ukr", "uk"); m_map->insert("vie", "vi"); spell_checker1 = 0; spell_checker2 = 0; setLanguage("ruseng"); dictList = new QStringList(); } void SpellChecker::enumerateDicts() { AspellConfig *config; AspellDictInfoList *dlist; AspellDictInfoEnumeration *dels; const AspellDictInfo *entry; config = new_aspell_config(); /* the returned pointer should _not_ need to be deleted */ dlist = get_aspell_dict_info_list(config); /* config is no longer needed */ delete_aspell_config(config); dels = aspell_dict_info_list_elements(dlist); while ((entry = aspell_dict_info_enumeration_next(dels)) != 0) { dictList->append(entry->code); } delete_aspell_dict_info_enumeration(dels); } bool SpellChecker::hasDict(const QString &shname) { if (shname.contains("+")) { return dictList->contains(m_map->value(shname.split("+")[0])); } return dictList->contains(m_map->value(shname)); } SpellChecker::~SpellChecker() { delete m_regExp; delete m_map; delete_aspell_speller(spell_checker1); delete_aspell_speller(spell_checker2); delete_aspell_config(spell_config1); delete_aspell_config(spell_config2); delete dictList; } void SpellChecker::setLanguage(const QString &lang) { if (lang.isEmpty()) return; delete_aspell_speller(spell_checker1); delete_aspell_speller(spell_checker2); bad_language.clear(); m_lang2 = "en"; m_lang1 = m_map->value(lang, QString("en")); if (lang.contains("+")) { QStringList sl = lang.split("+"); m_lang1 = m_map->value(sl[0], QString("en")); m_lang2 = m_map->value(sl[1], QString("en")); if ((m_lang1 == "deu")||(lang == "ger")) { m_lang1 = "de_DE"; } if ((m_lang2 == "deu")||(lang == "ger")) { m_lang2 = "de_DE"; } } if (lang == "rus_fra") { m_lang1 = "ru"; m_lang2 = "fr"; } else if (lang == "rus_ger") { m_lang1 = "ru"; m_lang2 = "de"; } else if (lang == "rus_spa") { m_lang1 = "ru"; m_lang2 = "es"; } if ((lang == "deu")||(lang == "ger")) { m_lang1 = "de_DE"; m_lang2 = "de_AT"; } if (lang == "ruseng") { m_lang1 = "ru"; m_lang2 = "en"; } aspell_config_replace(spell_config1, "lang", m_lang1.toAscii()); aspell_config_replace(spell_config2, "lang", m_lang2.toAscii()); AspellCanHaveError *possible_err = new_aspell_speller(spell_config1); spell_checker1 = 0; if (aspell_error_number(possible_err) == 0) spell_checker1 = to_aspell_speller(possible_err); else delete_aspell_can_have_error(possible_err); possible_err = new_aspell_speller(spell_config2); spell_checker2 = 0; if (aspell_error_number(possible_err) == 0) spell_checker2 = to_aspell_speller(possible_err); else delete_aspell_can_have_error(possible_err); // Check absent dictionary if (spell_checker1 == 0) bad_language = m_lang1; if (spell_checker2 == 0) bad_language = m_lang2; } bool SpellChecker::spellCheck() { if ((spell_checker1 == 0) && (spell_checker2 == 0)) { QPixmap icon; icon.load(":/warning.png"); QMessageBox messageBox(QMessageBox::NoIcon, "YAGF", QObject::trUtf8("Required spelling dictionary (%1) is not found.\nSpell-checking is disabled.\nTry to install an appropriate aspell dictionary.").arg(bad_language), QMessageBox::Ok, 0); messageBox.setIconPixmap(icon); messageBox.exec(); return false; } QTextCursor cursor(m_textEdit->document()); while (!cursor.isNull() && !cursor.atEnd()) { if (hasLongHyphen(&cursor)) { cursor.select(QTextCursor::WordUnderCursor); QString word1 = cursor.selectedText(); word1.truncate(word1.length()-1); cursor.movePosition(QTextCursor::NextWord); cursor.select(QTextCursor::WordUnderCursor); QString word2 = cursor.selectedText(); word1 = word1 +word2; if (checkWordSpelling(word1)) { cursor.movePosition(QTextCursor::PreviousWord); cursor.select(QTextCursor::WordUnderCursor); cursor.removeSelectedText(); cursor.select(QTextCursor::WordUnderCursor); cursor.removeSelectedText(); cursor.insertText(word1); } } cursor.select(QTextCursor::WordUnderCursor); QString word = cursor.selectedText(); if (word == QString::fromUtf8("—")) { cursor.removeSelectedText(); cursor.insertText(QString::fromUtf8("—")); } if (hasHyphen(&cursor)) { QString cc = checkConcatenation(&cursor); if (!cc.isEmpty()) { cursor.movePosition(QTextCursor::PreviousWord); cursor.movePosition(QTextCursor::PreviousWord); cursor.select(QTextCursor::WordUnderCursor); cursor.removeSelectedText(); cursor.select(QTextCursor::WordUnderCursor); cursor.removeSelectedText(); cursor.movePosition(QTextCursor::NextWord); cursor.select(QTextCursor::WordUnderCursor); cursor.removeSelectedText(); cursor.insertText(cc); } } _checkWord(&cursor); QTextCursor oldc = cursor; if (!cursor.movePosition(QTextCursor::NextWord, QTextCursor::MoveAnchor)) break; //cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::MoveAnchor); //cursor = m_textEdit->document()->find(*m_regExp, cursor); int oldpos = oldc.position(); int newpos = cursor.position(); if (abs(newpos - oldpos) < 3) cursor.setPosition(newpos + 1); } if (!cursor.isNull()) _checkWord(&cursor); return true; } void SpellChecker::unSpellCheck() { QTextCursor cursor(m_textEdit->document()); QTextCharFormat fmt = cursor.charFormat(); fmt.setUnderlineStyle(QTextCharFormat::NoUnderline); cursor.select(QTextCursor::Document); cursor.setCharFormat(fmt); cursor.clearSelection(); } void SpellChecker::_checkWord(QTextCursor *cursor) { cursor->select(QTextCursor::WordUnderCursor); QString selText = cursor->selectedText(); static const QRegExp nonDigits("\\D"); if (!selText.contains(nonDigits)) return; selText = selText.remove(QString::fromUtf8("«")); selText = selText.remove(QString::fromUtf8("»")); //selText = selText.remove("\""); selText = selText.remove(QString::fromUtf8("(")); selText = selText.remove(QString::fromUtf8(")")); if (!checkWordSpelling(selText)) { QTextCharFormat fmt = cursor->charFormat(); fmt.setUnderlineColor(QColor(Qt::red)); fmt.setUnderlineStyle(QTextCharFormat::SpellCheckUnderline); cursor->setCharFormat(fmt); } else { QTextCharFormat fmt = cursor->charFormat(); fmt.setUnderlineStyle(QTextCharFormat::NoUnderline); cursor->setCharFormat(fmt); } cursor->clearSelection(); } bool SpellChecker::checkWordSpelling(const QString &word) { QString tmp = word; tmp = tmp.remove(QString::fromUtf8("»")); tmp = tmp.remove(QString::fromUtf8("«")); QByteArray ba = tmp.toUtf8(); return (aspell_speller_check(spell_checker1, ba.data(), ba.size()) != 0) || (aspell_speller_check((spell_checker2 != NULL ? spell_checker2 : spell_checker1), ba.data(), ba.size()) != 0); } void SpellChecker::checkWord() { if ((spell_checker1 == 0) && (spell_checker2 == 0)) return; QTextCursor cursor = m_textEdit->textCursor(); _checkWord(&cursor); } bool SpellChecker::hasHyphen(QTextCursor *cursor) { if ((spell_checker1 == 0) || (spell_checker2 == 0)) return false; cursor->movePosition(QTextCursor::EndOfWord); //cursor->movePosition(QTextCursor::NextCharacter); cursor->select(QTextCursor::WordUnderCursor); QString selText = cursor->selectedText(); cursor->movePosition(QTextCursor::PreviousWord); if (selText.endsWith(QString::fromUtf8("-"))) return true; return false; } bool SpellChecker::hasLongHyphen(QTextCursor *cursor) { cursor->select(QTextCursor::WordUnderCursor); QString selText = cursor->selectedText(); return selText.endsWith(QString::fromUtf8("—")); } QString SpellChecker::checkConcatenation(QTextCursor *cursor) { cursor->movePosition(QTextCursor::PreviousWord); cursor->select(QTextCursor::WordUnderCursor); QString word1 = cursor->selectedText(); cursor->movePosition(QTextCursor::NextWord); //cursor->movePosition(QTextCursor::NextWord); cursor->select(QTextCursor::WordUnderCursor); QString word2 = cursor->selectedText(); cursor->movePosition(QTextCursor::PreviousWord); QString word = word1+word2; if (checkWordSpelling(word)) return word; return ""; } QStringList SpellChecker::suggestions() { QStringList sl; if ((spell_checker1 == 0) || (spell_checker2 == 0)) return sl; QTextCursor cursor = m_textEdit->textCursor(); cursor.select(QTextCursor::WordUnderCursor); QString word = cursor.selectedText(); QByteArray ba = word.toUtf8(); if ((aspell_speller_check(spell_checker2, ba.data(), ba.size()) != 0)||(aspell_speller_check(spell_checker1, ba.data(), ba.size()) != 0)) return sl; const struct AspellWordList *awl = aspell_speller_suggest(spell_checker1, ba.data(), ba.size()); if (aspell_word_list_size(awl) > 0) { struct AspellStringEnumeration *ase = aspell_word_list_elements(awl); int i = 0; while ((!aspell_string_enumeration_at_end(ase))&&(i < 10)) { const char *text = aspell_string_enumeration_next(ase); sl << QString::fromUtf8(text); i++; } delete_aspell_string_enumeration(ase); } return sl; } yagf-0.9.5+repack1/src/images/000755 001750 001750 00000000000 12470517140 017462 5ustar00boradminboradmin000000 000000 yagf-0.9.5+repack1/src/images/critical.png000755 001750 001750 00000002332 12470517140 021765 0ustar00boradminboradmin000000 000000 PNG  IHDR**[sBIT|d pHYstEXtSoftwarewww.inkscape.org<tEXtTitleLines of TexttEXtAuthorNastya BekassovaIDATXՙOW?w Ą@$@A ݺtFR'DJ' A$ Q*uhԩcC"Yj"c@Pc8bW.ӽ~ϒԍ]&Aj'~bm |Ytv6D6ΑHH3|3דImd6I&Ʃm,:*Y6kkiQq*+fssXojk|~1uz6 _F^hl|JoWLN_KsTpKz{= [Ww J궁47oQW845m/ yc*+W`ۏwyRa)r$]p9|%c?+ 2UKlmq%s>CݻV68GF@}xS[2fq/Nl'챏A1ȭjpHAn͛CQOshN_P:DˎߨzNixVViI:~oz0:uTM"M4 X}}Wnp0Mco НqK9 `}=0OcSB'@-̴/BIENDB`yagf-0.9.5+repack1/src/images/smaller.png000755 001750 001750 00000005733 12470517140 021642 0ustar00boradminboradmin000000 000000 PNG  IHDR "> MiCCPPhotoshop ICC profilexڝSwX>eVBl"#Ya@Ņ VHUĂ H(gAZU\8ܧ}zy&j9R<:OHɽH gyx~t?op.$P&W " R.TSd ly|B" I>ةآ(G$@`UR,@".Y2GvX@`B, 8C L0ҿ_pH˕͗K3w!lBa)f "#HL 8?flŢko">!N_puk[Vh]3 Z zy8@P< %b0>3o~@zq@qanvRB1n#Dž)4\,XP"MyRD!ɕ2 w ONl~Xv@~- g42y@+͗\LD*A aD@ $<B AT:18 \p` Aa!:b""aH4 Q"rBj]H#-r9\@ 2G1Qu@Ơst4]k=Kut}c1fa\E`X&cX5V5cX7va$^lGXLXC%#W 1'"O%zxb:XF&!!%^'_H$ɒN !%2I IkHH-S>iL&m O:ňL $RJ5e?2BQͩ:ZImvP/S4u%͛Cˤ-Кigih/t ݃EЗkw Hb(k{/LӗT02goUX**|:V~TUsU?y TU^V}FUP թU6RwRPQ__c FHTc!2eXBrV,kMb[Lvv/{LSCsfffqƱ9ٜJ! {--?-jf~7zھbrup@,:m:u 6Qu>cy Gm7046l18c̐ckihhI'&g5x>fob4ekVyVV׬I\,mWlPW :˶vm))Sn1 9a%m;t;|rtuvlp4éĩWggs5KvSmnz˕ҵܭm=}M.]=AXq㝧/^v^Y^O&0m[{`:>=e>>z"=#~~~;yN`k5/ >B Yroc3g,Z0&L~oL̶Gli})*2.QStqt,֬Yg񏩌;jrvgjlRlc웸xEt$ =sl3Ttcܢ˞w|/%ҟ3bKGD pHYs4:tIME !劍EIDATXVK0)Kx 6&츔'RHpWA AR?-y3Lg 0^1 H>\6mS4<c46}?H_|!B!;!;; @2$iR/Z$'_ aTZ$^yݾZ@Z$r/ϑr |eyBYwdqh?FZS*ڨ 6$2Pu۳lt5ֳwDo8uOSsD7\xC2_y7IENDB`yagf-0.9.5+repack1/src/images/save.png000755 001750 001750 00000002053 12470517140 021131 0ustar00boradminboradmin000000 000000 PNG  IHDRw=sBIT|d pHYsLz ctEXtSoftwarewww.inkscape.org< tEXtTitleSave^LtEXtAuthorNastya Bekassova&tEXtDescriptionMore Air for YAGF icon set *@!tEXtSourcesymmetrica.net/~bekassova/CH)IDATHMe߹s! B"EG#RJbMVcSfD w0p#))hѢkW䔢uU1?F};zODDʷߕ}7@D=rJUGW76 ]g"z'[hQ\vU CJ}8B˼̮S h#9mW&/:o"cVf@ĆhYle%2_eì[J(P9R$umVXdZ+f>DYmq%a#3_uҀh[>5 q֧lNF!k h @R@kK&tg>q߱'::-RYIENDB`yagf-0.9.5+repack1/src/images/recblocks.png000755 001750 001750 00000002662 12470517140 022150 0ustar00boradminboradmin000000 000000 PNG  IHDR*ԠsRGB pHYs  tIME /BgiTXtCommentCreated with GIMPd.eIDATHmKl\988SۃIEU!)YQJ)e RXfS)^h,Ґ.BD\SZc{I3qؾ{9,N2"|ҧ{wJ x}.C6> 䁷9+$ow)N(RБJp?gfvrt`|k][HobvJyJߒlke^'u- T*3BGɌ`d(CiED ces%7;K~~GOb` q(>ADn4^O5pG|9P? ,J ZX%5Mvx P) 83=#bUTXI@BkAcG Wtw?39&tBDPcn[Mwwbq`g]Vٴ1u ?5ІuCG-L6/y\""L]bCTҧŧ%kRK-5Z啀XvmM57π$;R)t$=WkGh֍hXnH,-БJl+`_OO/R-Zkiכ5RH} 2==prd8KyVF#DAt=_+6'(32p`擶r3Jxj{:.\՝ghkmap0[M&ؕIT1?(7"(7Ngl/?$СCdd+d+mC)0NI_۠ݒ\~S3fbvrquJ kb<}{+/%^x9>&:yɧO=T* ZvXk  VWWH&oyk?rSgzAw_zCRTp}fu1DQ$QEѰ1ZdMaa+ιRz> ;vlgvw^RTrMcjQZFa(rabq AsD"Zk^y%v|~{9>di}})>dP9Zki*U5`% ƘF48I),..x?QVy"2闥KIENDB`yagf-0.9.5+repack1/src/images/document_open.png000755 001750 001750 00000003120 12470517140 023026 0ustar00boradminboradmin000000 000000 PNG  IHDR00WsBIT|d pHYs11(RtEXtSoftwarewww.inkscape.org<IDATxZ=lE~^l.JJAAhHT((t))?IDrKˠHN|s;x;w{s,w)>|w}Y gCG SPe "]z ) @Y?q:tŷ/_|m$(H\beeׯ ;R%zjR1~I<>r/Mu,Ɋ'N3 Y:?^Q a#<(̌@k` ÀkE W/c؝K#ڕZy/ނ^R@ p9J;n}ea<ٽɯF;PLU3sn`@C,s@pj\0&a7pX`& V43psFX`BXK4YUBBZPsU9)…B H{ VbX$T2b p>N?e7g9J8Zcl2 qSeHY Dts6qƛaDeL I(91f!hP%Žw Vu\r5:i\|^WMdDx)le5sgN,1o3Av.gs}퍗_M@H"ϔ'dx.нv%o@zsomFgC& V|Ĥ/d `=Psus&/ @ i1|B@ģD<GG6Ձ\ ՟-S!bl"lIt7tMmT@Ffeȱ}}tjПêZ:T^: y?K1TEHb%rPKhB–ne+p~,'ט+Sfq  HyEA""%д0㔑1(h.DuO"NWT$܅ָ4qNΛK'zk=hMNHB1@+@\Yd\91JsIi G>MZ"[;]U!!@_є>< y,N)E:3 m!aHb9 :E>L#&{G\)`T]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>p@yܔx,0-\.aCӥFf2U=Zmz"2HBU^EHY]u3Yccқ ^Ρf$Mb"}2`9TMmD DnR֨ `OoMqZ,3 x%k;~8֥Bƌ D$fVWFjQ 8kXդVൄ* d9Tu\&}{D1ckh6d VBO\x 89DUE;ϝ,(ȦN%ʷ-S k!tAל3uqm\raOg#Aj]m!~%? mmY0S0(KP%*`w/f@J>;'(gI|Hpg5z-$SQYҒYJNf.\Haa:2M7*-[ew^eE=Q/aHݜ}akfg5wc`kB>C[ =;־2gBH|1ooe&Rّe\pA,zWldiv8F3j3ٻk.: N9~ mm!$Lv@APr!N) g1qIf5ͦOȈa^d^iy=_;sO؏[i0}#:4:#r C*]98~ 瞸?lz k=$7gNi8aQ}qml8_Cuެ?8#|iY/$ma@TexS r82|GrdwʱsY\`-b=P{y##ό[o=+bbH+= #|+dUG|CfW?6T̚Ձ")A]JĂ3efi\i O%F`Ca[sg2f#9g: pɆy@|N*T:ѯdUʪq`)03D5O #;#Ym]Rfcn}1 N,yȤ'(j2H@L`wa {N;w݃QRˎƿmo!TUm=ph).&l o(A1JFcUg,Uہĵx g$I3rM}߀:e*Bwv><>,qZ߇&&ߚ*Q$nIENDB`yagf-0.9.5+repack1/src/images/SingleBlock.png000755 001750 001750 00000001014 12470517140 022363 0ustar00boradminboradmin000000 000000 PNG  IHDRsBIT|d pHYs itEXtSoftwarewww.inkscape.org<tEXtTitleSingle Block|tEXtAuthorNastya Bekassova&tEXtDescriptionMore Air for YAGF icon set *@!tEXtSourcesymmetrica.net/~bekassova/CH)IDAT81Ka_gr@ܠKC˨9|BS-X[Dh)E+ jC[|/Udr, U*VSU!ʹ[Lj/juuEh2ڋtϲ8oX%/f! yFV{F8g7i MU`>Q'T x8}혅fm" !'΅(If:{B+ lJpAGs-;'ȳu(Xu>.6*D=`! FJB>\Nj*}W({ A"N%*ʃ>۶}N!}:DR%Hr,,$7ŠͬKT*\.#!/кtbX[__¹o,2^\|X77NI@8Am_=qCO .^bm(|*B ]]]=ԋ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137 0ustar00boradminboradmin000000 000000 PNG  IHDRw=sBIT|d pHYs  E(tEXtSoftwarewww.inkscape.org<tEXtTitleLanguages&XtEXtAuthorNastya Bekassova&tEXtDescriptionMore Air for YAGF icon set *@!tEXtSourcesymmetrica.net/~bekassova/CH)IDATHmhuϳm6_6sdBEJjԗ C i`ԇ(?4 JV)i {V ZR6{yՇe>{y>s\9 |Ļ5_)񂬅,Ca၂`mڗ.ϫ~\`.Hh; S}@sAՆOi,+6ʷ|: .ګOI[Z / e,۝&pSc^cŢޱ)Ұ2OS~* Kj ] #9:z\g``۟3ιPDV& A"s8qkuiR^o%^ GM,If<(Z%r3|R80Vɽo.ڦ!b2cX ۩(5yWZ ND Ҵs%+بhį=;!DeCn!(RtT؄u_W7 ȫ FvqoRńze=L [PGCj' ̮L]dYץ]d<|1AٔOv>@1@:"=#Ar^@pLOu{WC}pBiO,?Tӧ{j?B0¶-)&-,(pˁuUbkYwPٖҥ#s M9,1G֢<{ghQpq^}s._M:e X_Gj}L1'hSEPt;t#fyZ)XLgrn8ABuȅ+ֺ~_'4iƦ閵M1!e;Eج?_>ҕ2DVMƲޔ]K Q|wك%BIENDB`yagf-0.9.5+repack1/src/images/savpicas.png000755 001750 001750 00000005733 12470517140 022014 0ustar00boradminboradmin000000 000000 PNG  IHDR00`nsRGB pHYs  tIME#$fiTXtCommentCreated with GIMPd.e DIDATXõY]sq{gf? $@ eHD2]RِJ1oT\<&OKޤ*+2BY&b2 ~H"swvYJ!C`\=ӗ]%Ua@8KيE$}B`4MGΏ 1w.1K%ƤN_UUU`e f^[[5?'"OqX,DY={"ϟ?/RUxPpIbQQH*XK>e@.1ӡӁB!4(FHHIl64U! C46~am7DIXED Ëa*hFPHob:*SA|TUEtD(r엲,: R#zxt_v~ 04! fXDU%c8,""HM5OWW,",LXR 5iv~%Iպwq(8dd@̊"’0CKVP G텉W8Q U!/{mR*J \~!""+g:圻r哾0 ;O .@^YvRkf_Ɲ{~P,zF0bOD0cS+*50,%)@?h?<~:_(@0A Yl: (m. 7dz*Gʇ*6$ im$Qk,=zB{X,.-/?y`_akn ",u+~#Ms,B%h,&˵[6...&{+.- c|l[UoX}GC$هi##[[a CmnWxɒl` uۘHرフj_ЕrLnoۍLQ]#N;< CHUz+lW:1Y2/*rv"O?rZdX,QT4UYQDDQFchvU~[vBD$0DD@ Qh'ʥұc==z}~c} EkqH僙EXDYT3UXR5ѽ!2"':Yg<5R@Zn'wܹ $Lz]ÆvzBjEw[X@@DT0wbǏx9fkgs~lZ^;HxB1!8N***䭾**""J%##'_{n Ç66 YLӍM9NTTPRK/P}OMNݜqRo;wW}}UcL7o:꒪톏=QnV>_ PDjO4RV08;7?8-"QNCbYD@U<\PU/~~d7G*ީɩZɕ+ea᳹ \9V\>~ԳHڝLUN֙Թ'ON{|V+׮]̆!)0}(=I{VvUD8rT#w.SDET֞9szK3pO>b9mfǂĩ:N|wE3U}2!U 3/42tܫoOO߸ycC=奥ϟ?W^[L:ZM^~ZO ºqLhoM :֛o>G=|X,ʥoΙk's.}5t׮Bs̳!AGjAΞ:9vjZOé564Bv yQQj` 5 `}~gv^|[CSS|G/WŢt%%<L=&*"CaJ\f"j_d0uahhԩOvO?`չ_^^*(9NA@;.scBD#'>9[/^ǎU{.Lff/gZׯ_U(q3|۩F`\ ggK,qfJj l-ٱo\(*?_OVɘͫ I3;iZJk߾:6G(CƜ:5"PD°$.n5٥J=66f9O~0Ri@bkkˇk5wcC F ~VzzџAiݾx/1jfJsݶ(_>ZiT;A(}0\~Za0 {,Hҵs.IowlZ-FS.//<]_qF6Au0 =e8y4($ɖZ;ϡl1zP,f{OY++.u3)+ukP$JIENDB`yagf-0.9.5+repack1/src/images/lines.png000755 001750 001750 00000002207 12470517140 021306 0ustar00boradminboradmin000000 000000 PNG  IHDRw=sBIT|d pHYsfKtEXtSoftwarewww.inkscape.org<tEXtTitleLines of TexttEXtAuthorNastya BekassovaIDATHۯsz{WvQ=hjT'a86!p%pa2\ͅx:$7$NwE)Bաa֮]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470517140 022114 0ustar00boradminboradmin000000 000000 PNG  IHDRw=sBIT|d pHYs  >tEXtSoftwarewww.inkscape.org<tEXtTitleRecognize:7tEXtAuthorNastya Bekassova&tEXtDescriptionMore Air for YAGF icon set *@!tEXtSourcesymmetrica.net/~bekassova/CH)IDATH]hU$m%qffV%,ŇD+H?J$R(m>(ݝQJTH,_ZA#m7iԶ&c6ˮi^RÔ2&_Єuw3T.h?)%+ҥ? x)9*VFzZ!K`²(SoxςŃu(8 _ \6n rFk3,m+h`('1\ϰQkF`7nOJ|'%^!_Ho4S梿9"BGE8TlE| )UrmIE$čZ ͊%oor'43Y%DdIENDB`yagf-0.9.5+repack1/src/images/batch.png000755 001750 001750 00000011114 12470517140 021252 0ustar00boradminboradmin000000 000000 PNG  IHDR00WsRGBbKGD pHYsu85tIME$/y*@tEXtCommentCreated with GIMPWIDAThՙYuomfzf44F$b(@%U*RYx N qB.yp*/%rb"Fv(Kт$iF3=K/_۽7Ӛrnu9,?_bk;>엻3֭rXq'cI\ðv񓃃5#: A >~200 VzQDh֢&N5M&>yUq]ҏ>ם~衇|*GۉJ]G1uBH:YGrV&KΞ9b>*'.i4|3Çe8fȩEYJ)jcPSEfl{N k ׬򏮹w>*͛~>S6lp繙xX^s奙+;-WZJ!RBI |~Q}G\={N24:y׮]ٝ9 lFD`߾}˖-[E1!+(!S8J"DIR cI!N4IFLLVBJ%9|ϡgr>no@;5/{WXyU+TG8NS)%QJ"@[K\א'Iqb\cl>"B# cb+@rpݷt8I$qg=^0;vz/햛2I7iZ7#_ukVҖBs;È'OfDJoYϼ.@>u]^y!9gg:rx麍s\Qy(uk X"̃O>Śg>Y V igZ +'q=q=k7A9NB7x_m,iwRm[Ny/w Byonmo޽oB@qQHzVcLݣG W_kF&ǵ!lYw֤HHӔ(IFa_F$+YkI__R{%N9s J%yE@6֚9U,UT=jZTӻUc,Q,(rIZBJ1X!Z$ BJ4Mi9H)Ic mmmc.k=WZ&'>ymLQ3Ňjh< ~cA3e¬Mf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R*'y]څsBIT|d pHYstEXtSoftwarewww.inkscape.org<tEXtTitleLines of TexttEXtAuthorNastya BekassovaIDATXŘoleǿvnkɂX#@L0***:I`DFH(  D /a 1 /4m 40dl{|ukomwm&~﾿PF!c{&դA[ z5ѐh#܃#I@Nٴ@쇟#{ mU1=(=ՑiaiU)H>G]ma)IQ)_͒H}CD# +Þ-KgXiku#")r>{Z$67"͚:1\E S@'< ,z:ЇZ$BԒDi2"rޭ7~iT^&SU=lMH YS' ԋ.V Y]UQ5O1\_(зؒm%:$-9e7~(Ǧ}8 it-)Vt+e) &b|G~ }xϱDC:JD"vH.ovMm0[ĉcƆغL /^b-{ ǽRو~=s~1z"*rK⢧EQ|gzqJ$GAU ®z/Dmmœl 9eD45!w۝U 1sE,{AK".&'i[vOPUN_g y/T#}d- *p5϶\OM,4_f_ b ~C%4vp"`~n_a!}rY]ܢ: YX4Џ_snBakB/IENDB`yagf-0.9.5+repack1/src/images/back_arrow.png000755 001750 001750 00000000605 12470517140 022306 0ustar00boradminboradmin000000 000000 PNG  IHDRasBIT|d pHYsycϔtEXtSoftwarewww.inkscape.org<IDAT8JAEϛ؇4v؈?XZX`>Yl̵%Y̺ ˻ T.g090+`1tS}@$G`pJ$J>jxUy_"oJE2Vm)E 80l;6(_@YxKƸ>s&-b) siXbyfxZ LDP6+$r(ŵ10dswQIENDB`yagf-0.9.5+repack1/src/images/yagf.png000755 001750 001750 00000023324 12470517140 021125 0ustar00boradminboradmin000000 000000 PNG  IHDR``w8sRGBbKGD pHYs ^tIME #<= IDATxyeWy[Þ|s߾oꖺ5R,!`zXI ]8S;6v'eaC0’h!jVÝs|Ξc!@Tw~UޮZZm2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2d}7_F~2îcsjE{">T}5RB~z.^f O?zf%| Uz:=V.n$8Z 足@u58}xU}FΟ-n8 = `bmIX[b38 (*,oe J(n&I/$?w|@ r4W07i,\΄qm#à6ZgWuGU=qkP.CV S|Dppj#D̍C^QIl5a} 4L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`>1R*ԍnLJQSS3ӯЊK,.,=qT#!9G@UoP\\DRC:=~Gp8<+^R/aXkߺ.|]f ч+D+L!_.tw܃/.]  xi'? |Ak׮$K%%D=eӂ޿oi<+TuLg2V֮[֬Y!sfgVvH,o_9P~l5bӮD&XA>+q#~c;F/pi\2Yɜlb=7OעR5lRw@:S"@GJ)f'-ꪥ 6`%t  t.45W;D"FJmJ'%9BC$BS2[8}h7`Db+j" VQts҃99u@nFV s3D+3|x2Wu҈q^Vݶ kGl,X% %B=:y,:h"im>F?C|~>rUT_>;Rrq=ŠU44ͮ $ y ')Ć@ utŅB2l |a=}Kmx yu-0{Y&=X81炑MwABhDԱ1TYY$\!L xL47-ue 6A(//byﻎ4 ϽwmBW{zdK˝E/ Hy.KG(C˗ՠ%KkH n AiR1::Wi!ĩԆ#7,pbaw01' G?w+\RXh:9Z())&D0;'`r:xN| aѸbRh熍kй m$N0 P&HA 4<:F5`;w7em@) 5/K7uNjj0Bkڭ_![ eϱ0n|rCM(h!t&vSu+|A10Sg*qP.~7[BC"Ka L!ch W3'F-;5@0nlOQH:2{rM+dzYA$CaGnTOUiG4qqW:Q#F>|Kf@ƍ?@Q(q) D=}nf@H1l?p:Ans ć@\vIENDB`yagf-0.9.5+repack1/src/images/Flip.png000755 001750 001750 00000003077 12470517140 021074 0ustar00boradminboradmin000000 000000 PNG  IHDRw=sBIT|d pHYs 4 4T޴tEXtSoftwarewww.inkscape.org<tEXtTitleRotate at -90pUtEXtAuthorNastya Bekassova&tEXtDescriptionMore Air for YAGF icon set *@!tEXtSourcesymmetrica.net/~bekassova/CH)IDATH[^WwZNLDS)R )+xᅘ TxᅗHibi XA&RDRhLkbѶ̤?b&x k~/﷗>}V[OÜB%`S?xGNlez{kk=|[gzZ +3+¥Au':FBp年n]ZKŇ\!clG Sʘ*Wʆ?~ٗFzkߧE$|jWFܵ9z xtt➑Q> 鵬f|z ]lcV9p71LjV}(cr@$G E% s ?xEfFު;7ZsV)J%ɺ5rԎퟨ\bZ%SHYF*gp݈`ù9*`zz1GQIFBd@O]uyy_ow!iy:_n26Шl.Ua4(Ir)aG:G|2tpn;KSUڷPl{ pke/,kawP,7d 9Vj>q؅fLqi=qbjsρ挋4lfq1F5zlΫuۢ9<ˋ֬.wm<02bWi5ZشX0 nMݚRĶ?' ovtʻۜ2+O% JƑZ'| PPCtF>ڼ3,C[g -86.IENDB`yagf-0.9.5+repack1/src/images/box.png000755 001750 001750 00000000653 12470517140 020767 0ustar00boradminboradmin000000 000000 PNG  IHDR v 9sBIT|d pHYsaDutEXtSoftwarewww.inkscape.org<(IDAT(ѯky 5 b؄2; +1{  6` a20d"X6/qaO{{89AUt16-AjsKqb?>ix%Nw TWx+׳:?wuMy7.Ίnklpw_MYFb9C0ャ~a,}'Fe_J:u19VkH q{FQbڬ f^޺qs5]5 o~(36ǁieL IENDB`yagf-0.9.5+repack1/src/images/scanner_s2.png000755 001750 001750 00000005721 12470517140 022235 0ustar00boradminboradmin000000 000000 PNG  IHDR00WsRGB pHYs  tIME ;B> cIDATh}L\?敡3SB ѪDwR)]n5i1jLpѮѺ\hZjCKZN Ey)aP+Üs㞙"Pl޻pH$|w.s'qETY ϐ#| rJB03g$ \x׳{n9s gesIEv+,VMee%:<~xc``h4JQQ=?\#F2G^Bp [l9q.IEEv@ @SS|twws) PÇ3::$f3&B. kCaZCwxKK\.g3{&nߏ$IaX8x !9sP(D0s42ˣkײqFYfM31ѣGٷoǏ… v˖-#L2<yPVVF(PTTd"N2?Gl tuuOi&EYLb\t^8@?a6LMMF_^[ە;>tKKɚ4M#344DUUf!}}}tuuqww^~eebBp~94HD<󌏏qݔֆiڵˡ䐧?7|oy)))Eww7%%%\.~?>yپ};N3˴ tttv$Ibzz.]`N9||z=NYb211lK V_,v1 !2\.8###̐O~~>vݞ7288-WZZZعs iGO/[ YI$ Q\\fCQFGG رm۶155E[[_|HJaa!vUUD"xfdsKFdGrܹ={ /lՀ4)Jڶmχ(!$Q^^t:MOOdZ,l6,IӸn|8,ccch$Ih(q u=[3ivK/7sMHa+7O>v$I" (..bٚ'!I+VgfZX,L&dYnX gL|QUYܼ|.Ѐ6_"\_~7|SZT*1|>B0}}}D"fggɬBN3v"  D"qB!gjjRغurlsbB_8 {j( &p8L4dO<'Dx"XX,=?,TnRQQ7ވe4440jLsABQ(|:߰ݹsȩS(..Fuٰ9KD"$hd2 DlHx~W\9qŢp&K`moQ7i&ARX Mp8$DYqݘL&JJJi͚5{}}}WIIb 9B?$ P<@n޿/AQ?ٳgeEQPٌ(( 7t?uͣ ,7?+LIQ(+v!ڵk!l^Wr-b׮]:MjnhsZFl@~ 6n܈를W G4~-)|x8bbFwmx&afMwUƫ&%,)5rjUZLJ1ׯKY@KvbK[aBj!"Z9C9=WV a຿YX֜DQhF IENDB`yagf-0.9.5+repack1/src/images/upscale.png000755 001750 001750 00000002062 12470517140 021627 0ustar00boradminboradmin000000 000000 PNG  IHDRw=sBIT|d pHYs 7˭tEXtSoftwarewww.inkscape.org< tEXtTitleUpscale4TtEXtAuthorNastya Bekassova&tEXtDescriptionMore Air for YAGF icon set *@!tEXtSourcesymmetrica.net/~bekassova/CH)IDATH[Ue: SL%z$"D@28(S`vqtK&%HA J=E& Iփ9gf&gL-XLI:W>'"2҄↞!fn=]}\yX@:)#NAKW;Sȝ{D ,!AWOхW` ٕi;'^U(UxST܋C-Gc}Oq1gM˷}'NC(}}DE}֨Ö8SӘS:9LE Ì8A\$ cT4=徱2sy?c8g[g)+^Sói_u^fKi^GraOOeq/72Cdd/g5j]D#(> V{F+2%R 6VژUK}EE\Wb^3;9䢲.zەMV+Ǫɒ}E77MhlRT5C MiCCPPhotoshop ICC profilexڝSwX>eVBl"#Ya@Ņ VHUĂ H(gAZU\8ܧ}zy&j9R<:OHɽH gyx~t?op.$P&W " R.TSd ly|B" I>ةآ(G$@`UR,@".Y2GvX@`B, 8C L0ҿ_pH˕͗K3w!lBa)f "#HL 8?flŢko">!N_puk[Vh]3 Z zy8@P< %b0>3o~@zq@qanvRB1n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oWaG:Pd]/@WW߼+'|Rk휌׮VLEQp]:l?Qs~((J V}^f%iʧMk/i18% #DfLr"/L.m!DB8p&J^`EQ %Gs”&+P39.(EQ*Rrt:͛oO (#R֮UKƳ /Q$8eW˲ʕ+į^% (JES_}J)Bt%|)eB{FʫgU/@n𫱀(5R%m4f% #|LxضM6U׀@,e 數IN8$xP(Dk[vݺ fkСC D m۶QWWWd2'|iR__]wŽދUz"B2DFbLOO3<=ʣ>JKK /_ѣl߾[*iºujB"!E"\pضhnn.<ロ5kPt__} G4-w]i%m9kOMMsyt]/LNQ+-4IDн:Xh44dT*E24Mfggb u4uEޮѱ1lV8۷ogͬ]9^z%4M#H r1&''1 ̵`288333466233_|:8'XF/.u!`޽qnfiokzk+;, TUEu4MCuTU%\|kJVBr`ypܴa7tcfA@ Tk׮5k~z u%s*‘#Gd2%J׫J;s p!^~e2 @JK6?߿;wK[[X6z{{9u;w#8ߏaAD"ylٲ[oټy3?06lh4(DQ裏O?Ixy'bJ&@@< pvs;v[9H0;;BcDcc#ض,TX,HQ:Z[[ijj*!۶ҥK$IQDhmm-=pчzH) S_ E$-kVxw8"Ԁ,_@qR_B#߃H-Rr̵}ű}U+\Rc (.TMꋋLp ajp])eEK)qv¶@>/ZՒZ ]׭<.mcv8^\P dj&8UBml6eYA:mbYYl03;;_/T ! :6m&`WYZZ"NXӺ˳۶8|Dىs Щfٳgth4J; B>swZ28_Zšm+ ܧE,*eYd28f&6RJR$gFFܧ~.] 0K e^NBcE, n)GW GҶ R~3jj/t#"L0 ώ;#30 d??Bλr%`lۡk?>޷A lFQJ0|ocƹ _ 릔^UUwպVU}0W~ngsK|xhP>͡_O ruN7x㱦HD\,".U_J̬Յ (p $}rY11|h +4 @)Ve`~\+7GZ^#"QJE{Vun:e CdiDv^5(y ZZlf+ & -Yr3IENDB`yagf-0.9.5+repack1/src/images/Paste.png000755 001750 001750 00000001325 12470517140 021250 0ustar00boradminboradmin000000 000000 PNG  IHDR|fusBIT|d pHYs itEXtSoftwarewww.inkscape.org< tEXtTitlePastegtEXtAuthorNastya Bekassova&tEXtDescriptionMore Air for YAGF icon set *@!tEXtSourcesymmetrica.net/~bekassova/CH)IDATHkQ[l,L#DNAFXXS/0 VUP1Eybgu1{f=6 p|K~0j4,G'T/kYnk]qA)\݌cd`kZA CޟwV ;?W!^x׺n,Rl{񽔞fHzS5tNRJmq`t RrxFm(J ۷_pnp^UaP!h7mv:M*%0@zr^9 t*EJ6ZF Ӈv F JV&  (d@FRO#x%gdz1_W+d< N2uxnIENDB`yagf-0.9.5+repack1/src/images/split.png000755 001750 001750 00000002263 12470517140 021331 0ustar00boradminboradmin000000 000000 PNG  IHDRw=sBIT|d pHYs  >tEXtSoftwarewww.inkscape.org< tEXtTitleSpli3i6tEXtAuthorNastya Bekassova&tEXtDescriptionMore Air for YAGF icon set *@!tEXtSourcesymmetrica.net/~bekassova/CH)IDATHo\U3o:k[( H % %-5@ÿ@A@B #BV@P2@'^{P8z.Sݑιg#i~ʜ' 88}{@ca[o>+[5Z9P)ۥV%;v#:nnۀ$ @bi| .F N++PtiQӥ"n+b\}0yV(uLmcB!?f{}!oq~ZVOEFN$vҷObfNkz; \~wYeQZƜYIN,Sz6;'߲קr(#j1!]֪"/A~&(r=Pyy2GoT 4ŋAx uXcxk=m *V+VE-JPtA"U i}ok$췂JnCFrBb2$=%@HN"RYltp< i+.4mNHz:]NiN"CeWIlr[k(?(0ip6mŽ\ŇN R9YAc}f!\bE\٣fF b9 C(y"4b3 faD2uL` Pn0n.M|3[!pcOkk[HIENDB`yagf-0.9.5+repack1/src/images/cut.png000755 001750 001750 00000002313 12470517140 020765 0ustar00boradminboradmin000000 000000 PNG  IHDR KsBIT|d pHYs YktEXtSoftwarewww.inkscape.org< tEXtTitleCutA2tEXtAuthorNastya Bekassova&tEXtDescriptionMore Air for YAGF icon set *@!tEXtSourcesymmetrica.net/~bekassova/CH)IDATHkUe( YFAa(Et"( *-DԨ`sƤ74*sFRv.DDt# QBTjQi3gaia]xg-3QEcFf?]z:3%ydDqEt'!XvXGgvEL+&K!6v|A12;n"O_Юc]BuV EA&]"3q:E]y6c˩%?09¿D,f{N͕#9BtM~}X>i_qԟ^n"u*̓4fW0R"Ul$;p թ}јQ{k\y}_m0*CN3>8=6?hJf=k$ޣY=8qp{ 2UvF.!vVvADbg.u%\N̎)gXTe\ARo<_(w ={`*`*N'~x% l?Cy<)3Ew%?``isQl [~y8+2n9d^EIC0b*a>M;vJQ)r>BL#׵f<}w b*w)fvR6n#[3}Yۂ-+>dvA g.Iͬާ-$c˽{ۙ¨9l+lX14{29"z*ҳWDi'vl  ů7`G:gd.egʿG@n%S&BHfGfqHz$Fb ZEmߗ}cUVܺG` Q`dfwO#gW 3}iIENDB`yagf-0.9.5+repack1/src/images/Rotateat90.png000755 001750 001750 00000002442 12470517140 022131 0ustar00boradminboradmin000000 000000 PNG  IHDRw=sBIT|d pHYs #JqtEXtSoftwarewww.inkscape.org<tEXtTitleRotate at -90pUtEXtAuthorNastya Bekassova&tEXtDescriptionMore Air for YAGF icon set *@!tEXtSourcesymmetrica.net/~bekassova/CH)IDATHU]Ve~f9-Yɶn!"OQ[MRF7kXJ)M EYPQ]Da!\xstH^gyy+رmBC}j:@;~;~ KZb %d==q/C? F F,"ӯ;LlδO`d6nd4U3,FO-cJeJ6ZjfJHd}z ٱP+홼B ONʲw_{/o.5 q>kZ>ۥ/kK_ߡUq{Mߙ`j~9Ybŵuҭ!lQt  Rw wa:46g"vD7^nm&%"3ImYg̈́RHֵE-9@0jPu&϶9,-̠$&55jy5n5HA 9kv[Uȱ8j$-SdhhYWR(iB04r,nLhO`f 2/ڈirME+h4<~ݿ=uJG\ ϻ[W]ܰe͹.ZW K-TDr-ںgE靠󫎬yZ}8^ *c \O .#g-ͳzymںkTV*q3XE;jZꂁE?+æR62|ul9hMqYV=f;{d/س w\ʤ/A\ Bfde̵slF/lb*yU?EYE3W}V#%NM5um+YOuOr9jj#C\⌤w-M[n[X726js=MH^Qf$է^Xj}xnsKY00X`LL `*` So]-/s d?p4)XIENDB`yagf-0.9.5+repack1/src/images/resize.png000755 001750 001750 00000001307 12470517140 021475 0ustar00boradminboradmin000000 000000 PNG  IHDRngAMA abKGD̿ pHYsaa0UtIME#2HIDAT(ύ_HSq޻߽sM6D҇0ODEYAFXRY+!H`cCe L%SktWszIiy9p>{8[*^oq^ ]ޞaЖkO)L&ϯvxEzq [ Θ!Ɩd4>_n1;>YM`^f! 3M-W<0sПt5/Ho'3cq4aac8*gaLHIMѥ֫1JEKDXGbua "9qkr %ɐ[Cbnݠ*2U.1T9ַ+'4+oIAi ADwt::D]:&Jh?ەvI6h 9¢|m֓qGIyH-?\OeyXRNlκ.gF;iSGzjY,KuEimP>3;3%/+=Je|sƽ:\Zp(v "p-J*>{9'":0TIENDB`yagf-0.9.5+repack1/src/images/application_pdf.png000755 001750 001750 00000020246 12470517140 023333 0ustar00boradminboradmin000000 000000 PNG  IHDR>atIME #3I~$bKGD HIDATx tǫXE+"PPQHbrCmjUb= V+nmhʎ"&[YBCIH'aw 7maB@޼{ofW+l)ʣQKj:Ւf5ZB83F%XpIpi-8H<: (vױcha:qDܿF>ݘ/2y46"K!X؉PEEbMEPRM%ʨLU9 iV0UTY&|GG>P~WYU*j[Uo&?Єc7j_uAiw .mi?FW<,HK%x)@@nG7>~Kp!)a}$@=xs z {Pn #MD BӒhFOT g$x[ ۋGc[`P o(7֌EO>IӧS0+Kַq#m=fkG3/87QKt OT Ȳw@!ק>422,C=TMK9jݚFU.CWqv^B,kGM܎eU?-xU!>K{O[8*{-AE&}qVe@1# Њ?!|JF_k-ؑ^pXx5KW%7Tep#<.!@B>uxG?"^oV1^J${qa[mB!@GOMoUdμZީ[Je={l7kUiʣ5c~s._^uہW31ch@M7>=vQ @l0Q*s1Cɻߟ|*qoUWpݿKie˴Ўk ^I޴q!b{nl Ћ ߈lD;ޛq7Y;8pz} `zfom(/)9Y8%H3{.-Coy7^o,'LoRu{9cM a> FÇm|hY/XY~V{YF-eX*ް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ǚ^RE/Јvތ8:@.h͡=pso!$ _pF-Y{:۞}zf~!sR!IENDB`yagf-0.9.5+repack1/src/images/disc.png000755 001750 001750 00000002732 12470517140 021121 0ustar00boradminboradmin000000 000000 PNG  IHDRw=sBIT|d pHYsXbtEXtSoftwarewww.inkscape.org< tEXtTitleDisc yotEXtAuthorNastya BekassovaIDATHu{lTUsvneAB(&&`EA @Z,/5 DPQР@P־nq*&3}̜;'zB1@z`/-,a5n\YAg|!ԂA/hHկW3i10լ>"k&Vnm`9 Qԫ vK+{*50ԓ@οtDL]f @ꌀƑq!:AdCt`i(sn"`ݥ:ꌳK3%BGͪNA, Ru=TKjT9BE RP +N^1 cHݢՋ]%G+R5Ri"[FۯZr0ykJQˢo~Nk8DU1 O5XڸVuN'[cKlዃ_J|^d\&h5Nd}5ݟX,P፧y3vزFcYD C|;BI cVim#<ѧ_w`]_3#oge jwLn By[Le~9{@-+hx`= }{d[?T+u`t k59,N <t=./Rip`^mNό \ngh\:?8A.إ`;ޖ4ձ@o!]]FXNLBK?.Ϡ(8D@:@=b8Ki)) v̍)=^gH7AfC8ojc4DZzrF뢫ɓ7x D*@~c "+3qLmo|S{mSc{/&N(Ao~j%߂#63~uuߚnu[ r;zA>KśO.Fy;tXhDX:_}{ +GU1UUIU6eKuf%V*hH)/L!yޑlTg4'ޗ;;e9}*5Aun{"hR &IܬZpN1Յ%J*X15'T8H>Џ@w## @x*=<jCatIME #5bKGD.IDATxye]9{{W־uu[Kb0h9Ƃ fBt 4"Lƒ5&<<̀ #H@4n-VW/teU{97s߽****^ĭw-޻-r5}Szus[I 0Z!PxL}KnpoVM2 y['>^90\m`*(:noj D9`& DrKظce]N`LDw\w(~z0Lȿ cV$FaEQP);c掃ooLt^_ ak'xAb UJzAz}}a$QtrdǚdUV~#Kyn?>max뮠. R#Fa Aj~pZiBDڊ,S(%h-(Fu@690J5K S/W;xe`7bR;^}8~|;váp<l;/Pzp>ҡVZm ՞%Iti!g@%DGIwj4,Og>ðe-krx=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li&q }]e]1b ob4C׫Q" 4oᖂhB\h5 IENDB`yagf-0.9.5+repack1/src/images/sand_clock.png000755 001750 001750 00000003207 12470517140 022275 0ustar00boradminboradmin000000 000000 PNG  IHDR$@resBIT|d pHYs }eYtEXtSoftwarewww.inkscape.org<tEXtTitleSand ClocksTtEXtAuthorAnastasiya BekassovarIDATh]lUv[0c D>tDEW&į& !"DM !U3rA F`(dc{sk>/9H#)R;[DS@^3 t$nLR )WHt/izGA$쉣wM7?eIht/_9t5ȶm5gʘNIENDB`yagf-0.9.5+repack1/src/images/Settings.png000755 001750 001750 00000003132 12470517140 021772 0ustar00boradminboradmin000000 000000 PNG  IHDRw=sBIT|d pHYs  >tEXtSoftwarewww.inkscape.org<tEXtTitleSettingstEXtAuthorNastya Bekassova&tEXtDescriptionMore Air for YAGF icon set *@!tEXtSourcesymmetrica.net/~bekassova/CH);IDATH_Uk} 3p)@82mБV1mmHPb$x1 iIˈc/*RKPEk+B)u) sw=g/4 3 +ُ߷ַڢ\*DzB t}[.5d %~J/B Aݺ>ՍOt; lLvI~9ծOP"] 2$0X_\:L 0*vcCIIՍNHU` ­`|ĺ%)hRp$&3&bMcɭCZ<l WT/")U]Ź76Fu#kGVgeDEUӋj '⬼f>Oj>n'BԸ02jٟ\֘ؐZ#i"M!~lbNG\{3JN~$`:(% {\$UY~?5 :fA^kX:D}P kTrrzҲ_JFb]2"U7e7C1VKAea壡5P"l1־ԶZ<ʕqe^Ѭ#hf3K4.(cGkzFuÏg"@-,j_o;+(8)4L{RC\\KL>|23g);+IdI"UnXI1Nh6Vԅjj5J|L^!uXRg5 u< y?,?$QYIcXqX"sNHjzұu$t8?/v @-mo-HG[6q-`ջVjmHhc%a1OD.&MCnbrgHQeLԪCm]U>sq,Ă9QO9/UMC/OvV[~TwS7Nn9/E7jΪ/D} Hk^Nj|#O_: ;Ki|dGeT7%Z>o&#FE`ur 9I;(](d)l4fzUclHk#2o/d)Y&XC&cR04&eY'uQA!Wj?@]ocQARgF£2k|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E<@Xkyux\s޻Od =Mʪ=EEKw jHƟ6= 'R#ƀ) MCB^u"v5ww0ew^٠v KLmABD}5ES1ȩ` ^t0x"Ivl^+~>{wսks ï kWxfӳ(I("YGZD xn;}NvC>$)!lF؆b߮D}D;b!+?4gT2,I*BR1ň a!t6Qȣ9th "x".Y3FJBbHe 4UPU=oiR.{r̚(6]L)PSJ:+eea(!t+ݮƑX?$,Γv,D!L!a(!mݻrWt.{Fଜɮf5, PHIEHfծ7W/#ec.4Z&5n L(a$D^۳GdټoΐZw LǒW*4k[џ'y_ S :x׏?']^a9ng:X<}-yyvIENDB`yagf-0.9.5+repack1/src/images/RemoveBlock.png000755 001750 001750 00000002644 12470517140 022411 0ustar00boradminboradmin000000 000000 PNG  IHDRw=sBIT|d pHYs UTZBtEXtSoftwarewww.inkscape.org<tEXtTitleRemove BlockP6PtEXtAuthorNastya Bekassova&tEXtDescriptionMore Air for YAGF icon set *@!tEXtSourcesymmetrica.net/~bekassova/CH)IDATHYlTeޙNk (KQ@綬IAQPYڦhT kS|%&`)܅H KK X:PL|/9sw*Q&OaT){52xVhDJvjfy+^:A$*I%C]t?I(we#VQZ& Qn@G}d 䝰Jw~@ ;׈~VFU40x4X8\&zóm߳1oiG@sF!84%s bmܮ3I(|\TjwtjHlEf AܪvX9DC^ .! d-]o34x(\سoq"pTq=,/[|?8XӦժpԆ->'>dQ$˴ nj>ec=͚Ň{G/.YϘy}F|&Ҽki~'V1ߖ^jGzX_Wj"f^3m SCk M^7P}Ux&] -h8k@X9ՂU1)d<de@ظ`.K@ud0,PHC8VR^.sͫ0rVwwbED-Bz%PSKhϣڀT;dWdxyy tm@m;A#oFZ@tpa+Ј2? փTd-;hFDMDy\ ^ܼ1/x${LuIwBݦeGRq/p .WQv]N13@Z ]{$+=ZIYo# {^;~3.TurIENDB`yagf-0.9.5+repack1/src/images/notinst.png000755 001750 001750 00000001032 12470517140 021665 0ustar00boradminboradmin000000 000000 PNG  IHDRasBIT|d pHYsZtEXtSoftw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v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3-bKGD pHYs  tIME "7)"IDAThYoW}띵7$A'I(/HR%R> !TE @G}A O!TH( ">I*Ƶ;;x8̜ݍw73svgwbf<̛C= x.fJǦwA @ qf3#v{:Woffx) οWnxObaaa<+%+Okx\(W0sLz%e+-<8}ts71y{iګ:4#$I iE CʄfF{R AC 8| [o;rucd/R 23R$P\Au-?P 53#Bxol\}֭;;]:q Ҹ""!;YD  }LA !9A!yP]^^g̃m0Z̠tmnI$1S t^WfV . !@ٴYP=D}$%°BJ1B/MpQDw'L,u1UF0 "z}OHz)7Ue :g2?X?AnqVh+*E(rd߰3 %} f1 & RR7AGփ/=Ƃ  Y7PL0]@\ن'D9$ C48s&|{PyTReS|5B)d:{0)v {})poWR'MYBۥǎ;, }—^AJ7T<5ٳOϞwT*Bf򺰷 o+_I IK~Eҧ-wVe֔Y3{S&n(0s(ڣ wRxD `@ {8)߬D ylm5L0 nW@0,@ Z_qPa6k7qccCO?4O՗4R<D7qJ&ŋyǹTb-ߺy/.[*^ERsm"򕔊wj;N~wHlu-`Wf4o(`1IENDB`yagf-0.9.5+repack1/src/images/save_all.png000755 001750 001750 00000005001 12470517140 021755 0ustar00boradminboradmin000000 000000 PNG  IHDR00WsBIT|d pHYs11(RtEXtSoftwarewww.inkscape.org< ~IDAThZKG{fzfM|mc;G$L7@DbCVRXbD,YŠ   #,;{3w^]uaQ]Տ_ %Q5]w_k%"վڋ#Է#Ԅ) &p8=9y^DZ!so~ , Mvvʇ JT21Vakxp _{%\y3F,G1qU@q'1j`Lb}iY3z'ź@>޲(λOx,HHV+WklW\D+$na[+4`oY*׺[jILӐ,V.QVbQхB$ٝER b V *Sa[(M*c,>fiO,EHB|@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RҐf' u'r\W#wv%ؓtמ*TL}&"dD'+h[8+Kj؃bO,~Kԧ7Ɋ5)eRY7go=;,p!l"Q /ӯra; i"f?NQkEǠ( ލx'۴,dg:;mm0lقbOMN!U_YؒcEr? $8 2Y0`IXi?ml xqjd+qf%<\$ T#)pEA%J/mT,-X *eNҐYS4?3|^< GQ aAԟ'ሏWÁ{"`740c 2}I>{q뾔nP@92<M򗓶D: 0d7WcHX;]N0iC8_f}}zed =j!0r%60&}73"-$x Ǒ9.E38l#F%mUC3a'l#` 0{]'f. k̩_֙Ysd+B2HͅBkk^n.+^E%la}IG7 \xkپړܮ*Ti~oj}Aڃo22H#7;32f -H8dedDɋFҐO,A(Pi"ΘL$H%!BIENDB`yagf-0.9.5+repack1/src/images/Rotatem90.png000755 001750 001750 00000002736 12470517140 021767 0ustar00boradminboradmin000000 000000 PNG  IHDRw=sBIT|d pHYs j jFQtEXtSoftwarewww.inkscape.org<tEXtTitleRotate at -90pUtEXtAuthorNastya Bekassova&tEXtDescriptionMore Air for YAGF icon set *@!tEXtSourcesymmetrica.net/~bekassova/CH)IDATH݋^gk7{O&3cұi !RҐ8WEPL?R*%zmJ~@TKB/RjmM'ɼFMI{^k>MyETDDLU*F/oSN>Eڳџ]pCtd ?[_=Oc'ycjn=Oukkk|#7u"fN*9÷{Fef9|w] Iz;ucxgkqV13f }Y}w X8i ɹ}Z۷o~7+ /2</- ^P̢zn *.":<4a{YZٔG*¤Y$@Nj5Y_a^Z5uwI0 B7@uȉU볳tA ,`HȞҮ PIkdžRŕ]4KCI&t"i  -FԦo\Z ub.(T  d$d試Zf@FъxG7PcѤ1A$ ZB-@h X8y ֆCגͭɖ,sl@ EG:, ]ָ|@0YٛX_hAX*v8l)IXB&sòs;~ &1wէ;N?Ӌ_om\\?[^ K8`a‰ή;c~濮}N9닋_ywȃ7=Xmhow]tA2͂t2I CtlQ|],?? +@gǧdbM;%,-3>p}y<܏c0˝?Y6R#w;5 ޯ I,+I`*|@^HO̪$XLAIƫܙl^}`sxF' `2+*p!1^TcA b 8mRl8 K1KX(/Sȗl3,NH c;NR3&*`9P 83A U jM[䥮weyqfX-WV @l4; {;=6/u  zofanz:OxPMPCat?w@SRodE) 1۲/`Ahz :f\HG'+>=qz,vBE,ڃp"? ^ku﹓!>IApcfwj)>B.Qp*AU]L ̃z29C~cH|j W^IAY-IENDB`yagf-0.9.5+repack1/src/images/RemoveBlocks.png000755 001750 001750 00000003243 12470517140 022570 0ustar00boradminboradmin000000 000000 PNG  IHDRw=sBIT|d pHYs UTZBtEXtSoftwarewww.inkscape.org<tEXtTitleRemove Blocksp5ctEXtAuthorNastya Bekassova&tEXtDescriptionMore Air for YAGF icon set *@!tEXtSourcesymmetrica.net/~bekassova/CH)IDATHm}PTe IⰋ4E3EӤNXEj]jJ4iʹrfJMLv7rC{cYX=<9+Hm yN. ]ȧs2aό~ȟVբvH~HE"cE6rCr!(jODGbt>]L%L7F,T-*7x5~8?.u [F\A Vf?8oM^*E}[ujYojQ>G8S=e 0 {n9Oo0R0_n3 Y wv.(1BKl=I`^5 '0f74bT5B6տU`od*e=nT&Bc;n7>dW!Z>ESXFWR$=ZŽ4IMka)Pd7*,^=d\#hM@ǭ$vE͐ *,*oP{q$m-冪 ^7xH4@}k `} 9--[b#ԻQj[C % G{I..l#5f7:"vLAmU']PcW")~g ZRM>CiaLƌ*qGוZ)W$~K@S %xwxo3.Xj?";W7qX qvm7ͥj+d=HfERɝKtЗĽ47G5ɘyawQ˃uŵ>?2Lx6v0*W2O5;dt&0˷Qrq#QWX"cnVy8"ŵ|H:h%KkELG u7W2T-Zz.H>vzc62wK+cH%l9q/=: XkY8FGg;{<:f`t{**QsݜIENDB`yagf-0.9.5+repack1/src/SkewAnalysis.h000755 001750 001750 00000002357 13631520722 021015 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #ifndef SKEWANALYSIS_H #define SKEWANALYSIS_H #include "ycommon.h" class QPixmap; class SkewAnalysis { public: SkewAnalysis(QPointList *pointList, int width, int height); ~SkewAnalysis(); signed int getSkew(); double getPhi(); QPixmap drawTriangle(QPixmap &pm); private: //int bin[360][2000]; double getRightPhi(); double getLeftPhi(); QPointList *pointList; int m_height; int m_width; double phi; QPoint *p1; QPoint *p2; }; #endif yagf-0.9.5+repack1/src/saveprojectdialog.cpp000755 001750 001750 00000016765 13631520722 022450 0ustar00boradminboradmin000000 000000 /* 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. */ #include "saveprojectdialog.h" #include "ui_saveprojectdialog.h" #include "projectfiles.h" #include "fileobjectitem.h" #include #include #include const int itemType = 0; const int itemTypeFolder = 1; const int itemTypeEmptyFolder = 2; const int itemTypeProject = 3; const int itemDisplayName = 1; const int itemFullName = 2; SaveProjectDialog::SaveProjectDialog(const QString &dir, QWidget *parent) : QDialog(parent), ui(new Ui::SaveProjectDialog), pf(new ProjectFiles(dir)), fsw(new QFileSystemWatcher(QStringList(dir))) { ui->setupUi(this); connect(ui->listWidget, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(onDoubleClicked(QModelIndex))); connect(ui->listWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(onClicked(QModelIndex))); connect(fsw, SIGNAL(directoryChanged(QString)), this, SLOT(directoryChanged(QString)), Qt::QueuedConnection); ui->lineEdit->setText(dir); } SaveProjectDialog::~SaveProjectDialog() { delete fsw; delete pf; delete ui; } QString SaveProjectDialog::projectPath() { if (ppath != "") { if (!ppath.startsWith("/")) ppath = pf->currentDir() + ppath; if (!ppath.endsWith("/")) ppath = ppath + "/"; } return ppath; } QString SaveProjectDialog::upDir() { return pf->upDir(ppath); } void SaveProjectDialog::onDoubleClicked(const QModelIndex &index) { gbList.append(pf->currentDir()); FileObjectItem * item = (FileObjectItem *) ui->listWidget->item(index.row()); if (item) { if (item->getItemType() == FileObjectItem::Project) { emit projectClicked(item->getPath(), item->getShortName()); return; } if ((item->getItemType() == FileObjectItem::EmptyDirectory)|(item->getItemType() == FileObjectItem::Directory)) delete fsw; pf->cd(item->getPath()); fillList(); ui->lineEdit->setText(""); ui->lineEdit->setStyleSheet("color: rgb(0, 0, 0)"); ui->lineEdit->setToolTip(trUtf8("Add project name")); ppath = ""; fsw = new QFileSystemWatcher(QStringList(pf->currentDir())); connect(fsw, SIGNAL(directoryChanged(QString)), this, SLOT(directoryChanged(QString)), Qt::QueuedConnection); } } void SaveProjectDialog::onClicked(const QModelIndex &index) { ui->lineEdit->setText(""); ui->lineEdit->setStyleSheet(""); ppath =""; FileObjectItem * item = (FileObjectItem *) ui->listWidget->item(index.row()); if (!item) return; if (item->getItemType() == FileObjectItem::Project) { emit projectClicked(item->getPath(), item->getShortName()); return; } if (pf->canProjectBeSavedToDir(item->getPath())) { ui->lineEdit->setStyleSheet("color: rgb(0, 0, 200)"); ui->lineEdit->setText(item->getPath()); ui->lineEdit->setStyleSheet(""); ui->lineEdit->setToolTip(trUtf8("Save project to this folder?")); ppath = item->getPath(); } else { ui->lineEdit->setStyleSheet(""); if (!item->getPath().endsWith("/")) ui->lineEdit->setText(item->getPath() + "/"); else ui->lineEdit->setText(item->getPath()); //ui->lineEdit->setStyleSheet("color: rgb(255, 255, 255)"); ui->lineEdit->setToolTip(trUtf8("Add project name")); } } void SaveProjectDialog::showEvent(QShowEvent *event) { event->accept(); fillList(); QDialog::showEvent(event); } void SaveProjectDialog::onLineEditTextChanged(QLineEdit *le, const QString &arg1) { if (pf->pathExists(arg1)) { if(pf->canProjectBeSavedToDir(arg1)) { le->setStyleSheet(""); ppath = arg1; } else { le->setStyleSheet("color: rgb(200, 0, 0)"); ppath = ""; } } else { if (pf->canCdToUpper(arg1)) { le->setStyleSheet(""); ppath = arg1; } else { le->setStyleSheet("color: rgb(200, 0, 0)"); ppath = ""; } } } void SaveProjectDialog::cd(const QString &path) { if (pf->canCdTo(path)) { delete fsw; gbList.append(pf->currentDir()); pf->cd(path); fillList(); fsw = new QFileSystemWatcher(QStringList(pf->currentDir())); connect(fsw, SIGNAL(directoryChanged(QString)), this, SLOT(directoryChanged(QString)), Qt::QueuedConnection); } } bool SaveProjectDialog::isProjectDir(const QString &path) { return pf->isProjectDir(path); } QString SaveProjectDialog::currentPath() { return pf->currentDir(); } QLineEdit *SaveProjectDialog::lineEdit() { return ui->lineEdit; } void SaveProjectDialog::accept() { if (ui->lineEdit->text() != "") if (pf->canCdTo(ui->lineEdit->text())) { if (pf->isProjectDir(ui->lineEdit->text())) return; delete fsw; gbList.append(pf->currentDir()); pf->cd(ui->lineEdit->text()); ui->lineEdit->setText(""); fillList(); fsw = new QFileSystemWatcher(QStringList(pf->currentDir())); connect(fsw, SIGNAL(directoryChanged(QString)), this, SLOT(directoryChanged(QString)), Qt::QueuedConnection); return; } if (ppath == "") return; QDialog::accept(); } void SaveProjectDialog::fillList() { QStringList directories = pf->directories(); if (directories.count() > 1) { directories.removeAt(0); directories.removeAt(0); } QStringList projects = pf->projects(); directories.sort(); projects.sort(); ui->listWidget->clear(); foreach (QString s, directories) { FileObjectItem * item = new FileObjectItem(pf->isDirEmpty(s) ? FileObjectItem::EmptyDirectory : FileObjectItem::Directory, s, ui->listWidget); ui->listWidget->addItem(item); } foreach (QString s, projects) { FileObjectItem * item = new FileObjectItem(FileObjectItem::Project, s); ui->listWidget->addItem(item); } } void SaveProjectDialog::goUp() { delete fsw; gbList.append(pf->currentDir()); pf->cd(pf->upDir(pf->currentDir())); fillList(); fsw = new QFileSystemWatcher(QStringList(pf->currentDir())); connect(fsw, SIGNAL(directoryChanged(QString)), this, SLOT(directoryChanged(QString)), Qt::QueuedConnection); } void SaveProjectDialog::reject() { ppath = ""; QDialog::reject(); } void SaveProjectDialog::goBackwards() { if (!gbList.isEmpty()) { delete fsw; pf->cd(gbList.last()); gbList.removeLast(); fillList(); fsw = new QFileSystemWatcher(QStringList(pf->currentDir())); connect(fsw, SIGNAL(directoryChanged(QString)), this, SLOT(directoryChanged(QString)), Qt::QueuedConnection); } } void SaveProjectDialog::lineEditTextChanged(const QString &arg1) { onLineEditTextChanged(ui->lineEdit, arg1); } void SaveProjectDialog::directoryChanged(const QString s) { pf->cd(pf->currentDir()); fillList(); } yagf-0.9.5+repack1/src/proginfowindow.cpp000755 001750 001750 00000000363 13631520722 022001 0ustar00boradminboradmin000000 000000 #include "proginfowindow.h" #include "ui_proginfowindow.h" ProgInfoWindow::ProgInfoWindow(QWidget *parent) : QDialog(parent), ui(new Ui::ProgInfoWindow) { ui->setupUi(this); } ProgInfoWindow::~ProgInfoWindow() { delete ui; } yagf-0.9.5+repack1/src/extprocessdialog.h000755 001750 001750 00000002307 13631520722 021752 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2014 Andrei Borovsky 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 . */ #ifndef EXTPROCESSDIALOG_H #define EXTPROCESSDIALOG_H #include namespace Ui { class ExtProcessDialog; } class ExtProcessDialog : public QDialog { Q_OBJECT public: explicit ExtProcessDialog(QWidget *parent = 0); ~ExtProcessDialog(); void hideButton(); public slots: void hide(); private slots: void on_pushButton_clicked(); private: Ui::ExtProcessDialog *ui; }; #endif // EXTPROCESSDIALOG_H yagf-0.9.5+repack1/src/utils.h000755 001750 001750 00000002722 13631520722 017534 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform OCR graphical front-end Copyright (C) 2009 Andrei Borovsky 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 . */ #ifndef UTILS_H #define UTILS_H #include typedef struct _Rect { qint32 x1, x2, y1, y2; int dotCount; int label; } Rect; class QString; class QWidget; QString extractFileName(const QString &path); QString extractFilePath(const QString &path); QString extractDigits(const QString &fn); bool findProgram(const QString &name); void styledWarningMessage(QWidget *parent, const QString &text); void styledInfoMessage(QWidget *parent, const QString &text); void styledCriticalMessage(QWidget *parent, const QString &text); void qSleep(int msecs); void clearTmpFiles(); inline bool _contains(qreal x1, qreal x2, qreal xc) { return ((xc >= x1) && (xc <= x2)) || ((xc <= x1) && (xc >= x2)); } #endif yagf-0.9.5+repack1/src/qxtunixsignalcatcher.cpp000755 001750 001750 00000005047 13631520722 023202 0ustar00boradminboradmin000000 000000 /* 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. */ #include "qxtunixsignalcatcher.h" #include "qxtunixscinternal.h" #include #include #include QXtUnixSignalCatcher *QXtUnixSignalCatcher::sc = NULL; QMutex *QXtUnixSignalCatcher::mutex = NULL; QXtUnixSignalCatcher::QXtUnixSignalCatcher(QObject *parent) : QObject(parent) { mutex = new QMutex(); sci = new QXtUnixSignalCatcherInternal(0); connect(sci, SIGNAL(unixSignalInternal(int)), this, SLOT(doEmit(int)), Qt::QueuedConnection); sigset_t newset; sigemptyset(&newset); sigaddset(&newset, SIGHUP); sigaddset(&newset, SIGTERM); sigaddset(&newset, SIGINT); sigaddset(&newset, SIGUSR1); sigaddset(&newset, SIGUSR2); sigprocmask(SIG_UNBLOCK, &newset, 0); } QXtUnixSignalCatcher::QXtUnixSignalCatcher() : QObject(0) { } QXtUnixSignalCatcher::QXtUnixSignalCatcher(QXtUnixSignalCatcher &) : QObject(0) { } QXtUnixSignalCatcher::~QXtUnixSignalCatcher() { } void QXtUnixSignalCatcher::signalHandler(int sig_num) { mutex->lock(); sc->emitSignal(sig_num); mutex->unlock(); } void QXtUnixSignalCatcher::emitSignal(int sig_num) { sci->emitSignal(sig_num); } bool QXtUnixSignalCatcher::connectUnixSignalInternal(int sig_num) { struct sigaction sa; memset(&sa, 0, sizeof(struct sigaction)); sa.sa_handler = signalHandler; return (sigaction(sig_num, &sa, 0) == 0); } bool QXtUnixSignalCatcher::connectUnixSignal(int sig_num) { catcher(); return sc->connectUnixSignalInternal(sig_num); } void QXtUnixSignalCatcher::disconnectUnixSugnals() { sigset_t newset; sigemptyset(&newset); sigaddset(&newset, SIGHUP); sigaddset(&newset, SIGTERM); sigaddset(&newset, SIGINT); sigaddset(&newset, SIGUSR1); sigaddset(&newset, SIGUSR2); sigprocmask(SIG_BLOCK, &newset, 0); delete sci; sci = NULL; delete mutex; mutex = NULL; } void QXtUnixSignalCatcher::doEmit(int sig_num) { emit unixSignal(sig_num); } QXtUnixSignalCatcher *QXtUnixSignalCatcher::catcher() { if (!sc) sc = new QXtUnixSignalCatcher(0); return sc; } yagf-0.9.5+repack1/src/saveprojectdialog.h000755 001750 001750 00000003424 13631520722 022101 0ustar00boradminboradmin000000 000000 /* 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. */ #ifndef SAVEPROJECTDIALOG_H #define SAVEPROJECTDIALOG_H #include #include #include namespace Ui { class SaveProjectDialog; } class ProjectFiles; class QShowEvent; class QFileSystemWatcher; class QLineEdit; class SaveProjectDialog : public QDialog { Q_OBJECT public: explicit SaveProjectDialog(const QString &dir, QWidget *parent = 0); ~SaveProjectDialog(); QString projectPath(); QString upDir(); signals: void projectClicked(const QString &path, const QString &name); private slots: void onDoubleClicked( const QModelIndex & index ); void onClicked( const QModelIndex & index ); void goBackwards(); void goUp(); void lineEditTextChanged(const QString &arg1); void directoryChanged(const QString s); void reject(); void accept(); protected: void showEvent ( QShowEvent * event ); virtual void onLineEditTextChanged(QLineEdit * le, const QString &arg1); void cd(const QString &path); bool isProjectDir(const QString &path); QString currentPath(); QLineEdit * lineEdit(); private: Ui::SaveProjectDialog *ui; ProjectFiles * pf; QFileSystemWatcher * fsw; QString ppath; QStringList gbList; private: void fillList(); }; #endif // SAVEPROJECTDIALOG_H yagf-0.9.5+repack1/src/pdf2ppt.h000755 001750 001750 00000001753 13631520722 017756 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2010 Andrei Borovsky 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 . */ #ifndef PDF2PPT_H #define PDF2PPT_H #include "pdfextractor.h" #include class PDF2PPT : public PDFExtractor { public: PDF2PPT(); virtual QStringList makeCommandString(); }; #endif // PDF2PPT_H yagf-0.9.5+repack1/src/sidebar.h000755 001750 001750 00000003170 13631520722 020003 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2010 Andrei Borovsky 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 . */ #ifndef SIDEBAR_H #define SIDEBAR_H #include class QSnippet; class SideBar : public QListWidget { Q_OBJECT public: explicit SideBar(QWidget *parent = 0); void addItem ( QSnippet *item ); void clearBlocks(); void select(const QString &name); void selectFirstFile(); signals: void pageSelected(int id); void filesDropped(QStringList); void fileRemoved(int id); private slots: void itemActive( QListWidgetItem *item, QListWidgetItem *item2 ); protected: QStringList mimeTypes () const; Qt::DropActions supportedDropActions () const; bool dropMimeData(int index, const QMimeData *data, Qt::DropAction action); void startDrag(Qt::DropActions supportedActions); private: QSnippet *getItemByName(const QString &name); QSnippet *current; bool lock; bool dragging; }; #endif // SIDEBAR_H yagf-0.9.5+repack1/src/ghostscr.h000755 001750 001750 00000001757 13631520722 020237 0ustar00boradminboradmin000000 000000 /* YAGF - cuneiform and tesseract OCR graphical front-ends Copyright (C) 2009-2011 Andrei Borovsky 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 . */ #ifndef GHOSTSCR_H #define GHOSTSCR_H #include "pdfextractor.h" #include "QStringList" class GhostScr : public PDFExtractor { public: GhostScr(); virtual QStringList makeCommandString(); }; #endif // PDF2PPT_H yagf-0.9.5+repack1/YAGF.desktop000755 001750 001750 00000001532 12470517140 017553 0ustar00boradminboradmin000000 000000 [Desktop Entry] Type=Application Categories=Qt;Office;OCR; Exec=yagf %F Icon=yagf Terminal=false StartupNotify=true MimeType=image/png;image/jpeg;image/bmp;image/tiff;image/gif;image/x-portable-pixmap;image/x-portable-graymap;image/x-portable-bitmap; Name=YAGF Name[ru]=YAGF Name[lt]=YAGF Name[pl]=YAGF Name[de]=YAGF GenericName=OCR text recognition GenericName[ru]=Распознавание текста GenericName[lt]=ENTER YOUR TRANSLATION HERE GenericName[pl]=ENTER YOUR TRANSLATION HERE GenericName[de]=OCR Texterkennung Comment=Graphical frontend for Cuneiform and Tesseract Comment[ru]=Графическая оболочка для Cuneiform и Tesseract Comment[lt]=Grafinė teksto atpažinimo programos Cuneiform sąsaja Comment[pl]=Grafinė teksto atpažinimo programos Cuneiform sąsaja Comment[de]=Graphische Benutzeroberfläche zu Cuneiform yagf-0.9.5+repack1/README000755 001750 001750 00000000466 12470517140 016317 0ustar00boradminboradmin000000 000000 For more information and system requirements see DESCRIPTION file. This is a beta version so many things are not yet implemented as they are supposed to. The main things to do are - adding more image prepocessing features - adding packet recognition Contributors are welcome. Contact me via anb@symmetrica.net.yagf-0.9.5+repack1/CMakeLists.txt000755 001750 001750 00000013460 12470517140 020175 0ustar00boradminboradmin000000 000000 project(yagf C CXX) cmake_minimum_required(VERSION 2.6.0) #set(QT_QMAKE_EXECUTABLE /usr/bin/qmake-qt4) if (NOT DEFINED ${CMAKE_INSTALL_PREFIX}) set(CPACK_INSTALL_PREFIX /usr/) set (CMAKE_INSTALL_PREFIX /usr/) endif() set (LIB_PATH_SUFFIX ) if (CMAKE_SIZEOF_VOID_P EQUAL 8) if (EXISTS "${CMAKE_INSTALL_PREFIX}lib64") set(LIB_PATH_SUFFIX 64) endif (EXISTS "${CMAKE_INSTALL_PREFIX}lib64") set_property (GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE) endif(CMAKE_SIZEOF_VOID_P EQUAL 8) add_definitions( -DPRILIBRARY_PATH="${CMAKE_INSTALL_PREFIX}lib${LIB_PATH_SUFFIX}/yagf/") # following 2 lines define where interface translations will be installed set(QML_DESTINATION share/yagf/translations/) set(QML_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) add_definitions( -DQML_INSTALL_PATH="${QML_INSTALL_PREFIX}${QML_DESTINATION}") set(SOURCES src/main.cpp src/mainform.cpp src/qgraphicsinput.cpp src/utils.cpp src/qxtunixsignalcatcher.cpp src/spellchecker.cpp src/SkewAnalysis.cpp src/core/rotationcropper.cpp src/qxtgraphicsproxywidget.cpp src/popplerdialog.cpp src/pdfextractor.cpp src/pdf2ppt.cpp src/ghostscr.cpp src/configdialog.cpp src/core/ccbuilder.cpp src/core/analysis.cpp src/qsnippet.cpp src/sidebar.cpp src/droplabel.cpp src/projectmanager.cpp src/settings.cpp src/texteditor.cpp src/tblock.cpp src/page.cpp src/tpagecollection.cpp src/scanner.cpp src/core/imageprocessor.cpp src/recognitiondialog.cpp src/langselectdialog.cpp src/busyform.cpp src/tiffimporter.cpp src/QBusyIndicator.cpp src/recognizerwrapper.cpp src/core/binarize.cpp src/core/util.cpp src/core/qipblackandwhiteimage.cpp src/core/qipgrayscaleimage.cpp src/core/subimagepp.cpp src/core/tableanalizer.cpp src/core/pageanalysis.cpp src/core/pixelwindow.cpp src/extprocessdialog.cpp src/djvu2pdf.cpp src/projectfiles.cpp src/saveprojectdialog.cpp src/fileobjectitem.cpp src/loadprojectdialog.cpp src/autosaver.cpp src/waitwindow.cpp src/globallock.cpp) set(HEADERS src/settings.h) set(INT_SOURCES src/preload.c) set(UIS src/mainform.ui src/popplerdialog.ui src/configdialog.ui src/langselectdialog.ui src/busyform.ui src/recognitiondialog.ui src/extprocessdialog.ui src/saveprojectdialog.ui src/waitwindow.ui) set(MOC_HEADERS src/mainform.h src/qxtunixsignalcatcher.h src/qxtunixscinternal.h src/qgraphicsinput.h src/qxtgraphicsproxywidget.h src/qxtgraphicsview.h src/popplerdialog.h src/pdfextractor.h src/configdialog.h src/core/ccbuilder.h src/sidebar.h src/droplabel.h src/projectmanager.h src/texteditor.h src/page.h src/tpagecollection.h src/scanner.h src/core/imageprocessor.h src/langselectdialog.h src/busyform.h src/tiffimporter.h src/QBusyIndicator.h src/recognizerwrapper.h src/recognizerwrapperinternal.h src/recognitiondialog.h src/extprocessdialog.h src/djvu2pdf.h src/saveprojectdialog.h src/loadprojectdialog.h src/menuaction.h src/autosaver.h src/waitwindow.h) set(yagf_RCCS src/yagf.qrc) set(QM_FILES ${CMAKE_BINARY_DIR}/yagf_ru.qm ${CMAKE_BINARY_DIR}/yagf_fr.qm) add_definitions(-Wall -g) find_package(Qt4 4.6 REQUIRED) find_package(ASPELL REQUIRED) include_directories(${ASPELL_INCLUDE_DIR}) include(${QT_USE_FILE}) qt4_wrap_ui(UI_HEADERS ${UIS}) qt4_wrap_cpp(MOC_SRCS ${MOC_HEADERS}) qt4_add_resources(yagf_RCC_SRCS ${yagf_RCCS}) include_directories( ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/src) add_executable(yagf ${SOURCES} ${UI_HEADERS} ${MOC_SRCS} ${yagf_RCC_SRCS} ${QM_FILES}) add_library(xspreload SHARED ${INT_SOURCES}) target_link_libraries(xspreload ${CMAKE_DL_LIBS}) target_link_libraries(yagf ${QT_LIBRARIES} ${ASPELL_LIBRARIES}) add_custom_target(translations DEPENDS ${QM_FILES}) qt4_add_translation(${CMAKE_BINARY_DIR}/yagf_ru.qm ${PROJECT_SOURCE_DIR}/src/mainform.cpp ${PROJECT_SOURCE_DIR}/src/popplerdialog.cpp ${MOC_SRCS} ${UI_HEADERS} ${PROJECT_SOURCE_DIR}/src/translations/yagf_ru.ts) qt4_add_translation(${CMAKE_BINARY_DIR}/yagf_fr.qm ${PROJECT_SOURCE_DIR}/src/mainform.cpp ${PROJECT_SOURCE_DIR}/src/popplerdialog.cpp ${MOC_SRCS} ${UI_HEADERS} ${PROJECT_SOURCE_DIR}/src/translations/yagf_fr.ts) #QT4_CREATE_TRANSLATION(yagf_ru.qm src/mainform.cpp ${MOC_SRCS} ${UI_HEADERS} src/yagf_ru.ts) #set(CMAKE_INSTALL_PREFIX /usr/) install(TARGETS yagf xspreload RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_PATH_SUFFIX}/yagf) install(FILES ${QM_FILES} DESTINATION ${QML_DESTINATION}) #install(FILES COPYING DESCRIPTION README AUTHORS ChangeLog DESTINATION share/yagf/) install(FILES yagf.png DESTINATION share/pixmaps/) install(FILES yagf.png DESTINATION share/icons/hicolor/96x96/apps/) install(FILES YAGF.desktop DESTINATION share/applications/) if (EXISTS /usr/share/appdata/) install(FILES YAGF.appdata.xml DESTINATION /usr/share/appdata/) endif (EXISTS /usr/share/appdata/) #set(CPACK_PACKAGE_FILE_NAME yagf) set(CPACK_PACKAGE_VENDOR "Andrei Borovsky, anb@symmetrica.net") set(CPACK_PACKAGE_CONTACT ${CPACK_PACKAGE_VENDOR}) set(CPACK_SYSTEM_NAME "i586") set(CPACK_BINARY_DEB ON) set(CPACK_BINARY_RPM ON) set(CPACK_BINARY_STGZ ON) set(CPACK_BINARY_TGZ OFF) set(CPACK_BINARY_TZ OFF) set(CPACK_BINARY_TBZ2 OFF) set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Graphical front-end for cuneiform and tesseract OCR tools") set(CPACK_PACKAGE_VERSION 0.9.1) set(CPACK_PACKAGE_VERSION_MAJOR "0") set(CPACK_PACKAGE_VERSION_MINOR "9") set(CPACK_PACKAGE_VERSION_PATCH "1") set(CPACK_STRIP_FILES bin/yagf bin/libyagfpreload) set(CPACK_SOURCE_TBZ2 "OFF") set(CPACK_SOURCE_TGZ "ON") set(CPACK_SOURCE_TZ "OFF") set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR}/yagf-${CPACK_PACKAGE_VERSION}/;/") set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/COPYING) set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_SOURCE_DIR}/DESCRIPTION) set(CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/README) set(DEBIAN_PACKAGE_SECTION "text processing") set(CPACK_RPM_PACKAGE_LICENSE "GPL v.3.0") set (CPACK_RPM_PACKAGE_REQUIRES "libqt > 4.5") include(CPack) yagf-0.9.5+repack1/INSTALL000755 001750 001750 00000003332 12470517140 016463 0ustar00boradminboradmin000000 000000 These are generic installation instructions. YAGF requires Qt 4.6 or later and Aspell libraries. Note about Qt 5: YAGF cannot be built with Qt 5 yet. If your system uses Qt 5 by default you should install Qt 4 as well. You should then find where qmake for Qt 4 is and uncomment the following line in CMakeLists.txt: set(QT_QMAKE_EXECUTABLE /usr/bin/qmake-qt4) If qmake for QT 4 is called differently in you system you should edit the path portion of this line. You will need CMake to build YAGF from sources. There are two modes for building YAGF with CMake: in-source and out-source. The out-source mode is preferred. To build YAGF in this mode follow these instructions: make a directory for your build (for example yagf-build). Assuming your yagf-build directory is in the same directory as the yagf directory you can command: cd yagf-build cmake ../yagf make sudo make install You can now remove the yagf-build directory. In order to perform an in-source build you should issue this simple set of commands: cd yagf cmake ./ make sudo make install There are several important variables defined in CMakeLists.txt file. The QML_INSTALL_PREFIX and QML_DESTINATION valiarbles define where qml (traslation) files are going to be installed. The full path is cistructed as QML_INSTALL_PREFIX+QML_DESTINATION and it is the place where the program will look for the compiled translation files. While YAGF may be built to support multi-image TIFFs, I have found that it conflicts with JPEG input libraries. This may be reso;ved in the future. If you want to build the program with multi-image TIFF support, open CMakeLists.txt file and change the line set(MPTIFF_SUPPORT false) to set(MPTIFF_SUPPORT true) and then build the program as described above. yagf-0.9.5+repack1/ChangeLog000755 001750 001750 00000010517 12470517140 017207 0ustar00boradminboradmin000000 000000 * Wed Jan 28 2015 Andrei Borovsky - 0.9.5 - Projects improved - Autosave projects - Table recognition support (experimental) - DjVu import supported * Mon Jun 30 2014 Andrei Borovsky - 0.9.4 - to much new to mention here * Fri Mar 21 2014 Andrei Borovsky - 0.9.3.1 - some GUI improvements - Multipage TIFF import added * Tue Feb 19 2014 Andrei Borovsky - 0.9.3 - New image enchansement functions added - New languages added - Minor bugs fixed, stability improved * Mon Sep 3 2012 Andrei Borovsky - 0.9.2 - Workspace may now be saved as a project - Prepare for recognition button - Small bug fixes and improvements * Fri Apr 20 2012 Andrei Borovsky - 0.9.1 - Some minor bug fixes and improvements * Sun Apr 15 2012 Andrei Borovsky - 0.9.1 - Toolbar icons size togling options is added - YAGF now stores its private data in according with freedesktop.org standard for configuration files * Mon Apr 09 2012 Andrei Borovsky - 0.9.1 - Text-splitting capability for splitting text into blocks automatically is added * Tue Feb 28 2012 Andrei Borovsky - 0.9 - Genral program restructure. Images are loaded and processed much faster. * Mon Feb 27 2012 Andrei Borovsky - 0.9 - Hebrew support added - corrected word suggestion added to the text editor context menu. * Sun Feb 26 2012 Andrei Borovsky - 0.9 - Automatic cropping of the loaded images added * Sun Dec 22 2011 Stefan Grthe - 0.9 - German Gothic and Swedish Gothic recognition is added (requires tesseract 3+) * Sun Dec 22 2011 Andrei Borovsky - 0.9 - Hebrew recognition support added (requires tesseract 3.0.1+) * Fri Dec 16 2011 Andrei Borovsky - 0.8.9 - Deskewing images improved - Pasting i,ages from clipboard added - Automatic text selection added (experimental) - Some minor bug fixes and improvements * Sun Aug 28 2011 Andrei Borovsky - 0.8.7 - Tesseract support added - PDF import added - Dictionary selection bug fixed * Sun Feb 20 2011 Andrei Borovsky - 0.8.6 - Some bugs fixed - The default recognition language is now set according to the user's locale - Spellchecker buton now indicates if the dictioanry for the selected language is available - Skew correction feature (beta stage) is added * Tue Jan 25 2011 Andrei Borovsky - 0.8.5 - Many bug fixes thanks to Skip - Spellchecker improved - Bulgarian language added (at last!;) - Blocks and entire image may be saved to a file * Sat Jan 08 2011 Andrei Borovsky - 0.8.4 - Serbian, Croatian, and Slovenian languages are added (at last!) - Ability to open several files at ones is added - Ability to drag and drop files on the sidebar is added - Sidebar now remembers blocks selected on all the pages * Sun Dec 26 2010 Andrei Borovsky - 0.8.2 - multiple blocks in image are now supported * Sun Aug 16 2009 Andrei Borovsky - 0.8.1 - batch recognition added * Wed Aug 5 2009 Andrei Borovsky - 0.8.0 - text selection blocks are now resizable - images management bar is added * Wed Aug 5 2009 Andrei Borovsky - 0.8.0 - text selection blocks are now resizable - images management bar is added * Sat Jul 25 2009 Andrei Borovsky - 0.7.1 - scaling and rotation is kept between images in the series - images and text may be scaled by Ctrl + mouse wheel or by Ctrl + [+]/[-] keys. * Sun Jul 19 2009 Andrei Borovsky - 0.7.0 - spell-checking is added - saving to html with images is added * Fri Jul 17 2009 Andrei Borovsky - 0.6.2 - merged the patches with the appropriate files - removed unnessesary ldconfig call * Wed Jul 15 2009 Kyrill Detinov - 0.6.1 - update to 0.6.1 - fixed build in x86-64 - corrected build requires * Sat Jun 20 2009 Kyrill Detinov - 0.5.0 - change compiling outside of the source tree * Mon Jun 15 2009 Kyrill Detinov - 0.5.0 - fix requires Qt version * Mon Jun 08 2009 Kyrill Detinov - 0.5.0 - correct build requires: libqt4-devel <= 4.4.3, cmake >= 2.6 * Fri Jun 05 2009 Kyrill Detinov - 0.5.0 - initial package created