ShadowCuts: Photometric Stereo with Shadows
This page contains code/data/results for an algorithm for performing Lambertian photometric stereo in the presence of shadows. Main features of the algorithm are:
- A fast graph cuts based method is used to estimate per pixel light source visibility.
- Allows images to be acquired with multiple illuminants, and there can be fewer images than light sources (so, a naive demultiplexing is not possible). This leads to better surface coverage and improves the reconstruction accuracy by enhancing the signal to noise ratio and the condition number of the light source matrix. The ability to use fewer images than light sources means that the imaging effort grows sublinearly with the number of light sources.
- The recovered shadow maps are combined with shading information to perform constrained surface normal integration. This reduces the low frequency bias inherent to the normal integration process and ensures that the recovered surface is consistent with the shadowing configuration.
- Works with as few as four light sources and four images.
Datasets:
Some of the real image datasets used in the paper can be found here:
- Girl : This dataset contains a set of 5 images (named img_i, i = 1 to 5) where img_i is acquired under light source i. It also contains another set of 4 images (img_ij, i = 1 to 4, j = i+1), where img_ij is acquired with light sources i and j turned on together. The 5 light source directions are in the matrix S. The foreground mask is present in the matrix mask.
- Frog : This dataset contains a set of 5 images (named img_i, i = 1 to 5) where img_i is acquired under light source i. The 5 light source directions are in the matrix S. The foreground mask is present in the matrix mask.
Code:
Some sample code and synthetic datasets to test it can be found here:
Within each folder, first run gendata.m (in Matlab) to generate the appropriate data files. Then, run gclabel.cpp to estimate the shadow map and normal field. Finally, run genheight.m in Matlab to integrate the normal field. The light source directions and some other parameters are hard coded in gclabel.cpp.
For other datasets of your own, you can generate the input files and the graph cuts optimization code similar to the examples shown above.
Reference:
M.K. Chandraker, S. Agarwal and D.J. Kriegman
ShadowCuts: Photometric Stereo with Shadows
[PDF]
CVPR 2007, Minneapolis, Minnesota.
Last updated March 7, 2008.