Project 3 Report: Photometric Stereo
Computer Vision - CS766
by Kong Yang

Description

In this project, I implemented the Photometric Stereo algorithm using matlab. I haven't used matlab for over 7 years so I had to get used to it again. The source code for the program is located in the source folder. The image created by the program is located here.


Photometric Stereo Program

The Photometric Stereo algorithm used was the four steps described in the project step description: 1) calibration (find the light direction vectors), 2) find the normals from the images, 3) solve for the color albedo, and 4) use least square to calculate a surface fit.


Here is an example of how to use the matlab code (assuming all the images are in the current working directory):

lightVectors = pv_GetLightVectors('chrome.mask.bmp', char('chrome.0.bmp','chrome.1.bmp','chrome.2.bmp','chrome.3.bmp','chrome.4.bmp','chrome.5.bmp','chrome.6.bmp','chrome.7.bmp','chrome.8.bmp','chrome.9.bmp','chrome.10.bmp','chrome.11.bmp'))

[z, a1, a2, a3] = pv_GetImageNormalAndAlbedo('rock.mask.bmp', char('rock.0.bmp','rock.1.bmp','rock.2.bmp','rock.3.bmp','rock.4.bmp','rock.5.bmp','rock.6.bmp','rock.7.bmp','rock.8.bmp','rock.9.bmp','rock.10.bmp','rock.11.bmp'), lightVectors);

pv_GetSurfaceFit(z);

Results

Here are the image normals, albedos, and surface fit created using the Photometric Stereo algorithm I implemented.

Images of Normals:




Images of Albedos:




Images of Surface Fit:







The results from the reconstruction seemed pretty good to me. The images look good if you look at it from a frontal view. If you look at the images from the side, you will notice that the depth calculated are not very accurate. I'm assuming this is because we only have one image to determine the normal of a point. Maybe if more images from different angles were taken, the we could probably calculate a better estimate for the normal of a point.

While implementing the algorithm, the finding the normals from the images step does not mention which color channel to use. After testing each channel individually, I decided to use the grayscale intensity to find the image normals.