tags:

views:

2411

answers:

5

Does anybody have a suggestion for a java library that performs automatic cropping and deskewing of images (like those retrieved from a flatbed scanner)?

+2  A: 

ImageMagick can do that; you can use the ImageMagick Java bindings. The auto-crop operator is probably what you're looking for. Automatic deskewing is a much harder problem and involves some significant image processing; I'm not sure if ImageMagick can handle that. If you can figure out the skewing parameters using something else, ImageMagick can definitely unskew it for you.

Adam Rosenfield
+1  A: 

I'd imagine that someone has built a library on top of the Java Advanced Imaging API for doing this. You could try Googling for "Java Advanced Imaging deskew".

Matt Passell
A: 

Here is an example on cropping images using Java Advanced Imaging API.

rics
A: 

I've written a simple image deskew app, includes source. Available at:

http://www.recognition-software.com/image/deskew/

Roland Quast
A: 

I wrote a not that simple port of a very good deskewer. It works best if you have some text in the image.

http://anydoby.com/jblog/en/java/1990

anydoby