LAB 8
STEREO RECONSTRUCTION
Source Code
|
|
|
|
|
|| Lab2 ||
Lab3 ||
Lab4 ||
Lab5 ||
Lab6 ||
Lab7 ||
Lab8 ||
Back to Main Menu
________________________________________________________________________________________________________________________
Aim of this lab:
The aim of this laboratory is to use the
calibration data calculated in Lab 7 on the images, stereo1.jpg and stereo2.jpg
to reconstruct 3D information about the scene in these images.
________________________________________________________________________________________________________________________
The main task in stereo reconstruction is the matching of points in one image to the corresponding points in the other image. Normally this is done via correlation using epipolar geometry and other matching constraints to speed the process and maximise the reliability of matching.
For simplicity in this lab exercise we will do the matching of points
manually.
Below are the two stereo images showing the order of the points. The order of
the points for both image must be the same.

Figure1: stereo1.jpg
Figure2: stereo2.jpg
In this lab, we have been ask to write a Matlab function, stereo.m which solves the stereo equations and return the 3D coordinates of the points in pt3D. This is done by loading the data saved in Lab7 and then the stereo.m function will prompt us to digitise some points in the first image. After that, points with the same order as the first image is digitised on the second image. By executing the stereo.m function, we will get the 3D coordinates of the objects, length of each edges of the objects as well as a plot of the objects in 3D. The result can be seen below:
MATLAB Command:
load my data
%load the data saved in
Lab7
pt3D = stereo(im1, im2, C1, C2);
%execute the stereo function

Figure3: stereo1.jpg with digitised
points
Figure2: stereo2.jpg with digitised points (same order as stereo1.jpg)
The 3D coordinates of the objects obtained from MATLAB are:
|
pt3D = |
With reference of the 3D coordinates above, we can estimate the 3D coordinates
for the 2 missing points in the Box and the Cube. Take a look at the tables
below:
3D Coordinates for the Box:
| Point | X- Coordinate | Y-Coordinate | Z-Coordinate |
| 1 | -285.0076 | 184.9605 | 130.5783 |
| 2 | -165.7629 | 185.8230 | 132.8647 |
| 3 | -175.9264 | 22.2556 | 138.6359 |
| 4 | -293.3556 | 20.2282 | 140.2896 |
| 5 | -287.7922 | 180.7360 | -3.4177 |
| 6 | -292.5722 | 19.4612 | 3.3702 |
| 7 | -175.0988 | 19.9526 | 1.4538 |
|
missing point 1 (estimated) |
-165.7629 | 185.8230 | 1.4538 |
3D Coordinates for the Tetrahedron:
| Point | X- Coordinate | Y-Coordinate | Z-Coordinate |
| 8 | -87.2837 | -64.3753 | 1.2445 |
| 9 | -66.3502 | -137.8759 | 121.4227 |
| 10 | 22.6434 | -164.5863 | -3.9074 |
| 11 | -133.7247 | -189.4069 | -1.3756 |
3D Coordinates for the Cube:
| Point | X- Coordinate | Y-Coordinate | Z-Coordinate |
| 12 | 131.7567 | -90.3058 | 66.7065 |
| 13 | 195.3824 | -98.7471 | 68.9713 |
| 14 | 202.0552 | -153.5293 | 62.2249 |
| 15 | 135.4818 | -148.3356 | 61.3640 |
| 16 | 128.1633 | -91.7890 | 1.3447 |
| 17 | 132.0790 | -149.7171 | -4.2451 |
| 18 | 201.6670 | -153.2077 | -5.2644 |
|
missing point 2 (estimated) |
195.3824 | -98.7471 | -5.2644 |
The length of the edges of each objects is also computed. Result as shown below:
The length of each edges for the Box are as follows :
| Edge | Length |
| 1 - 2 | 1.192697e+002 |
| 2 - 3 | 1.639845e+002 |
| 3 - 4 | 1.174584e+002 |
| 4 - 1 | 1.652293e+002 |
| 1 - 5 | 1.340915e+002 |
| 2 - missing point 1 | 1.339960e+002 |
| 4 - 6 | 1.369238e+002 |
| 3 - 7 | 1.372039e+002 |
| 5 - missing point 1 | 1.221567e+002 |
| 7 - 6 | 1.174901e+002 |
| 6 - 5 | 1.614884e+002 |
| 7 - missing point 1 | 1.661531e+002 |
The length of each edges for the Tetrahedron are as follows :
| Edge | Length |
| 8 - 9 | 1.424197e+002 |
| 9 - 10 | 1.560158e+002 |
| 10 - 11 | 1.583460e+002 |
| 11 - 9 | 1.492454e+002 |
| 11 - 8 | 1.334037e+002 |
| 8 - 10 | 1.488379e+002 |
The length of each edges for the Cube are as follows :
| Edge | Length |
| 12 - 13 | 6.422322e+001 |
| 13 - 14 | 5.559787e+001 |
| 14 - 15 | 6.678120e+001 |
| 15 - 12 | 5.839408e+001 |
| 12 - 16 | 6.547735e+001 |
| 16 - 17 | 5.832877e+001 |
| 17 - 15 | 6.571177e+001 |
| 17 - 18 | 6.968298e+001 |
| 18 - 14 | 6.749120e+001 |
| 16 - missing point 2 | 6.757843e+001 |
| 18 - missing point 2 | 5.523553e+001 |
| 13 - missing point 2 | 6.748932e+001 |
Views of the 3D reconstruction of the box, tetrahedron and cube
The following figures are views from the 3D reconstruction of three objects together with the 100mm long X, Y and Z indication of the base frame:

Figure3:
Front view
Figure4: Side View

Written
by Geoffrey Liau
Last updated: 28th May 2005
liauc01@student.uwa.edu.au