Code Monkey home page Code Monkey logo

photometric-stereo's Introduction

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.

photometric-stereo's People

Contributors

jwu-csis avatar jianwu21 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.