


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
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
it is the solution of assignment 2
Typology: Exercises
1 / 4
This page cannot be seen from the preview
Don't miss anything!
i. To generate a set of 100 planar points on a randomly oriented plane, I have used two different approaches. Method 1: Find three points on the randomly oriented plane as the null vector of plane parameters, and then interpolate between them. This method is discussed in lecture slides. n = 100; %% create points on plane % choose random plane p = rand(4,1); %choose points on plane X = null(p') * [rand(2,n); ones(1,n)]; %convert to inhomogeneous form and plot X = X ./ [X(4, :)' * ones(1,4)]'; plot3(X(1,:), X(2,:), X(3,:), '.'); Note that a) The plane is chosen randomly. b) All points are generated in a 3xn or a 4xn format. In this way, each point is a vector and all vectors can be transformed in one go. c) The conversion to inhomogeneous form is done in a single line for all the points. This code snippet is slightly tricky but quite compact and handy. The figure which is generate it the following: If I rotate this figure, I can get it to a viewpoint that shows that the points are on a plane. To verify algebraically that the points are indeed on a plane, I can compute their dot product with the plane parameters. It should come out to be zero,
sum(p'*X) ans =
The error for a particular run comes out to be 3.0048e- 15 , which is practically zero. Since the whole script is written in a generic fashion, I can run it several times to compute the error. I ran this script 1000 times. The average error that I got was 3.0353e- 09 , with max as 1.2128e- 06 and min as 5.5584e- 16. It turns out that most of the time, the error is very low (median 4.3848e- 14 ), but a few times, the error comes out to be high, so the mean is relatively high. Nevertheless, even in the worst case, the error is of the order of 1e- 06 , which shows that the points are indeed representable by a homography. The plot of the error graph is given below for 1000 runs. To investigate what causes the error to be abnormally high in some cases, I put a conditional break-‐point, to pause the code when error is greater than 1e-‐08. The next time I ran the code, sure enough, I hit the break-‐point on 98th^ iteration, with an error of 4.3777e-‐08. Upon investigation, it was revealed that in this case, the points came to be mapped almost to a line. The SVD of H showed that the three singular values were 8.06, 0.42, 0.0046. With the third value being about 1000 times smaller than the first value, the matrix is ill conditioned. Since I chose everything randomly, such a case can occur, which yields larger error than expected. However, as shown above, this case occurs infrequently.