Dense three-dimensional reconstruction of a scene from images is a challenging task. Usually, it is achieved by finding correspondences in successive images and computing the distance by means of epipolar geometry. In this paper, we propose a variational framework to solve the depth from motion problem for planar image sequences. We derive camera ego-motion estimation equations and we show how to combine the depth map and ego-motion estimation in a single algorithm. We successfully test our method on synthetic image sequences for general camera translation. Our method is highly parallelizable and thus well adapted for real-time implementation on the GPU.