Preparing for OCR

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
riddler
Posts: 3
Joined: 2014-02-25T16:53:20-07:00
Authentication code: 6789

Preparing for OCR

Post by riddler »

Does anyone know how I could use ImageMagick to replicate the effect in the images below? I am preparing the image to be sent to an OCR engine for scanning.

http://www.scanbizcards.com/benefitquest.jpg
http://www.scanbizcards.com/benefitquest-bw.jpg

Thanks
Last edited by riddler on 2014-02-25T18:24:17-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Preparing for OCR

Post by fmw42 »

They are both the same image!

But I think I know what you want. If on Linux or Mac or Windows w/ Cygwin, see my script, textcleaner, at the link below. Otherwise, see the IM function -lat, which is what I use in the textcleaner script. see http://www.imagemagick.org/script/comma ... ns.php#lat

try something like

Code: Select all

convert image -lat 25x25+10% result
Optionally add -colorspace gray after reading the image and before -lat.
Post Reply