This module defines Emacspeak front-end to OCR. This module assumes that sane is installed and working for image acquisition, and that there is an OCR engine that can take acquired images and produce text.
An OCR front-end for the Emacspeak desktop. Page image is acquired using tools from the SANE package. The acquired image is run through the OCR engine if one is available, and the results placed in a buffer that is suitable for browsing the results. For detailed help, invoke command emacspeak-ocr bound to C-e C-o to launch emacspeak-ocr-mode, and press ‘?’ to display mode-specific help for emacspeak-ocr-mode.
Like backward page, but tracks page number of current document. (fn &optional COUNT-IGNORED)
Run OCR engine on current image after flip-flopping it. Useful if you’ve scanned a page upside down and are using an engine that does not automatically flip the image for you. You need the imagemagik family of tools — we use mogrify to transform the image. Prompts for image file if file corresponding to the expected ‘current page’ is not found.
Like forward page, but tracks page number of current document. (fn &optional COUNT-IGNORED)
An OCR front-end for the Emacspeak desktop. Pre-requisites: 1) A working scanner back-end like SANE on Linux. 2) An OCR engine. 1: Make sure your scanner back-end works, and that you have the utilities to scan a document and acquire an image as a tiff file. Then set variable emacspeak-ocr-scan-image-program to point at this utility. By default, this is set to ‘scanimage’ which is the image scanning utility provided by SANE. By default, this front-end attempts to compress the acquired tiff image; make sure you have a utility like tiffcp. Variable emacspeak-ocr-compress-image is set to ‘tiffcp’ by default; if you use something else, you should customize this variable. 2: Next, make sure you have an OCR engine installed and working. By default this front-end assumes that OCR is available as /usr/bin/ocr. Once you have ensured that acquiring an image and applying OCR to it work independently of Emacs, you can use this Emacspeak front-end to enable easy OCR access from within Emacspeak. The Emacspeak OCR front-end is launched by command emacspeak-ocr bound to C-e C-o. This command switches to a special buffer that has OCR commands bounds to single keystrokes– see the key-binding list at the end of this description. Use Emacs online help facility to look up help on these commands. emacspeak-ocr-mode provides the necessary functionality to scan, OCR, read and save documents. By default, scanned images and the resulting text are saved under directory ~/ocr; see variable emacspeak-ocr-working-directory. Invoking command emacspeak-ocr-open-working-directory bound to M-x emacspeak-ocr-open-working-directory will open this directory. By default, the document being scanned is named ‘untitled’. You can name the document by using command emacspeak-ocr-name-document bound to M-x emacspeak-ocr-name-document. The document name is used in constructing the name of the image and text files. Key Bindings: See Key Binding ——————————————————————————- RET emacspeak-ocr-scan-and-recognize SPC emacspeak-ocr-read-current-page 1 .. 9 emacspeak-ocr-page ? describe-mode C emacspeak-ocr-set-compress-image-options I emacspeak-ocr-set-scan-image-options [ emacspeak-ocr-backward-page ] emacspeak-ocr-forward-page c emacspeak-ocr-customize d emacspeak-ocr-open-working-directory f emacspeak-ocr-flipflop-and-recognize-image i emacspeak-ocr-scan-image j emacspeak-ocr-scan-photo n emacspeak-ocr-name-document o emacspeak-ocr-recognize-image p emacspeak-ocr-page q bury-buffer s emacspeak-ocr-save-current-page w emacspeak-ocr-write-document . In addition to any hooks its parent mode ‘text-mode’ might have run, this mode runs the hook ‘emacspeak-ocr-mode-hook’, as the final or penultimate step during initialization.
Name document being scanned in the current OCR buffer. Pick a short but meaningful name. (fn NAME)
Launch dired on OCR working directory.
Speaks current page.
Run OCR engine on current image. Prompts for image file if file corresponding to the expected ‘current page’ is not found.
Writes out recognized text from current page to an appropriately named file.
Scan in a page and run OCR engine on it. Use this command once you’ve verified that the separate steps of acquiring an image and running the OCR engine work correctly by themselves.
Scan in a photograph. The scanned image is converted to JPEG. (fn &optional METADATA)
Interactively update image compression options. Prompts with current setting in the minibuffer. Setting persists for current Emacs session. (fn SETTING)
Command used to compress the scanned tiff file.
Default Value:
nil
Options used for compressing tiff image.
Default Value:
"-c g3 "
Options used when created JPEG from scanned photographs.
Default Value:
"-optimize -progressive"
OCR engine to process acquired image.
Default Value:
"/home/raman/emacs/lisp/emacspeak/etc/tesseract.pl"
Command line options to pass to OCR engine.
Default Value:
nil
Filename extension used for acquired image.
Default Value:
".tif"
Program to add metadata to JPEG files.
Default Value:
"wrjpgcom"
If set to T, uncompressed image is not removed.
Default Value:
nil
Program to create JPEG compressed images.
Default Value:
"cjpeg"
Command line options to pass to image acquisition program.
Default Value:
"--resolution 300 --mode lineart --format=tiff"
Options used when scanning in photographs.
Default Value:
"--mode color --format=pnm"
Directory where images and OCR results will be placed.
Default Value:
"/home/raman/.emacspeak/ocr/"