Elsevier

Computers & Graphics

Volume 34, Issue 6, December 2010, Pages 698-707
Computers & Graphics

Computer Graphics in Spain: a Selection of Papers from CEIG 2009
Compositing images through light source detection

https://doi.org/10.1016/j.cag.2010.08.004Get rights and content

Abstract

Compositing an image of an object into another image is a frequently occurring task in both image processing and augmented reality. To ensure a seamless composition, it is often necessary to infer the light conditions of the image to adjust the illumination of the inserted object. Here, we present a novel algorithm for multiple light detection that leverages the limitations of the human visual system (HVS) described in the literature and measured by our own psychophysical study. Finally, we show an application of our method to both image compositing and synthetic object insertion.

Graphical Abstract

Research Highlights

► We have presented a novel light detection algorithm for single images that only requires the silhouette of any object in the image as additional user input. ► We are not limited to detecting just one light source, and no knowledge of the actual 3D geometry is required. To our knowledge no previous work has proposed a solution to such as under constrained problem. ► We have shown good results both with controlled lighting environments (where the light positions were measured and thus numerical data could be compared) and uncontrolled settings (with free images downloaded from the internet and with synthetic objects). ► We have introduced a novel image compositing method based on our light detection method, relighting and shape from shading. Our algorithm could help photographers mimic a given lighting scheme inspired by any other shot for which a reduced set of light directions (namely, the typical three-light setup made up of key, fill and rim lights) is preferable. Several existing applications could benefit from our automatic compositing system, specifically those based on combining pictures from an existing stack to create novel images (examples and results are shown in the paper). ► We have conducted a psychophysical study, confirming that our results are below a threshold where illumination inconsistencies tend to go unnoticed by human vision.

Introduction

This paper deals with the problem of obtaining the positions and relative intensities of light sources in a scene, given only a photograph as input. This is generally a difficult and under-constrained problem, even if only a single light source illuminates the depicted environment.

Traditionally, light probes are used to acquire the lighting data [1], [2]. A light probe is an object of known 3D shape and BRDF properties (Bidirectional Reflectance Distribution Function, which is a description of the reflectance properties of the material) that is positioned in the scene when the image is captured. Unfortunately, in several cases, this technique is not applicable; e.g., in paintings and in photographs taken under uncontrolled conditions. It would be possible to use any object in the image if geometry information was available to allow light source positions or directions to be estimated [3], [4]. Conversely, if the light source is known, the 3D geometry can be approximately recovered, an ill-posed problem known as shape-from-shading [5].

However, we are interested in the problem of light source recovery without the benefit of any geometric prior models. To this end, we first carried out a psychophysical experiment to quantify the accuracy with which humans can generally detect light sources. The results of this experiment were then used to validate the results of our light-detection algorithm, both numerically and perceptually. We then used any existing object in the image as a de facto light probe. We found that assuming a globally convex shape for such a light probe is sufficient to reconstruct light directions. The user only needs to identify the silhouette of the object in the image, a task similar to or simpler than other existing image-editing applications [6], [7]. We then analyzed the information in the contour and the gradients contained in the shape to infer the light directions and relative intensities.

Real environments are likely to contain multiple light sources. In practice, we found that identifying up to four sources that when combined provided similar illumination as in the image sufficed for most situations. This keeps the dimensionality of the solution manageable, in a way similar to professionally lit environments, which are usually lit by a three-light setup. Additionally, although we did assume in principle that the chosen light probe was Lambertian, we will show that this is not a strong requirement.

We believe that by analyzing the lighting consistency between images, our algorithm can help improve several types of applications, such as Photo Clip Art [7], Interactive Digital Photomontage [8] or Photo Tourism [9].

Section snippets

Previous work

The computation of light source directions from images is an ill-posed problem, with many possible solutions leading to the same observed image. As a result, assumptions about the environment must be made, known geometry must be present in the scene, or extra information must be captured to change the problem into a solvable one.

To detect single light sources, a local analysis of the surface and image derivatives may be used to estimate the direction of the light source [10], [11], [12].

Perceptual framework

Natural illumination in real environments is often complicated, making its analysis by both machines and humans difficult. Natural illumination exhibits statistical regularities that largely coincide with those found for images of natural environments [26], [27]. In particular, the joint and marginal wavelet coefficient distributions, harmonic spectra, and directional derivative distributions are similar. Nonetheless, a complicating factor is that illumination is not statistically stationary

