Description
Stereo/Disparity:
1) Compute a disparity map for the images left.png and right.png (having parallel
optical axes) using the basic stereo matching algorithm. Use your NCC function to
perform the template matching for each patch in the left image searching in the right
image (search only leftward from the starting point along each row!), and use a
window size of 11×11 pixels. To make things run a bit faster for Sayan, when
searching leftward, only move up to 50 pixels to the left (instead of to the edge of the
image). Use the following Matlab code to display the disparity map D with a gray
colormap and clip the disparity values at 50 pixels. [5 pts]
figure;
imagesc(D, [0 50]); axis equal;
colormap gray;
Classification:
2) Write an implementation of the simple k-Nearest Neighbors (kNN) algorithm to
classify data points.
Use the points in file train.txt as training data (this file contains 1 row for each data
point where the first two columns are x,y coordinates and the third column is the
ground truth classification label). Classify all the test data points in the file test.txt
(formatted in the same way) using K=1. Calculate and report the accuracy of your
algorithm (compared to the third column ground truth of the test data). Plot the test
data points, color coded by the class label your algorithm gives (use plot() options
‘r.’ and ‘b.’). On the same figure (use hold on/off), (re)plot the points which are
misclassified (use plot() option ‘ko’ or something similar to easily identify these
points). Repeat this for K=5, 11, and 15. Compare the results for different values of
K. [4 pts]
(Note: You may use the Matlab function knnsearch()for part of this problem.)
3) As usual, turn in and upload your material.