home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gocr035b.zip / README < prev    next >
Text File  |  2002-02-03  |  6KB  |  143 lines

  1.                 GOCR/JOCR
  2.  
  3. GOCR is an optical character recognition program, released under the GNU 
  4. General Public License. It reads images in many formats (pnm, pbm, pgm, ppm, 
  5. some pcx and tga image files (or PNM from stdin); if pnm-tools installed and
  6. running linux-like system you can also use pnm.gz, pnm.bz2, png, jpg, tiff,
  7. gif, bmp and others) and outputs a text file.
  8.  
  9. To see installation instructions, see the INSTALL file.
  10.  
  11. How to start? (QUICK START)
  12. ---------------------------
  13. You'll probably want to use one of the frontends available, such as the TCL/TK
  14. or the GTK. They make your life much easier.
  15.  
  16. Some examples of how you can use gocr:
  17.  
  18.   gocr -h                   # help
  19.   gocr file.pbm                # minimum options
  20.   gocr -v 1 file.pbm >out.txt 2>out.log # generate text- and log file
  21.   djpeg -pnm -gray text.jpg | gocr -    # using JPEG-files
  22.   gzip -cd text.pbm.gz | gocr -        # using gzipped PBM-files
  23.   giftopnm text.gif | gocr -        # using GIF-files
  24.   gocr -v 1 -v 32 -m 4 file.pbm       # zoning and out30.bmp output
  25.   xli -geometry 400x400 out30.bmp # see details using xli (recommanded viewer)
  26.   wish gocr.tcl              # X11-tcl/tk-frontend (development version)
  27.  
  28.  
  29. How to get image files?
  30. -----------------------
  31. Scan text pages and save it as PGM/PBM file. Use a program such as The GIMP.
  32. You can also use PNM-tools to convert several image formats into pbm/pgm.
  33.  
  34. djpeg can be used to convert jpeg into pgm
  35.   djpeg -grayscale -outfile file.pgm infile.jpg
  36.  
  37. Generate our own using TeX+DVIPS+GS or other programs, or convert existing
  38. PostScript or PDF files to an image format. Generate provided examples:
  39. make examples.
  40.  
  41.  
  42. Memory limitations
  43. ------------------
  44. WARNING!!!
  45.  
  46. If you use a 300dpi scan of A4 letter, the image is about 2500x3500 pixels and
  47. gocr requires 8.75Mb for storing the picture into the memory. Not only that,
  48. but gocr may create a 2nd copy, using a total of 17Mb. This is independent
  49. of using b/w or gray-scale images. Be sure that you have enough RAM installed
  50. in your machine! Alternatively you can cut the picture into small pieces.
  51. You can use the pnmcut, from the netpbm package to cut the file. Example:
  52.  
  53. pnmcut -left 0 -right 2500 -top 0 -height 1000 bigfile.pnm > smallfile.pnm
  54.  
  55. And then use gocr in the cropped image as usual. Take care: if you chop the
  56. characters, gocr won't be able to understand that line.
  57.  
  58. Future versions will take care of this issue automatically.
  59.  
  60. Limitations
  61. -----------
  62. gocr is still in its early stages. Your images should fit in these requirements
  63. if you want a good output:
  64.  
  65. - good scans (all chars well seperated, one column, no tables etc, 12pt 300dpi)
  66.   should work well
  67. - fonts 20-60 pixels ( 5pt * 1in/72pt * 300 dpi = 20 dots )
  68. - output of image file for controlling detection
  69.  
  70. And note that speed is very slow (this will be changed when recognition works 
  71. well)
  72.   12pt 300dpi 1700x950 16lines 700chars 22x28 P90=40s..90s v0.2.3 (gcc -O0)
  73.  
  74. You can try to optimize the results:
  75. - make good scans/treat image
  76. - try to change the critical gray level (option -l <n>)
  77. - control the result on out30.bmp (option -v 32)
  78. - enlarge option -d <n> for high resolution images which are noisy
  79. - try different combinations for option -m <n>
  80. - for thousends of documents with same font
  81.   you can use/create a database (-m 2/-m 130)
  82.  
  83. What does >> NOT << work at the moment:
  84. - complex layouts (try option -m 4)
  85. - bad scans, noisy/snowy images, FAX-quality images
  86. - serif fonts, italic fonts, slanted fonts
  87. - handwritten texts (this is valid for the next ten years)
  88. - rotated images (but slightly rotated images should be no problem)
  89. - small fonts (fax like) or mix of different font size
  90. - colored images (use gray or black/white)
  91. - Chinese, Arabian, Egyptian, Cyrillic or Klingon fonts
  92. - using database (create_db is for developer tests)
  93.  
  94. How it works or how it should work?
  95. - put the entire file into RAM (300dpi grayscale recommended)
  96. - remove dust and snow
  97. - detect small angle (lines which are not horizontal)
  98. - detect text boxes (option -m 4)
  99. - detect text-lines
  100. - detect characters
  101. - first step recognition (every character has its own empirical procedure)
  102.   - no neural network or similar general algorithms
  103. - analyze not detected chars by comparison with detected ones
  104. - try to divide overlapping chars
  105. - testwise: compare all letters (like compression of pictures)
  106. - for more details look to the ocr.tex documentation
  107.  
  108.  
  109. How can you help gocr?
  110. ----------------------
  111. - Send comments, ideas and patches (diff -ru gocr_original/ gocr_changed/).
  112. - If you have a lot of money, spend a bit (www.paypal.com).
  113. - I always need example files (.pbm.gz or jpeg <100kB) for testing
  114.   the behavior of the ocr engine under different conditions, 
  115.   because scanning does take a lot of time which I do not have.
  116.   But do not send files which are not convertable by commercial ocr programs
  117.   or which are protected from copying and electronic processing by copyright.
  118.   That will help, to get the world's best OCR open source program. :) Thanks!
  119. - Send me your results (errors,num_chars,dpi) and if possible results
  120.   and name of professional OCR programs for statistics.
  121. - Read OCR literature, extract the essentials and send a short report
  122.   to me ;).
  123. - If you have a good idea, how to manage some OCR-tasks, tell me!
  124. - Tell your friends about gocr. Tell me about your success. Be happy.
  125.  
  126.  
  127. After all, is it gocr or jocr?
  128. ------------------------------
  129. The original name of this project is gocr, from GNU Optical Character
  130. Recognition. Another project is using the same name, however; so the
  131. name was changed to jocr. If you have a good idea for a name, please
  132. send it.
  133.  
  134.  
  135. Latest news
  136. ------------
  137.   http://altmark.nat.uni-magdeburg.de/~jschulen/ocr/index.html
  138.   http://jocr.sourceforge.net
  139.  
  140. Authors:
  141.   jschulen@gmx.de (Joerg)
  142.   brunobg@geocities.com
  143.