Warning

# Homework 08 - Epipolar geometry

### Implementation

FF = u2F( u1, u2 )

Create function u2F computes the fundamental matrix using the seven-point algorithm from 7 euclidean correspondences u1, u2, measured in two images. For constructing the third order polynomial from null space matrices G1 and G2, there is the u2F_polynom function in the tools repository, that can be used in your code. There can be multiple solutions; return all solutions as a list of matrices (np.array) in python (FF = [ F1, F2, … ]) or a cell array of matrices in matlab (FF = { F1, F2, …};).

### Input Data

The images and the point correspondences can be downloaded from the InputData.

There is a set of point matches between the images above. Additionaly, there is list of edges - indices of a points, that form an edge (1-based). There is also list of 12 indices of points ix, (1-based) that should be used for estimating epipolar geometry.

### Steps

1. Find the fundamental matrix F relating the images above: generate all 7-tuples from the selected set of 12 correspondences, estimate F for each of them and chose the one, that minimizes maximal epipolar error over all matches.
2. Draw the 12 corresponding points in different colour in the two images. Using the best F, compute the corresponding epipolar lines and draw them into the images in corresponding colours (a line segment given by the intersection of the image area and a line must me computed). Export as 08_eg.pdf.
3. Draw graphs of epipolar errors d1_i and d2_i for all points (point index on horizontal axis, the error on vertical axis). Draw both graphs into single figure (different colours) and export as 08_errors.pdf.
4. Save all the data into 08_data.mat: the input data u1, u2, ix, the indices of the 7 points used for computing the optimal F as point_sel and the matrix F.

Epipolar error: for a particular fundamental matrix F, compute epipolar lines in the second image for all points in the first image, and vice versa. Then evaluate the Euclidean distances between a point and corresponding epipolar line for all points in both images, i.e. d1_i and d2_i. The epipolar error for the i-th match is defined as d1_i + d2_i.

08_eg.pdf
08_errors.pdf
08_data.mat
u2F.m
hw08.m hw08.py containing the u2F function 