I cam across an excellent little app to help with people who take the time to share manuals, or pages from manuals.
Most scanners never get the paper completely 'straight'. So this little app will straighten it out (aka deskew it). Its command line, and I did not write it... but I've been using it pretty hard and it's worked great. Its best used then there is text on the page, as that is what it uses to determine 'straightness'. So if you have just an image it might not work to well.
Source code is included... bonus!