Lab 12 April 18, 2016 NAME ________________________

advertisement
CSCI 512 / EENG 512
Computer Vision
Spring 2016
Lab 12
April 18, 2016
NAME ________________________
NAME ________________________
This lab assignment should be done in teams of two. Go through the exercises below and show me your results.
If you don’t finish by the end of today’s class, you may show me during the next class.
The task for today is to use the two-view structure from motion Matlab code to do some experiments on
images.
1 Cameraposeestimationfromhandpickedpoints
The first task is to use hand-picked point correspondences
estimate the essential matrix between two views, and then
determine the camera motion between the views.
to
On the course website there are two images of a cube. Run
the
program called “docube.m”. This program will bring up
Matlab’s “cpselect” tool, which allows you to hand-pick
corresponding points between the two images. Pick points
on
the two faces of the cube (at least 20 or 25 points total).
When done, close the tool using File->Close Control Point Selection Tool. This will
save the points you found in the files called “u1.mat” and “u2.mat”. When you run “docube”
again, the program will check if these files exist; and if so, will just read in the picked points instead of
requiring you to pick the points again.
The “docube.m” program then computes the essential matrix that relates the two images, and then
computes the relative pose between the cameras and the point positions.
 Display the 3D reconstructed points to show that the points indeed lie on the faces of a cube.
Show the instructor your result.
The reconstructed pose and point locations are only known up to an arbitrary scale factor. To obtain an
unambiguous result, some other information must be used. Assume that we know that the distance
between the two cameras is 50 cm.
 What are the true dimensions of the cube?
1
CSCI 512 / EENG 512
Computer Vision
Spring 2016
2 AutomaticcorrespondencesusingRANSACandthefundamental
matrix
The next task is to automatically find point
correspondences between two views of a building. We
will automatically find candidate point correspondences
by detecting and matching SIFT features. Since some
of the correspondences may be incorrect, we will use
the RANSAC algorithm to automatically find inliers
and reject the outliers.
Download the Matlab code contained in the zip file
“dofundamental.zip”. This contains three files:
 main_SIFT.m - the main program which reads the images and displays the results
 fundRANSAC.m - a subroutine called by the main program, which fits a fundamental matrix to
corresponding points using RANSAC
 fitFundamental.m - a subroutine called by fundRANSAC, which fits a fundamental matrix
to a set of corresponding points
Run the program and answer the following questions:
1. What is the fraction of SIFT points detected in the first image, that have matches to the second
image, as computed by “vl_ubcmatch”?
2. How many RANSAC iterations does it take to find the fundamental matrix and the inlier point
correspondences?
3. How fast (in seconds) does one RANSAC iteration take (everything but the graphics drawing)?
You can find this out by inserting “tic” and “toc” statements in the code.
4. What fraction of the initial point correspondences are actually inliers?
5. Assume that the camera translated 9.4 feet between the views. Approximately how long is the
left wall of the building, in feet?
2
Download