Rotate image to Horizontal/Verticle with a straight line in the image as a reference

The two-point rotation tool is worth review.