



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An assignment for students, consisting of both standard and advanced parts. The standard part includes programming exercises on ransac algorithm and line distance calculation. The advanced part involves implementing em algorithm for line fitting and estimating the number of lines that can be successfully separated using ransansac. Students are required to write functions, test their code, and submit their results.
Typology: Assignments
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Overview: This problem set will work a little different. There will be a standard part, and an advanced part. Students may choose to do either part. Alternately, they may choose to complete the standard part, and hand in any portions of the advanced part for extra credit. Not that the standard part totals 100 points, while the advanced part totals
Remember, everything you do should be turned in as a hardcopy. All code should be emailed to the TA. Write the date that you hand in assignments on the hardcopy, especially if you hand them in late. If you leave an assignment under my door on in my mailbox, always include the date.
Standard Assignment
f. Write a function to generate test data, of the form: pts = test(n). This should generate points in the square [0,50], [0, 50]. The first 8 points should come from the horizontal line y = 25, with unit variance Gaussian noise added to them (use randn). n noise points should come from a uniform random distribution across the whole image (use the function rand). Test this by running it with n = 30 and plotting the results. Plot points from the line in one color, and noise points in a different color. Turn in the plot and code. 10 points. g. Write the function [L, pts, c] = ransac(n). Generate n + 8 points using test, from 1f. Sample enough random pairs of points so there is probability greater than .95 that two will come from the line, using num_samples from 1d. For each pair of points, use verify from 1e) to find all points that are near the line, using eps = 2. Select the line that is close to the largest number of points. Return this line (L), the list of points (pts), and the number of these that actually came from the line (c, ie, the number that were among the first 8 returned by test). Run your code for n = [0, 10, 20, 50, 100, 200]. Plot c versus n for these results. Turn in your code and the plot. 25 points.
b) Consider points at 80 90 100 110 120 130 140 with weights of: 0.78 0.61 0.40 0.21 0.10 0.04 0. (these are w1, the weights relative to the first distribution. w2 = 1-w1). Compute the new weighted means of the two Gaussian distributions. (Part of Maximization step). 5 points.
c) Compute the weighted standard deviation of the Gaussian distributions, assuming they have the same standard deviation. 5 points.
Hints on 2. If unsure about these steps, consult the Matlab code from the lecture, or a standard text on probability, such as the one by Drake, or the Yair Weiss handout.
a) We use p1 and p2 to hypothesize a line (which is identical to L in this case, since p1 and p2 are noise-free). Find the expected number of points in p3 … pk that will lie within 2 of L. 5 points b) Consider the incorrect, vertical line V at x = 25. Suppose there are n noise points drawn from a uniform distribution in the image. Compute the probability distribution on the number of points that will lie within 2 of V. Hint: it may become useful to approximate this distribution with a Gaussian. 10 points c) Compute the probability that the number of incorrect noise points that lie within 2 of V will be greater than the expected number of correct points from p1 … pk that lie within 2 of L. The answer will be a function of k and n. 5 points d) Now, put all this together to estimate the probability that RANSAC will produce the right answer. Suppose that there are k points from a line, and n noise points from a uniform distribution. For k = 10, and n = 10, 30, 50 compute the number of random pairs of points we must sample to ensure at least a 95% probability that one pair comes from the line. Use the simplified assumptions of (a) to estimate the expected number of points that will be matched to that line. Then, simplify by assuming that all incorrect lines match noise points with the distribution you computed in (c). What is the probability that one of the incorrect lines will match more points than the expected number of points that the correct line will match? 25 points.
Consider three collinear points, p1 = (0,0), p2=(10,0), p3=(20,0). Suppose each point is perturbed by independent, identically distributed 2D Gaussian noise with sigma 1. Call the noise vectors n1, n2, n3, so that the perturbed points are: q1 = p1+n1; q2 = p2+n2; q3 = p3+n3. Let L be the line passing through q1 and q2. Let d be the distance from L to q3. Compute the probability distribution of d.
This document was created with Win2PDF available at http://www.daneprairie.com. The unregistered version of Win2PDF is for evaluation or non-commercial use only.