title: How can I detect (and correct) skew in images?
body: <p>I have a large collection of scanned images, and they are all somewhat skewed, with a white area around them.  </p>
  
  <p>So, these images have rectangles of colors, surrounded by a large white area.  The problem is that these rectangles of color are not parallel to the image border.</p>
  
  <p>I'm sure there must be a way to programmatically detect these rectangles of color, so that I can rotate the image (thus un-skewing it) and then crop it so that just the interesting part is left.  I guess I'm not really sure what this process is called, so I am having trouble searching for a solution on Google.</p>
  
  <p>Does anyone know of an approach that would get me started?  Any libraries out there that I should look into?  Or the name of an algorithm that would help?</p>
  
  <p>I am planning on using Java for this project, but I haven't really started yet, so I am open to library suggestions in any language.</p>