Computer Graphics in Spain: a Selection of Papers from CEIG 2009Compositing images through light source detection
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)
- et al.
Numerical methods for shape-from-shading: a new survey with benchmarks
Computer Vision and Image Understanding
(2008) Rendering synthetic objects into real scenes: bridging traditional and image-based graphics with global illumination and high dynamic range photography
- et al.
Coherent radiance capture of scenes under changing illumination conditions for relighting applications
The Visual Computer
(2010) - 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....
- 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...
- et al.
Interactive digital photomontage
ACM Transactions on Graphics
(2004) - et al.
Photo tourism: exploring photo collections in 3d
ACM Transactions on Graphics
(2006)
Finding the illuminant direction
Journal of the Optical Society of America A
Improved methods of estimated shape from shading using the light source coordinate system
Robot vision
Irradiation direction from texture
Journal of the Optical Society of America
Multiple illuminant direction detection with application to image synthesis
IEEE Transactions on Pattern Analysis and Machine Intelligence
A simple strategy for calibrating the geometry of light sources
IEEE Transactions on Pattern Analysis and Machine Intelligence
Using specularities to recover multiple light sources in the presence of texture
Estimation of illuminant direction and intensity of multiple light sources
Eyes for relighting
ACM Transactions on Graphics (Proceedings of ACM SIGGRAPH)
Cited by (45)
Image forgery detection confronts image composition
2017, Computers and Graphics (Pergamon)Citation Excerpt :After splicing an object in an image, for instance, a forger could add convincing shadows and change its lighting, making it harder for both human analysts and forensic techniques to detect it. Indeed, it is a concern in image composition when the source and target lighting conditions are different, and there is research focused on correcting this issue [82,83]. Due to the variety of lighting techniques, it is hard to make a general statement about them from a forensics point of view.
Intrinsic Harmonization for Illumination-Aware Image Compositing
2023, Proceedings - SIGGRAPH Asia 2023 Conference Papers, SA 2023StyleLight: HDR Panorama Generation for Lighting Estimation and Editing
2022, Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)Single-Shot Multi-light-Direction Searching on Discretized Lighting Space
2021, SN Computer ScienceOutdoor illumination estimation for mobile augmented reality: Real-time analysis of shadow and lit surfaces to measure the daylight illumination
2020, VISIGRAPP 2020 - Proceedings of the 15th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications