Next: , Previous: , Up: Emacspeak Commands And Options   [Contents][Index]

12.133 emacspeak-ocr

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. Prerequisites: Sane installed and working. scanimage to generate tiff files from scanner. tiffcp to compress the tiff file. working ocr executable by default this module assumes that the OCR executable is named "ocr"

12.133.1 emacspeak-ocr Commands emacspeak-ocr

Command: emacspeak-ocr
C-e C-o
<fn> C-o
        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. emacspeak-ocr-backward-page

Command: emacspeak-ocr-backward-page (&optional count-ignored)
        Like backward page, but tracks page number of current document.

(fn &optional COUNT-IGNORED) emacspeak-ocr-customize

Command: emacspeak-ocr-customize
Customize OCR settings. emacspeak-ocr-flipflop-and-recognize-image

Command: emacspeak-ocr-flipflop-and-recognize-image
        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. emacspeak-ocr-forward-page

Command: emacspeak-ocr-forward-page (&optional count-ignored)
        Like forward page, but tracks page number of current document.

(fn &optional COUNT-IGNORED) emacspeak-ocr-mode

Command: emacspeak-ocr-mode
        An OCR front-end for the Emacspeak desktop.


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

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. emacspeak-ocr-name-document

Command: emacspeak-ocr-name-document (name)
        Name document being scanned in the current OCR buffer.
Pick a short but meaningful name.

(fn NAME) emacspeak-ocr-open-working-directory

Command: emacspeak-ocr-open-working-directory
Launch dired on OCR working directory. emacspeak-ocr-page

Command: emacspeak-ocr-page
Move to specified page. emacspeak-ocr-read-current-page

Command: emacspeak-ocr-read-current-page
Speaks current page. emacspeak-ocr-recognize-image

Command: emacspeak-ocr-recognize-image
Run OCR engine on current image.
Prompts for image file if file corresponding to the expected
‘current page’ is not found. emacspeak-ocr-save-current-page

Command: emacspeak-ocr-save-current-page
        Writes out recognized text from current page
to an appropriately named file. emacspeak-ocr-scan-and-recognize

Command: emacspeak-ocr-scan-and-recognize
        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. emacspeak-ocr-scan-image

Command: emacspeak-ocr-scan-image
Acquire page image. emacspeak-ocr-scan-photo

Command: emacspeak-ocr-scan-photo (&optional metadata)
Scan in a photograph.
The scanned image is converted to JPEG.

(fn &optional METADATA) emacspeak-ocr-set-compress-image-options

Command: emacspeak-ocr-set-compress-image-options (setting)
        Interactively update  image compression options.
Prompts with current setting in the minibuffer.
Setting persists for current Emacs session.

(fn SETTING) emacspeak-ocr-set-scan-image-options

Command: emacspeak-ocr-set-scan-image-options (setting)
        Interactively update scan image options.
Prompts with current setting in the minibuffer.
Setting persists for current Emacs session.

(fn SETTING) emacspeak-ocr-write-document

Command: emacspeak-ocr-write-document
        Writes out recognized text from all pages in current document.

12.133.2 emacspeak-ocr Options

Variable: User Option emacspeak-ocr-compress-image

Command used to compress the scanned tiff file.

Variable: User Option emacspeak-ocr-compress-image-options

Options used for compressing tiff image.

Variable: User Option emacspeak-ocr-compress-photo-options

Options used when created JPEG from scanned photographs.

Variable: User Option emacspeak-ocr-engine

OCR engine to process acquired image.

Variable: User Option emacspeak-ocr-engine-options

Command line options to pass to OCR engine.

Variable: User Option emacspeak-ocr-image-extension

Filename extension used for acquired image.

Variable: User Option emacspeak-ocr-jpeg-metadata-writer

Program to add metadata to JPEG files.

Variable: User Option emacspeak-ocr-keep-uncompressed-image

If set to T, uncompressed image is not removed.

Variable: User Option emacspeak-ocr-photo-compress

Program to create JPEG compressed images.

Variable: User Option emacspeak-ocr-scan-image

Name of image acquisition program.

Variable: User Option emacspeak-ocr-scan-image-options

Command line options to pass to image acquisition program.

Variable: User Option emacspeak-ocr-scan-photo-options

Options used when scanning in photographs.

Variable: User Option emacspeak-ocr-working-directory

Directory where images and OCR results will be placed.

Next: , Previous: , Up: Emacspeak Commands And Options   [Contents][Index]