COS 496 - Computer Vision

Spring 2003

Course home Outline and lecture notes Assignments


Assignment 4 - Shape Matching

Due Monday, Apr. 21

In this assignment, you will implement a set of routines for determining the similarity between 3D shapes. These types of algorithms form the basis for a shape search engine such as this one, which was built by a research group here at Princeton. The steps you should implement are the following:

1. Obtaining and Loading 3D Data

Download the database of objects, in zip or tar.gz format. This consists of 75 models organized into 15 classes of 5 objects each.

You will be computing a set of shape descriptors over the 3D data. One simple way to account for the different numbers of polygons in each object is to generate a fixed number of samples randomly distributed over the surface of each object. To do this, use the pointsample program (download pointsample_Win32.exe or pointsample_Linux. If you want/need the source, you'll need pointsample.cc and the trimesh library). The usage is:

	pointsample model.ply nsamples model_points
This generates nsamples points on the mesh in model.ply, and outputs file model_points. Start with nsamples small (maybe a few hundred) for your initial experiments, then, if you determine that it helps, increase the sampling for your final results.

The pointsample program generates a file containing the 3D coordinates and normals of points, one point per line in ASCII format. To load these into Matlab and display them, try

	load model_points -ascii;
	plot3(model_points(:,1), model_points(:,2), model_points(:,3), '.');
	axis square;
As you can see, the point coordinates are in columns 1, 2, and 3; the normals are in columns 4, 5, and 6.

2. Normalization for Translation and Scale

The first thing you should do with each point set is normalize it for translation and scale. To do this, translate the data so the center of mass of the points is at the origin, then scale so the root-mean-square distance of points from the origin is 1.

3. Computing Descriptors

Compute the following descriptors:

4. Evaluating the Results: Precision-Recall Graphs

In order to see how well each descriptor does, use each model in the database in turn as a query, and order all the models in the database in order of similarity of their descriptors to that of the query (simply compare descriptors using Euclidean distance). Summarize the results in a precision-recall graph:

Precision: fraction of results that are in the same category as the query
Recall: fraction of models in the same category as the query that are among the results
So, if you compare one of the tree models against the 75-model database and the top 10 most similar models contain 2 of the 5 trees, you would have a point in your graph with recall=2/5=.4 and precision=2/10=.2 If among the 25 most similar models are 3 trees, this corresponds to recall=3/5=.6 and precision=3/25=.12

The full precision-recall graph will have points for several precision/recall values (to be precise, 5, since all the classes have 5 objects), and will be the average of the values obtained using all the objects as queries. Better performance corresponds to plots closer to the upper right-hand corner (see page 18 of this paper for examples - note that recall goes along the horizontal axis and precision is along the vertical axis).


Submitting

This assignment is due Monday, April 21, 2002 at 11:59 PM Eastern Daylight Savings Time. Please see the general notes on submitting your assignments, as well as the late policy and the collaboration policy.

Please submit:


smr@cs.princeton.edu