Photo Forensics from Flash Photography (part 2/3)
Hany Farid |
Tuesday, November 27, 2012 at 6:00AM Last week I described how differences in the location of the built-in camera flash can provide useful information in the forensic analysis of an image. The basic insight behind this authentication technique is that the location of the flash affects the shadows cast onto a wall or ground plane. Here I will describe how these effects can be quantified and how we can determine if a shadow cast by a flash is physically consistent with a specific camera model.
This technique involves a bit of geometry and algebra. I’ve organized things so that you can just read the main points to understand the gist of how this technique works without digging into the math. If you read the full detail for each step you’ll learn how to apply this technique yourself.
Shown below is a top view schematic of an object (red circle) being imaged in front of a wall (horizontal black line). Shown on the left are two rays of light from the flash that graze either side of the object (yellow lines), and the resulting shadow cast onto the wall (thick black line). Shown on the right is the portion of the cast shadow that is visible from the camera (dashed black lines).
Note that in this figure, the point on the object (B), its corresponding point on the shadow (A) and the flash (L) lie on a straight line. This is the basic constraint that any cast shadow from a flash must satisfy. Next we’ll describe this constraint in a bit more detail. (For an overview, you can skip the bulleted and indented items, but for those interested in implementing this technique, these details will fully describe this analysis).

- The first step is to define all of the variables we are dealing with. In this case, we need to concern ourselves with corresponding points on the object and the shadow, and the line that connects them to the camera flash. We also need to consider the locations on the camera sensor (and thus the resulting photo) where the object and shadow points are imaged.
- In the above figure I have labeled the right-most portion of the cast shadow as A, its corresponding point on the object as B, and the flash as L. I have also labeled the projected location of the shadow and object points in the image plane as a and b. Let’s denote the coordinates of the points A and B as [XA ZA] and [XB ZB], where the Z-coordinate corresponds to the distance in depth between the camera and objects in the scene. Note that for simplicity, I am describing this projection for a two-dimensional scene and a one-dimensional camera; the same basic equations hold for a three-dimensional scene and two-dimensional camera.
- We can apply the rules of perspective projection to describe the locations of the points on the camera sensor in relation to the locations of the points on the shadow and the object.
- Denote F as the camera focal length. According to the basic rules of linear perspective projection, the points in the scene A and B are imaged onto the image plane as:
- xa = -FXA / ZA
- xb = -FXB / ZB
- Denote F as the camera focal length. According to the basic rules of linear perspective projection, the points in the scene A and B are imaged onto the image plane as:
- If we know the camera focal length and how far from the camera the object and back wall are, then we can reverse the previous step and describe the location of the points on the object and shadow in relation to their locations on the camera sensor.
- We want to invert the above equations so that XA and XB are the values we’re solving for. To do so, we’ll need to know three sets of values: the focal length F (typically found in the metadata), the locations in the image of a point on object b and it’s corresponding point in the cast shadow a, and the estimated distance between the camera and subject ZB as well as the camera and back wall ZA. Given these values, we can invert the above equations to get an estimate of the horizontal coordinates of A and B:
- XA = -xaZA / F
- XB = -xbZB / F
- We want to invert the above equations so that XA and XB are the values we’re solving for. To do so, we’ll need to know three sets of values: the focal length F (typically found in the metadata), the locations in the image of a point on object b and it’s corresponding point in the cast shadow a, and the estimated distance between the camera and subject ZB as well as the camera and back wall ZA. Given these values, we can invert the above equations to get an estimate of the horizontal coordinates of A and B:
- Now that we have specified points on the object and shadow, all that remains is to specify the location of the flash. This can be determined from the camera specification in which the dimensions of the camera and location of the flash can be found.
- From the camera specification, we can estimate the horizontal displacement of the flash relative to the center of the lens XL and we can assume that the flash is in the same depth plane as the image plane ZL=0.
- We now have all of the necessary pieces for our constraint — we need only verify that the object, corresponding shadow, and flash lie on a straight line.
- If the points [XA ZA], [XB ZB], and [XL ZL] all lie on a straight line, then the cast shadow is physically consistent with the camera flash.
- Although conceptually relatively straight forward, there are some practical considerations that need to be dealt with while performing this analysis.
- In order to estimate the coordinates of the points A and B we first need to convert the corresponding image coordinate xa and xb from pixels to centimeters. This is done by multiplying xa and xb specified in pixels by the number of centimeters/pixel as provided by the camera specification. We also need to make sure that the focal length is specified in centimeters (if the focal length is specified as 35 millimeter equivalent, you will need to convert the focal length to the actual sensor size). From the camera specification, we can estimate the coordinates of L, also in centimeters. Given any set of distances ZA and ZB, we can solve the above two equations for XA and XB yielding the points A, B, and L, all of which should lie on a line.
- Of course, it is not always easy to estimate the distances ZA and ZB. However, it is usually possible to at least narrow the range of likely distances of the subject and back wall (e.g., the average inter-pupil distance for adults is 6.3cm, which can be used to estimate the distance between the person and the camera). If precise distances cannot be estimated, then a range of values can be evaluated to see which, if any, satisfy the shadow constraint. In either case, the lack of a viable solution is evidence of an inconsistent cast shadow.
And finally, note that this analysis is a special case of the shadow analysis that I have previously described (Photo Forensics From Shadows). The difference here is that we know something about the 3-D location of the illuminating light — the flash — and can therefore say something even stronger about the shadows.
Next week I’ll describe how the light that is emitted from a flash leaves behind a distinctive pattern in overall illumination in the scene, beyond just the cast shadows.


Reader Comments (1)
As a long-term fan of your work, still truly thrilled!
Eager to enjoy part 3.