Using Edge detection on Focal Plane to Extract scene depth information

By varying focus on a camera with a single focal plane and using edge detection we can generate what is effectivelly a 3D scan of the scene by using edge detection to pick the sharpest edges. Where this concept becomes more interesting is with the use of cameras which use clever optics to allow sumultaneous captures of an image at multiple focal planes. This is done by placing optics over the sensor photosites, see Most cameras also have a facility for reporting back focal plane distance which is usually used to judge flash (speedlight) power.

This information can be added to current depth map generation algorthms to better improve quality. Further work will have to be done with respect to light sources and strong lighting reflections as these offer high contrast edges even when out of focus.

Everything below was shot with my Nikon SLR by manually changing focus and shooting at regular(ish) intervals. This is a proof of concept.

The GIF below was created by quickly putting together a script in MATLAB:

focus_depth.gif LCH_7334.png

These images were formed by compiling the edge traces of all prior shots:


5 Dec 2012