4

Given a photo containing a circle, for example this photo of a fountain: photo of a fountain

is it possible to define the 3D position and rotation of the fountain in relation to the camera?

I realise we have to define the scale, so lets say the fountain is 2m wide (the diameter of the circle consisting of the inner rim of the fountain is 2m).

So assuming the circle is a perfect circle, and defining the diameter to 2m, is it possible to determine how the circle and the camera relate spatially? I dont know any camera matrix or anything, the only information i have is the picture.

I specifically want to determine the 3D coordinates of a given pixel on the rim of the fountain.

What would be the math and/or OpenCV code to do this?

quad16
  • 184
  • 5
  • 20
  • do you assume the circle to be present on the "ground plane"? It is probably possible to compute the camera extrinsics from that circle if you create enough known points from it. You can define an axis on that circle and probably some more points from angular relations. However, you can't compute the intrinsics from it, best would be intrinsics up to a scale, since distance from camera to object and focal distance can counterbalance each other... – Micka Jan 18 '16 at 21:08
  • however, if that is possible, the extrinsics won't be "global", so if you take two picutres of the same circle, you won't be able to find the right relationship between both cameras, unless you are able to define the 3D circle axes the same in both images, so you need some image based method to define your axes. And for all, you'll have to know the midpoint of the original circle within that ellipse! – Micka Jan 18 '16 at 21:20
  • see [Which is the best way to estimate measure of photographed things?](http://stackoverflow.com/a/34085449/2521214) – Spektre Jan 19 '16 at 08:49

1 Answers1

3

Circle with perspective is an ellipse. So you basicly you need an ellipse detector. This algorithm should work:

  1. Detect all ellipses in the given image.
  2. Filter ellipses that you think they are not a circles in origin. (This is not possible using just 1 Camera so you have to depend on previous knowledge. Something like that you knows that you are taking a photo for a circle).
  3. mmm I stopped typing here and bring a paper&pen and started figuring how to estimate the Homography and it is not that easy! you should deal with the circle a special case of an ellipse and then try to construct a linear system of equations. However, I made quick googling :

https://www.researchgate.net/publication/265212988_Homography_estimation_using_one_ellipse_correspondence_and_minimal_additional_information

http://www.macs.hw.ac.uk/bmvc2006/papers/306.pdf

Seems very interesting topic, I am going to spare sometimes on it later!

Humam Helfawi
  • 19,566
  • 15
  • 85
  • 160