Given a photo containing a circle, such as this photo of a fountain:

Is it possible to determine the three-dimensional position and rotation of the fountain in relation to the camera?
I understand that we need to determine the scale, so let's say that the fountain has a width of 2 m (the diameter of the circle consisting of the inner edge of the fountain is 2 m).
So, if a circle is an ideal circle and defines a diameter of up to 2 m, is it possible to determine how the circle and the camera are spatially connected? I do not know a single camera matrix or anything else, the only information I have is the image.
I specifically want to determine the 3D coordinates of a given pixel on the edge of the fountain.
What will be the math and / or OpenCV code for this?
source
share