Tesseract: an Open-Source Optical Character Recognition Engine
to get results similar to the older dither utility. See the Netpbm documentation for more details.
If your input images are in a format other than TIFF, you can, of course, substitute the appropriate Netpbm tool (such as jpegtopnm) in the pipeline:
$ jpegtopnm < scanned_image.jpg | \ pamthreshold -threshold=0.8 | pamtopnm | pnmtotiff > result.tif
Netpbm also includes utilities that allow you to clip out portions of an image. Note that most multicolumn formats are very consistent in positioning the columns, which means you can automate the translation of multicolumn text pretty easily as well. For example, if you have a two-column article scanned at 200dpi, you can use The GIMP to locate the x coordinates of the column boundaries. Say the first column starts at about 200 and ends at 700, and the second column starts at 800 and ends at 1200. You could add the following to your processing pipeline:
$ tifftopnm < input.tif | \ pamcut -left 150 -right 750 | ... pnmtotiff > output_left.tif $ tifftopnm < input.tif | \ pamcut -left 750 -right 1250 | ... pnmtotiff > output_right.tif
and automate the extraction of the columns. Place the combination in a shell script with some looping, and you can process a lot of pages very quickly.
Tesseract is a bare-bones OCR engine. The build process is a little quirky, and the engine needs some additional features (such as layout detection), but the core feature, text recognition, is drastically better than anything else I've tried from the Open Source community. It is reasonably easy to get excellent recognition rates using nothing more than a scanner and some image tools, such as The GIMP and Netpbm.
The Tesseract team currently is working to integrate features such as layout analysis and a GUI interface. It looks as if a commercial-quality open-source OCR solution is finally on the horizon.
Anthony Kay has been a systems programmer, programming instructor, technical writer and application developer. He is currently a computer science graduate student at the University of Oregon in Eugene, Oregon.
Practical books for the most technical people on the planet. Newly available books include:
- Agile Product Development by Ted Schmidt
- Improve Business Processes with an Enterprise Job Scheduler by Mike Diehl
- Finding Your Way: Mapping Your Network to Improve Manageability by Bill Childers
- DIY Commerce Site by Reven Lerner
Plus many more.