Some Demo code for a StackOverflow question. http://stackoverflow.com/questions/24086130/how-to-detect-the-rotation-angle-of-coordinates-in-an-image/