The goal of this assignment is to implement a couple of different algorithms that reconstruct a surface using the concept of photometric stereo. Additionally, you will implement the specular removal technique of Mallick et al., which enables photometric stereo reconstruction of certain non-Lambertian materials. You can assume a Lambertian reflectance function once specularties are removed, but the albedo is unknown and nonconstant in the images. Your program will take in multiple images as input along with the light source direction (and color when necessary) for each image. You will also implement a second example-based photometric stereo algorithm which is based on simultaneously imaging two objects of the same material, one of which has known structure.
Implement the photometric stereo technique described in Forsyth and Ponce 5.4 and the lecture notes. Your program should have two parts:
Try this out on the synthetic dataset with three subsets of images:
You should show in your report:
Implement the specularity removal technique described in Beyond Lambert: Reconstructing Specular Surfaces Using Color (by Mallick, Zickler, Kriegman, and Belhumeur; CVPR 2005). Your program should input an RGB image and light source color and output the corresponding SUV image. Try this out first with the specular sphere images and then with the pear and squash images.
You should show in your report the following for each specular sphere, pear, and squash image:
Combine parts 1 and 2 by running your photometric stereo code on the diffuse components of the specular sphere, pear and squash images. For comparison, run your photometric stereo code on the original images (converted to grayscale) as well. You should notice eroneous "bumps" in the resulting reconstructions - the result of violating the Lambertian assumption.
For each image set (specular sphere, pear, and squash) you should show in your report:
Implement the photometric stereo algorithm described in Section 2 of Shape and Materials by Example: A Photometric Stereo Approach (by Hertzmann and Seitz). Use the algorithm to reconstruct the 3D shape of the bottle using the set of corresponding bottle and sphere images. You may find it useful to use an algorithm to speedup the nearest-neighbor search, such as a kd-tree. What are the differences in assumptions made (e.g., with respect to light source, BRDF, etc.) for this algorithm compared to the algorithm from Part 3?
You should hand in:
The following synthetic images should be used for Part 1: download here. The file contains the following data:
It is assumed that images are indexed as im1(y,x), the light source vector l1 is a normalized vector from the optical center to the light source, and the strength of the light source is a constant 1.0.
These are the old synthetic images. It is preferred that you report results for Part 1 on the new synthetic images; however, it is ok to use the old synthetic images if you have already used them in your experiments. They can be downloaded here. The first row shows the image, the second row is the file name, and the third row is the light source direction (not normalized) used to generate the image. Note that in all four images, the strength of the light sources was a constant 1.0.
![]() |
![]() |
![]() |
![]() |
| im1.png | im2.png | im3.png | im4.png |
| [0 0 -1] | [0 0.2 -1] | [0 -0.2 -1] | [0.2 0 -1] |
The following files sample1 and sample2 can be used if desired for debugging purposes (since the Synthetic Images have a less intuitive 3D structure). Each mat file contains
These images of a specular sphere (download here) are available in a matlab .mat file (graciously provided by Satya Mallick). This mat file contains,
These images of a pear with specularities (download here) are available in a matlab .mat file (graciously provided by Satya Mallick). This mat file contains,
These images of a squash with specularities (download here) are available in a matlab .mat file (graciously provided by Satya Mallick). This mat file contains,
These images of bottle and sphere pairs taken under the same lighting conditions (download here)
While a naive integration routine will probably work ok for synthetic data, it might have problems with real images. Here we provide a matlab implementation of the Horn integration technique (summarized here by Satya Mallick). You still need to write your own integration code, but if your algorithm doesn't handle real images well, use this routine instead.