Library used to deskew a scanned document
Detect and fix skew in images containing text
Sane command-line scan-to-pdf script on Linux with OCR and deskew support
Tutorial on how to deskew (straighten) text images