CS6644 Programming Assignment 1 - Photometric Stereo

Fall 2014

Due date: 11:59pm on 9/30/2014


In this assignment you'll be implementing a basic version of Photometric Stereo. Given images with different light source directions and corresponding images of a chrome ball to calibrate light directions, you'll recover surface normals, grayscale albedo, and color albedo. Then you'll implement the uncalibrated version, using the SVD to recover normals and grayscale albedo without knowledge of the light directions.


Download the data here. We provide 12 images of each of 6 test objects, as well as corresponding images of a chrome sphere for light direction calibration. Each object has a mask file which specifies which pixels are on the object. Each object also comes with a .txt file specifying the number of images for that object and listing the filenames of the images to simplify file processing.


We recommend using MATLAB to implement this assignment, since it has many of the useful tools you'll need conveniently built in. That said, you may use another language at your own peril.

  1. Calibration: The data we've provided is already quite nicely calibrated. Camera response is linear, the focal length is long, thus providing a good approximation an orthographic projection, and the light intensities are all equal. All that remains is to compute light directions for each image using the chrome sphere object. For each image of the chrome sphere, you need to come up with a 3-vector specifying the light direction. This requires the following steps:
  2. Surface Normals: Now that we have light directions and images, we can solve for the surface normal and albedo at each pixel. As discussed in lecture, we formulate and solve this as a least squares problem. See the lecture slides for details; make use of Matlab's builtin least squares solving capabilities using the / or \ operators. You should produce a grayscale albedo map and a color-coded normal map with the red, green, and blue channels representing x, y, and z components, respectively, of the surface normal vectors.
  3. Color albedo: Now that we have normals and a grayscale albedo, we can take these normals as known and solve for albedo per channel. For each channel, find the a that minimizes ||I - a(L*N)||^2. Hint: write the sum of squares explicitly, differentiate with respect to a, and set the derivative to zero. Also see the lecture slides.
  4. Uncalibrated lights: Implement the uncalibrated photometric stereo method [Hayakawa 1994] discussed in lecture, using the SVD to decompose the measurement matrix. For these simple test objects, you can manually impose constraints on albedo or light intensity in order to resolve the ambiguity in the decomposition. Keep in mind that the simple disambiguation strategy discussed in class and shown in the Hayakawa paper only resolve the ambiguity up to an unknown rigid rotation of the surface normals.
  5. Extra credit: Choose and implement one or more of the following add-ons.

What to hand in

Collaboration Policy

This assignment is to be done individually. Discussion of ideas and approaches is fine, but you must write your own code.


This assignment was adapted from a similar project assigned in UW CSE455.