Home

SIGGRAPH 2008 Computational photography

Glare Aware Photography: 4D Ray Sampling for Reducing Glare Effects of Camera Lenses

Ramesh Raskar, Amit Agrawal, Cyrus Wilson, and Ashok Veeraraghavan

The idea

Separate the glare. Reveal the scene.

Glare reduces image contrast through scattering and reflections inside the camera. By analyzing light in 4D ray space, we identify glare as an outlier and reduce or manipulate it from a single exposure, without reconstructing a complete 4D light field.

Single-exposure photograph of a person against a sunlit window, with glare manipulation and glare-reduced results
A person stands against a sunlit window in the original photograph (middle). Reflection glare generated inside the lens is extracted and manipulated (left), or reduced to reveal the face with improved contrast (right). All results come from a single exposure.

01 / Full-resolution glare reduction

Reduce glare while preserving spatial detail

A randomized mask samples rays so that glare can be identified statistically. The full-resolution approach processes the result in the 2D image domain.

Full-resolution glare reduction using a randomized pinhole array, calibration, outlier detection, and interpolation
A randomized pinhole array mask is used at f/4. A projector outside the pictured scene causes glare. Dividing the captured photograph by a calibration photograph removes the mask effects, while glare appears as high-frequency 2D noise.

Comparing the calibrated ratio image with its median-filtered output produces a glare outlier stencil. Interpolating the affected pixels from neighboring pixels reduces glare without reducing spatial resolution.

02 / Outdoor examples

A single shot, captured handheld

The method does not require a sequence of high dynamic range exposures. These four animated examples show glare reduction from individual outdoor photographs, captured with the camera used as a regular handheld camera.

Animated outdoor glare-reduction comparison 1
Outdoor example 1 · single exposure
Animated outdoor glare-reduction comparison 2
Outdoor example 2 · single exposure
Animated outdoor glare-reduction comparison 3
Outdoor example 3 · single exposure
Animated outdoor glare-reduction comparison 4
Outdoor example 4 · single exposure

Glare arises due to multiple scattering of light inside the camera’s body and lens optics and reduces image contrast. While previous approaches have analyzed glare in 2D image space, we show that glare is inherently a 4D ray-space phenomenon. By statistically analyzing the ray-space inside a camera, we can classify and remove glare artifacts. In ray-space, glare behaves as high frequency noise and can be reduced by outlier rejection.

While such analysis can be performed by capturing the light field inside the camera, it results in the loss of spatial resolution. Unlike light field cameras, we do not need to reversibly encode the spatial structure of the ray-space, leading to simpler designs. We explore masks for uniform and non-uniform ray sampling and show a practical solution to analyze the 4D statistics without significantly compromising image resolution.

Although diffuse scattering of the lens introduces 4D low-frequency glare, we can produce useful solutions in a variety of common scenarios. Our approach handles photography looking into the sun and photos taken without a hood, removes the effect of lens smudges and reduces loss of contrast due to camera body reflections. We show various applications in contrast enhancement and glare manipulation.