Assignment 3

3. Stereo Pinhole Camera


3.0 Collaboration Acknowledgment

For this assignment, I worked in group with Yi Ren, Danwei Li, and Akash Abhijit Bapat.


3.1 Description and requirements

This assignment explores generalized pinhole photography. The basic assignment will be to make a stereo (anaglyph) pinhole camera and use the images to reconstruct the depth of objects in a scene. The next part of the assignment will be to make pairs of images to compute "anti-pinhole" images. The graduate extensions will be to use high dynamic range to improve the quality of the anti-pinhole images and to use automated techniques for correspondence in stereo reconstruction.


3.2 Stereo Pinhole Camera Build-Up

We built up a stereo pinhole camera. We used a paper-card box as the camera body, and used the red and green transparent papers as the filters on the two pinholes respectively. We also used black papers to cover the corners and edges of the box to prevent noise light as well as every internal surface this box, except the one that is supposed to be the screen, where we used a pure white paper.

The following pictures show how our stereo pinhole camera looks like.


3.3 Anaglyph Photographs

Leveraging the camera we built, we got the anaglyph photographs and we separated anaglyph color channels to get stereo image pairs. Because of the relatively small size of the pinholes, we got little light into our camera box. Therefore, in order to acquire visible stereo image pairs, we multiplied the pixel values in our stereo image pairs by a constant 5. We also recovered the upside-down anaglyph to correct direction, i.e., the stereo image pairs are not upside-down.

The code is split.m.

The following pictures are our results.

scene1_anaglyph
scene1_left
scene1_right
scene2_anaglyph
scene2_left
scene2_right
scene3_anaglyph
scene3_left
scene3_right

3.4 Correspondence

3.4.1 Manual Correspondence

In this part, we manually determine the corespondent points in the two images of a pair, and then compute the depth of the point.

The code is ManualCorrespondence.m and twoPointsDepth.m.

The following is our results.

scene1_far
scene1_near
scene2_far
scene2_near
scene3_far
scene3_near
3.4.2 Automatic Correspondence

In this part, we automatically determine the corespondent points in the two images of a pair, and then compute the depth of the point. Since the automatically part is difficult to do with the pinhole image pairs, we took our picture pairs to do this part.

The code is AutoCorrespondence.m.

The following is our results.

scene1_left
scene1_right
scene1_match
scene1_depth

scene2_left
scene2_right
scene2_match
scene2_depth

scene3_left
scene3_right
scene3_match
scene3_depth

3.5 Anti-pinhole

We used a small ball supported by a transparent ruler to do the anti-pinhole part. Since the conditions, such as lights, stability of the ball, noise, are not ideal, we can only get blurred images, but the colors make sense.

The code of HDR is HDR.m.

The following is our results.

scene1_without_ball
scene1_with_ball
scene1_anti-pinhole
scene1_real-world

scene2_without_ball
scene2_with_ball
scene2_anti-pinhole
scene2_real-world

scene3_without_ball
scene3_with_ball
scene3_anti-pinhole