Re: using imagemagick to clean up scanned images

[email protected] Thu, 02 Oct 2008 20:10:07 +0000
Newsgroups gmane.comp.video.image-magick.devel
Message-ID <100220082010.21249.48E52A9F0002B2740000530122070009539F9D02020A0409@comcast.net>
 -------------- Original message ----------------------
From: "james ryan" <[email protected]>
> I am wondering if anyone has done the following or has input on how
> successful this would be:
> 
> 1.  Use deskew:autocrop or some other routines.  Once concern I have
> is that the content may be a small portion of the paper scanned in and
> it should autocrop to the content not the paper.

   I've done this to clean up scans with a lot of dust and clutter in the
margins.

   1. scale the image down to about 5% or 10%

   2. median threshold to remove the dust

   3. autocrop/trim to remove the white margin

   4. Record the crop dimensions/offsets and scale those back up to the
       original size (or maybe 10-20 pixels larger than the scaled-up
       crop dimensions)

   5. Crop the original using the scaled-up dimensions

> 2.  Make the library as small as possible, as this would be linked
> into an applet (has anyone ever gotten a core library plus routines
> seperated out?)
> 
> 3.  My intention would be to get a dll file and then integrate using JNI+applet.

I can't answer questions 2 and 3; I was using the commandline method.

Glenn