Light detection

Consider a typical input image such as is depicted in Fig. 2a. The problem at hand was to estimate the number of illumination sources, their dominant directions and the relative intensities. We propose that any object in the image can be used as a virtual light-probe as long as it covers a reasonable area in the image. The user provides the outline defining the object, typically with the aid of a smart selection tool [37]. We do not assume any restrictions on the shape, the color or any other

Results

Once we tested the accuracy of our method with real (controlled) light configurations, we further provided a visual validation of our method by using the lights detected in an image for automatic insertion and relighting of synthetic objects. Finally, we show a novel technique of image compositing based on our light detection method.

Discussion and future work

We have presented a novel light detection algorithm for single images that only requires the silhouette of any object in the image as additional user input. Our method yields a result in less than 4 s using a 512×512 version of the original image. Although it works on lower resolution images, higher-resolution images have a smaller effect on the accuracy of the technique. It may seem that the average error of our method is too high in comparison with previous works in the field; however,

Acknowledgements

This research was funded by a Marie Curie grant from the Seventh Framework Programme (Grant agreement no.: 251415), a generous gift from Adobe Systems Inc., the Spanish Ministry of Science and Technology (TIN2010-21543) and the Gobierno de Aragón (Projects OTRI 2009/0411 and CTPP05/09).

References (49)

  • J.-D. Durou et al.

    Numerical methods for shape-from-shading: a new survey with benchmarks

    Computer Vision and Image Understanding

    (2008)
  • P. Debevec

    Rendering synthetic objects into real scenes: bridging traditional and image-based graphics with global illumination and high dynamic range photography

  • K. Jacobs et al.

    Coherent radiance capture of scenes under changing illumination conditions for relighting applications

    The Visual Computer

    (2010)
  • S. Gibson et al.

    Flexible image-based photometric reconstruction using virtual light sources

    Computer Graphics Forum

    (2001)
  • Madsen CB, Nielsen M. Towards probe-less augmented reality—a position paper. In: GRAPP, 2008. p....
  • R. Zhang et al.

    Shape from shading: a survey

    IEEE Transactions on Pattern Analysis and Machine Intelligence

    (1999)
  • Oh BM, Chen M, Dorsey J, Durand F. Image-based modeling and photo editing. In: SIGGRAPH ’01: proceedings of the 28th...
  • Lalonde J-F, Hoiem D, Efros AA, Rother C, Winn J, Criminisi A. Photo clip art. ACM Transactions on Graphics (SIGGRAPH...
  • A. Agarwala et al.

    Interactive digital photomontage

    ACM Transactions on Graphics

    (2004)
  • N. Snavely et al.

    Photo tourism: exploring photo collections in 3d

    ACM Transactions on Graphics

    (2006)
  • A. Pentland

    Finding the illuminant direction

    Journal of the Optical Society of America A

    (1982)
  • Brooks M, Horn B. Shape and source from shading. In: Proceedings of the international joint conference on artificial...
  • C. Lee et al.

    Improved methods of estimated shape from shading using the light source coordinate system

  • B. Horn

    Robot vision

    (1986)
  • Nillius P, Eklundh J-O. In: CVPR, 2001. p. I:1076–83...
  • J.J. Koenderink et al.

    Irradiation direction from texture

    Journal of the Optical Society of America

    (2003)
  • Varma M, Zisserman A. Estimating illumination direction from textured images. In: Proceedings of the IEEE conference on...
  • Hougen D, Ahuja N. Estimation of the light source distribution and its use in integrated shape recovery from stereo...
  • Y. Zhang et al.

    Multiple illuminant direction detection with application to image synthesis

    IEEE Transactions on Pattern Analysis and Machine Intelligence

    (2001)
  • M. Powell et al.

    A simple strategy for calibrating the geometry of light sources

    IEEE Transactions on Pattern Analysis and Machine Intelligence

    (2001)
  • P. Lagger et al.

    Using specularities to recover multiple light sources in the presence of texture

  • W. Zhou et al.

    Estimation of illuminant direction and intensity of multiple light sources

  • K. Nishino et al.

    Eyes for relighting

    ACM Transactions on Graphics (Proceedings of ACM SIGGRAPH)

    (2004)
  • Marschner SR, Greenberg DP. Inverse lighting for photography. In: Fifth IST/SID color imaging conference, 1997. p....
  • Cited by (45)

    View all citing articles on Scopus
    View full text