Georgia Tech CS 4476 Fall 2019 edition
<your_gt_username>.zip
We know that there is some encoding of depth when the images are captured using a stereo rig, much like human eyes.
You can try a simple experiment to see the stereo effect in action. Try seeing a scene with only your left eye. Then close your left eye and see using your right eye. Make the transition quickly. You should notice a horizontal shift in the image perceived. Can you comment on the difference in shift for different objects when you do this experiment? Is it related to the depth of the objects in some way?
In this notebook, we will generate disparity maps, which is the map of horizontal shifts estimated at each pixel. We will start working on a simple algorithm which will then be evolved to give better disparity maps.
The notebook to be used for this part is simple_stereo.ipynb
.
It was once believed that in order to perceive depth, one must either match feature points (like SIFT) between left and right images, or rely upon cues such as shadows.
A random dot stereogram eliminates all other depth cues and hence it proves that a stereo setup is sufficient to get an idea of the depth of the scene.
A random dot stereogram is generated by the follow steps:
You will implement these steps in the function generate_random_stereogram()
in utils.py
. A corresponding unit test is defined in test_utils.py
.
Please read the documentation carefully.
We will use a similarity function to compare patches between left and right images. We will implement two similarity functions:
You will implement these functions in similarity_measures.py
. The corresponding unit tests are defined in test_similarity_measures.py
.
We are now ready to write the code for a simple algorithm for stereo matching.
These are the steps taken in this image (and will be implemented by you):
max_search_bound
in the code. The candidates will overlap.Note: the images have already been rectified and hence we can search on just a horizontal scan line.
The function works as follows:
Implement this in disparity_map.py
(please read the documentation carefully!). The corresponding unit tests are defined in test_disparity_map.py
.
In the error profile analysis, you have to find two examples which display convex and non-convex error profile respectively. For reference, these are the plots we obtained:
The questions for stereo on natural images are in the notebook. It is advisable to read through all the examples and questions before starting to answer them.
The questions for smoothing are in the notebook, along with an overview of smoothing. Before running this section, you will need to implement calculate_cost_volume()
in disparity_map.py
. The details for his are in the notebook as well as the code, but it will build off of your disparity map implementation.
All images in this section have been used from the Middlebury stereo dataset.