Skip to content

Get 3-D picture by using lighting image from three sides

Notifications You must be signed in to change notification settings

jianwu21/Photometric-Stereo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Photometric-Stereo

Implementation

There are a couple of assumptions made for the datasets, we are assuming the materials are perfectly matte (Lambertian), the pictures are all from the same camera angle but with varying light angles. According to Lambert’s law, for a given pixel at [u, v],

Where I is the vector of k observed intensities, S is the known k x 3 matrix of normalized light directions, and M is the surface normal that we need. The algorithms is then for each (valid) pixel [u, v] in image domain, solve m(u, v) via Moore-Penrose pseudoinverse or equation selection. Then we get the albedo and normal with the following equation:

Code

Please make sure your python env is python2.7
Run:

python Buddaha.py

and

python Buddaha_improved.py

Beethoven

The original image from three directions of light.

Then we can get the 3D image from these images.

Buddaha

Improvement

we made some improvements for the Buddha dataset. We found out that using all 10 observations in the dataset with Penrose inverse doesn’t provide a satisfying result, and decided to use equation selection with 3 good measurements selected out of 10. We first tried the method of choosing the image with highest de tMabc , but then the result has nan for all z at all points, thus we abandoned this method, and decided to hand pick the images. In order to find the final normal vector n, we must have images that have light emitting from left, centre, and right, thus we have 3 types of images by light angle, [0,1,2,3],[4,5],[6,7,8,9], thus 4 x 2 x 4 = 32 choices. Since finding z value for all choices and creating a 3-d rendering is very slow, we calculated all possible z values and produced a contour map, which is a much faster process. Eventually we chose [1,4,7] for the equation.

About

Get 3-D picture by using lighting image from three sides

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages