I am given the X, Y, Z locations of 4 corners in a rectangle, and their X, Y locations on a picture. I would like to use these locations to find the camera's angle with the rectangle. For instance, if i am looking at a rectangle from the far right, it will appear like a trapezoid, with the right edge much longer than the left. Thus, I feel there should be an algorithm that can find the angles I am at relative to the rectangle.
I am coding on android, and I am using the opencv and opengl libraries. I have seen relevant algorithms in opencv, but they are not doing exactly what I need. Any helpful advice would be greatly appreciated.
I have found that the method solvePnP in opencv will do exactly what I need it to do.