home *** CD-ROM | disk | FTP | other *** search
/ 1st Canadian Shareware Disc / 1st_Canadian_Shareware_Disc_1991.ISO / graphics / ocr_vec / ocr_vec.doc < prev    next >
Text File  |  1990-05-10  |  13KB  |  337 lines

  1.  
  2.         OCR_VEC         Copyright (C) by Ron Mignery, 1990
  3.  
  4.  
  5.  
  6. Introduction:
  7.  
  8.         OCR_VEC is a trainable optical character recognition system for
  9.         the pc.  It enables the computer to scan a graphics screen
  10.         image in order to recognize and to translate whatever text it
  11.         finds.  The graphics screen image would normally come from a
  12.         hardware scanner device, though its actual source is not
  13.         important to the software.  Test images could be generated with
  14.         a paint program, for example.
  15.  
  16.         This package is intended only as a demonstration of a novel
  17.         approach to optical character recognition.  The classical
  18.         approach follows the "eye" model.  The entire character image
  19.         is compared against a library of stored images to find a
  20.         match.  OCR_VEC's approach follows a "Braille" model.  The
  21.         computer feels the shape of the character and matches the
  22.         vectors generated against a library of stored vectors.  Vectors
  23.         are perhaps more easily scaled and abstracted than images and thus
  24.         this system is somewhat more tolerant than the classical approach
  25.         to variation in letter shapes and sizes.
  26.  
  27.         The software can be trained on any font or fonts.  When the
  28.         computer scans an unrecognized letter, it displays the letter
  29.         and prompts for user input.  The user may then identify the
  30.         letter and add its vectors to the lookup library.  In
  31.         subsequent encounters, the computer will now recognize that
  32.         letter.
  33.  
  34.  
  35. The OCR_VEC package:
  36.  
  37.         The OCR_VEC packages contains the following files:
  38.  
  39.         OCR_VEC.DOC     This file
  40.         OCR_VEC.EXE     The OCR executive program
  41.         CGA_CAP.EXE     A TSR utility to capture CGA screens
  42.         EGA_CAP.EXE     A TSR utility to capture EGA screens
  43.         HGA_CAP.EXE     A TSR utility to capture HERC screens
  44.         VGA_CAP.EXE     A TSR utility to capture VGA screens
  45.         OCR_SHP.SHP     A sample letter shape library file
  46.         OCR_LET.LET     A sample letter description file
  47.         OCR_SCR.BIN     A sample graphics screen capture file
  48.         *.BGI           Turbo C graphics drivers
  49.  
  50.  
  51. Operation:
  52.  
  53.  
  54. Optical Character Recogniton:
  55.  
  56.  
  57. 1.      Enter OCR_VEC at the command line.  The program will then prompt:
  58.  
  59.             Enter name of shape file (default=OCR_SHP.SHP)
  60.  
  61.  
  62. 2.      Press the ENTER key to accept the default name or type
  63.         in the filename of your choice and then press ENTER.
  64.  
  65.         The known letter shapes are read from this file.  If the file
  66.         does not exist, the file will be created but no known shapes
  67.         will be loaded.  All new letter shapes encountered during the
  68.         scan will be written to this file.
  69.  
  70.  
  71.         If the shape file is empty, the program next prompts:
  72.  
  73.                 Lookup file not found!
  74.  
  75.             Enter granularity (default=8.0)
  76.  
  77. 3.      Press the ENTER key to accept the default value or type
  78.         in the value of your choice and then press ENTER.
  79.  
  80.         The granularity value determines how precisely the computer
  81.         feels the shape of each letter.  If this value is too large,
  82.         the shape library becomes too large and performance is
  83.         compromised.  If this value is too low, ambiguities in letter
  84.         recognition occur.  The program may be unable to distinguish Q
  85.         from O for example.  A value of 8.0 means that any feature of a
  86.         letter must be larger than 1/8 the size of the entire letter to
  87.         be considered significant.  Empirically for normal fonts this
  88.         value is sufficient.  Use a larger number if ambiguities in
  89.         character recognition occur.
  90.  
  91.  
  92.         The program next prompts:
  93.  
  94.             Enter name of letter file (default=OCR_LET.LET)
  95.  
  96. 4.      Press the ENTER key to accept the default name or type
  97.         in the filename of your choice and then press ENTER.
  98.  
  99.         This file contains information about each letter in the ASCII
  100.         set and about user specified doublets and character fragments
  101.         described below in the Adding a character section.
  102.  
  103.  
  104.         The program next prompts:
  105.  
  106.             Enter screen image file (default=OCR_SCR.BIN)
  107.  
  108. 5.      Press the ENTER key to accept the default name or type
  109.         in the filename of your choice and then press ENTER.
  110.  
  111.         This file must exist and be in the format required by OCR_VEC.
  112.         A sample file is included with the system.  To generate your
  113.         own files from your own graphics, use the capture programs
  114.         described below.
  115.  
  116.  
  117.         The program then loads the requested graphic screen and
  118.         presents the prompt:
  119.  
  120.             Scan entire screen (Y/N)?
  121.  
  122. 6.      If you want to scan only a portion of the screen, press N and
  123.         follow the instructions to mark off the portion of the screen
  124.         to be used.
  125.  
  126.  
  127.         The program next begins scanning for characters.  The progress
  128.         of the scan is indicated by screen inversion.  If the upper
  129.         left pixel is off, the program assumes a black background and
  130.         scans for non-black characters. If it is set, the program scans
  131.         for black characters.  Scanning stops when a blank line is
  132.         encountered following non-blank lines.  The program then
  133.         highlights a character and prompts as follows:
  134.  
  135.  
  136.         If the character is found in the shape library:
  137.  
  138.                 Is it _ ? (Y/N/P/A/D/ESC)
  139.  
  140.         Else:
  141.  
  142.                 Not found.  Add to list (Y/N/A/D/ESC)?
  143.  
  144. 7.      For the first prompt:
  145.  
  146.                 Type Y if the character highlighted is the
  147.                 character scanned.  Note that only a portion
  148.                 of the scanned character may be highlighted and
  149.                 that the highlighted portion may be identical in
  150.                 shape and location to the suggested character.
  151.                 The / in % for example. Type Y if / is suggested.
  152.  
  153.                 Type N otherwise.  Do this only if the highlighted
  154.                 part is of a different shape or location than the
  155.                 suggested character.
  156.  
  157.                 Type P to purge the indicated letter from the
  158.                 shape library.
  159.  
  160.         For the second prompt:
  161.  
  162.                 Type Y to add its shape to the shape library.
  163.                 Follow the directions for Adding a Character
  164.                 outlined in the next section.
  165.  
  166.                 Type N otherwise.
  167.  
  168.         For both prompts:
  169.  
  170.                 Type A to toggle auto mode.  When auto mode is on, the
  171.                 first prompt is bypassed.  Use this mode when all
  172.                 characters in a font have been loaded into the shape
  173.                 library.
  174.  
  175.                 Type D if the line being scanned has no letters with
  176.                 descenders (letters that extend below the baseline).
  177.                 This rare occurrence can confuse the system.  An asterisk
  178.                 will appear in the prompt box when this mode is active.
  179.  
  180.                 Type ESC to quit.
  181.  
  182.  
  183. 8.      Repeat step 7 until the entire text line has been scanned.
  184.  
  185.         The program will then present the text of the line just scanned
  186.         and the following prompt:
  187.  
  188.                 <Text of line just scanned>
  189.  
  190.             Press any key to continue...(A/O/D/ESC)
  191.  
  192.  
  193. 9.      Type A to toggle auto mode as described above.
  194.  
  195.         Type O to append the line of text to the file OCR_VEC.OUT.
  196.  
  197.         Type D to rescan the line in no descenders mode as described
  198.         above.
  199.  
  200.         Type ESC to quit.
  201.  
  202.         Type any other key to continue.
  203.  
  204.  
  205. 10.     Continue this procedure until the entire screen has been
  206.         scanned.
  207.  
  208.  
  209. Adding a Character:
  210.  
  211.         When you type Y in response to the Add to list
  212.         (Y/N/A/D/ESC)?  prompt described above, the program then
  213.         prompts:
  214.  
  215.                 Enter letter that was scanned.
  216.  
  217.         You should then enter the correct case letter that is
  218.         highlighted.  Since OCR_VEC identifies a character as any group
  219.         of non-background color pixels that is completely surrounded by
  220.         background color pixels, the progam will sometimes identify
  221.         parts of characters or multiple characters as a single
  222.         character.
  223.  
  224.         In particular, the dot above i and j will be treated as a
  225.         single character and will be identified before the body of the
  226.         letter since the program scans downward.  The dot and all other
  227.         letter fragments should be treated as special cases and
  228.         identified to the program through control characters.  That is,
  229.         if the program highlights the dot above i or j, then ctrl-a
  230.         should be entered as the letter scanned.  You will then be
  231.         able to enter two letters to correspond to the highlighted
  232.         character.  Similarly, the tops of the two-part characters ?
  233.         and ! should be entered as ctrl-b and ctrl-c respectively.  The
  234.         dots above : and ; may or may not be identified as the same as
  235.         the dots above i and j depending on the font scanned.  If they
  236.         are not the same, then ctrl-d should be used.  These
  237.         assignements are abitrary and are only suggestions.  The point
  238.         is not to assign multiple values to a single shape.  Later,
  239.         when the program scans the second part of the character, it
  240.         will recognize the first part above it and combine the
  241.         information to generate a single character output.  Parts are
  242.         combined only when one part completely overlaps another part.
  243.         Characters that partially overlap will not be combined; thus,
  244.         even a kerned font can potentially be read.
  245.  
  246.         Some legitimate fonts have no whitespace between certain letter
  247.         combinations like fl or YZ.  OCR_VEC will highlight two
  248.         characters in such a case.  Again, these combinations can be
  249.         handled with control characters.  Enter an unused control
  250.         character to correspond to the doublet. You may then enter two
  251.         letters to represent the scanned character.  A little awkward
  252.         but it works.  If a font has no whitespace between lines,
  253.         however, you are out of luck.
  254.  
  255.  
  256.  
  257. Graphics Screen Capture:
  258.  
  259.         OCR_VEC requires screen image files in a special format.  Files
  260.         in this format are generated by the ?GA_CAP.EXE programs
  261.         included in the package.  These programs are TSRs (terminate
  262.         and stay resident) that are invoked after loading by the
  263.         simultaneous press of the Alt, Ctrl and S keys.
  264.  
  265. To capture a screen into the file OCR_SCR.BIN:
  266.  
  267. 1.      To capture CGA graphics screens, enter CGA_CAP at the Dos prompt.
  268.  
  269.         To capture EGA graphics screens, enter EGA_CAP at the Dos prompt.
  270.  
  271.         To capture VGA graphics screens, enter VGA_CAP at the Dos prompt.
  272.  
  273.         To capture HERCULES graphics screens, enter HGA_CAP at the Dos
  274.         prompt.
  275.  
  276.         Load only one TSR at a time.  These TSRs are quick and dirty
  277.         little affairs and must not have other TSRs loaded after them.
  278.         Use of Mark and Release utilities is recommended for their
  279.         management.
  280.  
  281.  
  282. 2.      Run whatever program you use to display the graphic screen
  283.         you want OCR_VEC to scan.
  284.  
  285.  
  286. 3.      Simultaneously press the Alt, Ctrl and S keys.
  287.  
  288.  
  289. 4.      The file OCR_SCR.BIN is created in the current directory.
  290.  
  291.  
  292.  
  293. Copyrights:
  294.  
  295.         OCR_VEC Copyright (C) Ron Mignery 1990.
  296.  
  297.         Created using Turbo C, Copyright (C) Borland 1987, 1988.
  298.         Graphics drivers included as permitted by Borland's
  299.         No-Nonsense License statement.
  300.  
  301.         TSRs created using the KyCorp Memory Resident Library Version
  302.         2.01, Copyright (C) KyCorp Information Group, Inc. 1987.
  303.  
  304.  
  305. Disclaimers:
  306.  
  307.         This software and instructions are provided "as is" without
  308.         warranty of any kind either expressed or implied including but
  309.         not limited to fitness for a particular purpose. The entire
  310.         risk as to the results and performance of the software is
  311.         assumed by the user.
  312.  
  313.  
  314. Distribution:
  315.  
  316.         The OCR_VEC package may be copied, distributed (free of
  317.         charge), and used non-commercially provided that it is not
  318.         modified in any way.
  319.  
  320.         Anyone interested in this approach to optical character
  321.         recognition may contact the author at the following address:
  322.  
  323.  
  324.                 Ron Mignery
  325.  
  326.                 85 Bartlett Street
  327.  
  328.                 Somerville, MA 02145
  329.  
  330.                 (617) 628-0206
  331.  
  332.  
  333.         (or via GENIE ron mignery)
  334.  
  335. ***end of OCR_VEC.DOC***
  336.  
  337.