CE866 Laboratory: Assignment 2

You have been approached by a company, Wivenhoe Intelligent Systems Engineering (WISE) because of your extensive knowledge of computer vision acquired through CE866. WISE is working on a stereo system for capturing faces in 3D. To aid their development work, they are using a modified version of the Candide face model, which they have "imaged" from a model of their stereo rig using the POV-ray ray-tracer. (A ray-tracer is a program that takes a description of the components of a 3D scene, including lighting, camera and appearance, and calculates how it should appear. POV-ray is particularly attractive because this description is a kind of program.)

WISE's virtual stereo rig has identical cameras arranged so that their optical axes are precisely parallel — one of the advantages of working in simulation is that this can be guaranteed. This means that it should be possible to use the equation described in the stereo chapter of the lecture notes: Z = fB/D, where Z is the distance to the object, f the focal length, B the baseline and D the disparity of a feature between the left and right images.

Your tasks are as follows:

  1. The virtual cameras are at ±75,300,800, which means that B is 150 mm. Vertex 5 of Candide, the tip of her nose, is at location 0,289,280; hence, the distance from the cameras to it, Z, is approximately 800 – 280 = 520 mm. Measure the locations of that point in the images from the left and right cameras: use xv to display each image and press the middle mouse button on the tip of her nose to read the position. Estimate your accuracy in reading the position and, using all this information, calculate the focal length and its uncertainty ("error") as described in the lecture notes. You should use a calculator for this step, not write a program.

  2. The calculation above gives a rough estimate of the camera's parameters. However, it should be possible to do better using computer vision, a process known as camera calibration — and there are routines in OpenCV to perform this. To that end, a series of images has been rendered using POV-ray with the same cameras as for Candide but with a model of a calibration target; these are in a zip-file that you should download. Your task is to write a program using OpenCV routines that reads in these calibration frames and calibrates the cameras of the stereo rig, outputting the result.

  3. Using the data from the calibration program, calculate the distance to the tip of Candide's nose. Is this more accurate than the rough-and-ready calculation in the first part of the assignment?

  4. Include the details of your hand calculations and your interpretation of them in the comments at the top of the program.

You may write your software in C, C++ or Python.


Submission deadline: Thursday 7th December at 11:59:59 (i.e., noon)
What to submit: the source code of your program
a Makefile to compile your program if it is written in C or C++
but not the images!
Marks returned: three weeks
Marks breakdown: according to the usual assessment criteria

Remember to identify your work with your registration number. The coursework system allows you to upload your work as often as you like, so do keep uploading your files as you develop them.

Last updated on 2015-11-04 20:48:32 Web pages maintained by Adrian F. Clark [contact]