3D reconstruction using opencv and matlab

I’v worked on 3D face reconstruction project last semester, it gave me some taste about camera calibration and 3D geometry. Hare some major step:

  1. Use chessboard to calibrate each camera.
  2. Use calibrated cameras to get rotation and translation between these two cameras.
  3. Rectify two images to make them as they are taken from two horizontal frontal aligned cameras. (Correspondences are aligned on the horizontal epilines)
  4. Find correspondences using epilines, (I use BM method here) and get disparity map.
  5. Reproject disparity map into 3D space.
  6. Done.

I tested it using my own face. The result highly depends on finding correspondence, which highly depends on calibration errors. So the first thing to make sure is minimize the calibration error, and another is to choose proper parameter to find correspondences.

Here are some results:

*Calibrate using chessboard*

*Disparity map of chessboard*

*Rectified my face*

*Disparity map of my face*

*3D map of my face using color to indicate distance*

*Origin color 3D face*