# Ceiling depth with a monocular camera

Having a camera mounted on my robot and looking upwards, I want to estimate the distance of the ceiling as the robot moves and also the position of landmarks observed on the ceiling (lamps for example). I know this is a structure from motion problem but I was very confused on how to implement it. This case is a much simpler case than bundle adjustment as the intrinsic calibration of the camera is existing, the camera pose changes just in x and y directions, and the observed thing is a planar ceiling. Odometry might also be available but I would like to start solving it without. Do you know any libraries that offer a good and simple API to do such a thing? preferably based on levenberg-marquardt or similar optimization algorithms taking in more than just two observations. (Python bindings would be nice to have)

• "Odometry might also be available but I would like to start solving it without. " That won't be possible as you only have a single camera so that your reconstruction is only defined up to scale. This scale could be defined by observing an object with known size or by using the absolute scale of you odometry (if it's good enough). You can implement your problem with ceres or g2o, both are often used for this type of task to that there are already good examples for error-definitions using reprojection errors. Sep 2 '15 at 16:53
• From my understanding, in bundle adjustment similar problems there is no information about relative pose of the cameras, not even the intrinsic parameters of the camera and a reconstruction in real size 3D is possible. So what is the difference in my case? Is it the fact that I am observing a planar surface? Sep 3 '15 at 8:23
• Your reconstruction will always only be defined up to an arbitrary scale. Just google "estimating scale in structure from motion" and you will find many approaches how to estimate this scale. (cs.nyu.edu/~fergus/teaching/vision_2012/6_Multiview_SfM.pdf p.38) The scale of the scene and the focal length of your camera have the same effect on the reprojection error. Sep 3 '15 at 8:42
• what you say is that having multiple pictures from different positions delivers exactly the same amount of information as having one picture from one position (I could also define real world coordinates X and Y of observed points up to a certain assumed scale, the depth Z), of course when working with planar surfaces. Sep 3 '15 at 8:59
• You will get a 3d model, but you don't know the scale of the scene. If you could compute the scale, you could also do the intrinsic calibration of your camera without knowing the size of the pattern, right? But you need the scale as you can't distinguish a large patten that is far away from a smaller pattern that is closer to your camera. Sep 3 '15 at 9:07