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.
Digitizing text with YAGF consists of several stages: images acquisition, images preprocessing (if necessary), the recognition itself, and saving the results.
When you run YAGF for the first time only one recognition language will be selected - the language of your locale. That is if your locale is French then by default you will be able to recognize text only in French. To selecte other languges for recognition click the Select recogniyion languages button. The languages select dialog will appear.
You can select languages for both tesseract and cuneiform, but remember these two tools support different sets of languages (tesseract supports much more than cuneiform). When you select a language which both OCR tools support the language will be marked in both columns.
If you have selected more than one recognition language the dropbox for current language selection will appear on the toolbar. Cuneiform comes will all supported languages preinstalled. For tesseract you might have to install additional languages yourself. Language selection dialog shows which tesseract languages are installed on your system and which are not.
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). 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). In order to make the loading of pages faster automatical image deskew is turned off by default when importing pages from PDF. You can turn it on if you need it.
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.
There are some preprocessing options which by default are applied to all loaded images. If the scanned image is skewed, it is deskewed automatically. Some defects are also removed from the image and the contrast is increased. Applying these operations at load time makes loading images slower. You can turn off any preprocessing operation in the Settings dialog
If you turned off the automatic image skew correction, you can deskew it later 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.
You can also split the scanned text image into blocks automatically. Press the "Split text into blocks" button or select the command of the same name from the context menu. The blocks will be added to the image selecting text columns and paragraphs. Sometimes you have to deskew the image before splitting text into blocks but if the scanned page lies straight you can split it without additional deskewing. Note that when you call automatic text splitting, all blocks added before will be removed.
There is a "prepare for recgnition button" button that combines several page-prepaation tasks (page skew elimination, block-splitting) into a single step.
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, Hebrew, Finnish and so on). As has been already mentionned, the list of available languages in the language selection box depends on the OCR engine chosen.
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.
You can save all acquiored pages, their modifications and selected blocks as a project for the later work. Go to File menu and select the Save Project command. New dialog box will appear prompting you to select the directory where the project will be saved. The directory for a new should be empty. You can also reate a new directory from the dialog box. After ou have selected the directory all the open images and project settings will be saved there. To load previously saved project go to the File menu and select the Load project command. Oce agan the dialog box will appear where you will be able to select the project's directory. You can also save the reopened project using the same command that you use to save a new project. Currently recognised text is not saved with the projects. It should be saved separately.
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.
Source Code (requires CMake to build):
The project GIT repository and bug tracker are available at http://code.google.com/p/yagf
Contact me: email@example.com
If you like this page, please press the button: