An article of manufacture comprising a carrier containing computer program instructions, the computer program instructions controlling a general purpose computer to estimate both three-dimensional (3D) scene structure and ego-motion from a batch of images of the scene obtained by a camera as it moves through the scene, the computer program instructions causing the computer to perform the steps of:
- defining a reference image and a plurality of inspection images in the batch of images;
- providing an initial estimate of the ego-motion and the scene structure for the batch of images;
- responsive to the initial estimate of ego-motion and scene structure, globally correlating each of the inspection images to the reference image to define a global ego-motion constraint for all of the inspection images relative to the reference image;
- refining the initial estimate of ego-motion based on the global ego-motion constraint;
- responsive to the initial estimate of ego-motion and scene structure, locally correlating each of the inspection images to the reference image to define a plurality of local structure constraints for all of the inspection images relative to the reference image;
- responsive to the plurality of local structure constraints, refining the initial estimate of scene structure in respective regions of the reference image corresponding to the plurality of local structure constraints.