## Photo forensics from shadows

For the past decade I’ve been developing forensic techniques for determining if an image is a forgery. The general philosophy that I have adopted is to first concede that there is no single technique that can detect all forms of digital manipulation. I have, therefore, been developing a number of different forensic tools each tailored to detecting specific forms of photo manipulation – some of these techniques operate on subtle pixel-level statistics that are invisible to the human eye, and others operate on geometric properties that can sometimes be seen with a trained eye.

For example, in the image shown below, the bottle’s cast shadow is clearly incongruous with the shape of the bottle (as is the shadow on this cover of Time Magazine). Such obvious errors in a shadow are easy to spot, but more subtle differences can be harder to detect.

Shown below are two images in which the bottle and its cast shadow are slightly different (the rest of the scene is identical). Can you tell which is consistent with the lighting in the rest of the scene?

The geometry of cast shadows is dictated by the 3-D shape and location of an object and the illuminating light(s). It turns out, perhaps somewhat surprisingly, that there is a simple and intuitive 2-D image-based geometric analysis that can verify the authenticity of shadows.

Locate any point on a shadow and its corresponding point on the object, and draw a line through them. The best points to use are the corners of an object for which it is easier to match shadow and object. Repeat for as many clearly defined shadow and object points as possible. As you do this, you will find that all of the lines should intersect at one point – the location of the illuminating light.

Here is the basic intution for why this image-based construction works. Since light travels in a straight line, a point on a shadow, its corresponding point on the object, and the light source must all lie on a single line. Therefore, the light source will always lie on a line that connects every point on a shadow with its corresponding point on an object. Because under the rules of perspective projection, straight lines project to straight lines, this basic geometry is preserved in the 2-D image of a scene. Notice that this constraint holds regardless of the shape or orientation of the surface onto which a shadow is cast.

Shown below are the results of this simple geometric analysis, which clearly reveals the second bottle to be the fake.

In practice, there are some limitations to a manual application of this geometric analysis. Care must be taken to select appropriately matched points on the shadow and the object. This is best achieved when the object has a distinct shape (the corner of a cube or the tip of a cone). In addition, if the dominant light is the sun, then the lines may be nearly parallel, making the computation of their intersection vulnerable to slight errors in selecting matched points. And, it is necessary to remove any lens distortion in the image which causes straight lines to be imaged as curved lines which will then no longer intersect at a single point.

We are developing a suite of forensic tools that will automate and simplify the detection of fakes, one of which will almost certainly rely on the analysis of shadows.

*[CGI model credit to Jeremy Birn, Lighting and Rendering in Maya]*

## Reader Comments (1)

This is so great. Exactly what I need. However, what if there are multiple light sources?

[Care must be taken when dealing with multiple light sources (typically occurring when analyzing indoor scenes). If you can clearly see multiple shadows from a single object, then you can apply the shadow analysis and verify that there are as many common intersections as apparent light sources. If you cannot clearly determine how many light sources are present, then you probably should avoid this analysis as it is difficult to differentiate between a fake shadow and shadows due to multiple light sources. -Hany]