I need to calculate angle of rotation of an image from X and Y axis, what I'll have is 4 co-ordinates of the corners of the image (basically a perfect square image is rotated in all possible angle), using this co-ordinates I need to calculate the angle of rotation in X and Y axis.
For example if four corner makes a perfect square then the angle of rotation from all axis is 0, lets say if the top edge is shorter than the bottom edge or vice versa then it is rotated along X axis, or if the right edge is shorter that the left edge or vice versa then it is rotated along Y axis, or the combination of above 2 examples with rotation on X and Y axis.
And what if I got the angles of 4 corners of the square image, lets say if the 4 corners of the image is equal to 90 degree, means the rotation along X and Y axis are 0 degrees which is a perfect square.
In the above image, I need to calculate the angle of the Object based on the Glass screen.
Can someone guide me how to do calculation?