 |
Downloadable:
|
 |
Run unzip to
extract all the files.
|
 |
List of
functions/data included in the file lab1.zip.
 |
mp2.m
Frame code that you can use to start work with. |
 |
reconstruct_twoview.m An empty function. You need to add contents
into this function to finish the reconstruction. |
 |
1.jpg -
Image of the first view of the object
|
 |
2.jpg -
Image of the second view of the object
|
 |
cube_data.mat
Data of points and correspondences of the two images and the calibration
matrix.
|
|
 |
Problem:
Reconstruction (points) from two calibrated views.
 |
The framework
file mp2.m will load the two images and the data into Matlab. The images are
not needed for reconstruction (unless you want to render the reconstructed
result). |
 |
The
feature points on the two images are stored in 3 by 45 matrices x1
and x2. There are 45 feature points on each image. Each column of
the two matrices is a point in image coordinate (using homogenous
coordinate representation). The corresponding two columns in two
matrices are corresponding points. |
 |
The 3x3
calibration matrix is stored in the matrix called Calib. |
 |
You need
to finish the function reconstruct_twoview.m to recontruct all the
45 feature points. |
|
 |
Important
Hints:
 |
Before
going into the eight-point algorithm, you first need to transform
all the points into calibrated coordinate by multiplying the inverse
of the calibration matrix. |
 |
In order
to avoid numerical problem, in the eight-point algorithm, you need
to normalize the vectors by their mean and variance before doing SVD.
For example, your normalization is xtemp1=K1*x1, xtemp2=K2*x2.
After geting the essential matrix Etemp for the normalized vectors,
take E=K2'*Etemp*K1 to get the essential matrix E for the original
vectors x1, x2. |
 |
In the
eight point algorithm, you will get 4 solutions. Only one solution
will give you positive depth for ALL the reconstructed points.
So unique reconstruction can be get by checking the sign of the
depth. |
 |
The
result should be similar like this. Check if the angle is a right
angle. |
 |
 |
Your Job.
 |
Finish the
reconstruct_twoview.m to reconstruct the points in 3-D.
|
 |
Both your MATLAB
codes and results must be turned in. If you insist on coding in C or C++, it
is fine too. But you must include clear instructions on how to execute your
files.
|
|