The goal of the lab is to learn the essentials about pinhole camera model [lecture PDF] and how to solve a constrained least square (LSQ) minimization problem [lecture PDF].
Download the image poly.png
. The image
shows an artificial 400 x 400 x 400 cube (the units are not important
in this part). Each of the squares painted in the side of the cube is
100 x 100. The image is the projection of the object with a pinhole
camera.
Assume the cube to be a calibration object. Define a world coordinate
system. The most convenient would be perhaps to define on the
cube. For the sake of clarity draw the x,y,z axes to the
image. The best is perhaps to use Matlab function line
but you can use an interactive editor, too.
Grading: [1 point(s)] Clarity will be evaluated.
Locate a set of 2D points in the image. You may consider to use the
Matlab functions
ginput
or
getpts
. Plot the
located coordinates to the images and label them with numbers.
Update TS 2007-11-07 10:49 Start:
Save the 2D<->3D
correspondences to the disk in ASCII format by using
save
function
:End of update.
Grading: [1 point(s)]
Estimate the camera parameters, which means, compute the 3x4 camera
matrix P
. Implement it in a form of function
P=computeP(u,X)
, where u
will be a matrix
containing coordinates of pixel points and X
matrix with
corresponding 3D points. Check the correctness by measuring the sum of
square residuals.
Grading: [3 point(s)] Clarity, correctness, efficiency will be evaluated.
Reprojection error. Project the calibration points to the image by
using the computed P
matrix. Display the projections and
compute the 2D reprojection error. Do the analysis also for some
points that were not used for the calibration.
Grading: [2 point(s)] Short discussion about the results is expected.
Insert a simple 3D object to the scene. Prepare a simple wire model of a cube a canonical position by specifying corner points. Attach the model to one of the sides of the cube with a proper perspective model.
Grading: [3 point(s)] Mainly the functionality will be evaluated
Prepare one Matlab script that will execute the whole processing pipeline. Update TS 2007-11-07 11:17 Start: Your script must not ask for a human intervention. It will read the calibration data (text file) from a disk and display the 2D points to the image. :End of update. Don't forget to comment you codes, especially the functions. Pack all the codes and the image and upload it.