YAGF - graphical front-end for cuneiform and tesseract
YAGF is a graphical interface for cuneiform and tesseract text recognition tools on the Linux platform. With YAGF you can scan images via XSane, import pages from PDF documents, perform images preprocessing and recognize texts using cuneiform from a single command centre. YAGF also makes it easy to scan and recognize several images sequentially.
System Requirements
Manual
Download YAGF
Digitizing text with YAGF consists of several stages: images acquisition, images preprocessing (if necessary), the recognition itself, and saving the results.
You can recognize text from the images stored on your hard drive, or you can scan new images and pass them to YAGF directly. Use File/Open Image... command to load an image from your hard drive (you can load several image files at once). You can also drop image files on the dark side bar on the left side of the program's main window (or simply on the program's icon if the program is not running yet). YAGF supports all major raster graphics formats (JPEG, PNG, BMP, TIFF, GIF, PNM, PPM, PBM). If the loaded file's name is in the form nameXXX.ext, where XXX is some number, you can move between previous/next file in series with the navigation buttons. For example, if you have loaded the file named MyPage06.jpg, the "Move to next image" button will try to open the next file, that is, MyPage07.jpg. All the opened images will be displayed on the image bar.
If your system's clipboard contains an image, you can paste it to YAGF using an appropriate command.
You can acquire images directly from a scanner using XSane. While in YAGF, choose File/Scan command. XSane program will be started. Set up the scanning options with XSane and press XSane's "Scan" button. When the scanning is done the scanned image is opened in the YAGF image viewing window. If you want to scan several pages, you can repeat these operation several times. Each time the last scanned image will be shown in the YAGF image viewing window. You can move to previous images using navigation buttons. You can keep XSane window open while working with YAGF. When you exit YAGF this window will be closed automatically. In order to navigate between scanned images use navigation buttons as it was described above. All acquired images are shown as thumbnails on the image bar. You can save these images into a separate directory using Save button on the image bar.
You can also acquire pages from unencripted PDF files. Use "File|Import from PDF..." command. You will be propted for a PDF document name and the number of pages you want to import (the whole document or some range of pages). Then you will be prompted to select an empty directory to save imported pages. You may create one in the process.
There are several preprocessing options available in YAGF. You can rotate loaded images if they are not positioned correctly. Images may be rotated by 90 degrees (counter-) clockwise and by 180 degrees. There are special buttons for this at the top of the image-viewing window. If you don't want to recognize an entire page but rather some part of it, you can select a rectangular block for recognition (more than one block may be selected). The block is selected in the image-viewing window with mouse. Simply hold the left mouse button down and start dragging. Release the button when you are done. Repeate the operation to select another block (keep in mind that blocks cannot overlap). If you click with the left mouse button at come block its color chages to pink and it becomes resizable. You can resize it by dragging mouse pointer on its edge. If you click the image with the right mouse button, the context menu will appear. In this menu you can select one of several options to clear all blocks, to delete the block you clicked on or to recognize the text in the block you clicked.
If the scanned image is skewed, you can deskew it by pressing the Correct skew button. The image will be rotated so that text lines go in parallel with the window boundaries. This will make it easier to select text blocks and recognize text. You can also use a selected block of text as a pattern for deskewing. Select the text block you want to be deskewed (the bigger the block the better), right-click on it and select the Deskew Block command from the context menu.
Now you can select the OCR tool to use (cuneiform or tesseract). This is done with the menu "Settings|OCR Settings" command. The tesseract OCR engine allows recognition in some languages not supported by cuneiform (Greek, Turkish, Finnish and so on). In the language selection box these languages are marked as "tesseract only". If you choose tesseract, make sure the language data files for the languages you are going to recognize are installed (some languages are available only with tesseract 3.0 or higher).
Before recognizing text you should select the recognition language (or a language paire if the document to be recognized is written in several languages).
Each newly recognized text fragment is added to the recognized text editor window at the end of the already recognized text as a new paragraph.annot find a dictionary for the selected recognition language. Turn spell-checking off if you don't want to see these warnings.
If you have several images opened in your Image bar, you can use batch recognition to recognize text from all the images in a sequence. Click "Recognize All Pages" button. If the are blocks selected on the pages, only the text in the blocks will be recognized during the batch recognition. If the pages loaded into YAGF have diffrent scale or orientation or different blocks selected on them, YAGF will remember this information until the program is running. The images will be automatically loaded and recognized one after another and the progress dialog will appear. You can stop the recognition process by clicking the progress dialog's Abort button.
The recognized text may be saved to disc as a text or html file in UTF-8 encoding or copied to the clipboard. The "Copy to Clipboard" btton copies either a selected text fragment or the whole text if no fragment is selected.
Sometimes YAGF may start scanning via XSane and the scanning will be performed but the results will not be passed to YAGF. To solve this issue close the YAGF program and remove the /var/tmp/yagf.fifo file (you may need the root access rights to poerform this).
Source Code (requires CMake to build):
yagf-0.8.9.tar.gz
Source patch by Stefan Garthe allows the recognition of German and Swedish texts typed in Gothic (tesseract 3.0 or higher is needed).
Contact me: anb@symmetrica.net
If you like this page, please press the button: