ECE 47: Homework 5 Due Tuesday, October 7 in class @:3pm Seth Hutchinson Luke A Wendt
ECE 47 : Homework 5 Consider a camera with focal length λ = Suppose the optical axis of the camera is aligned with the world x-axis, the camera x-axis is parallel to the world y-axis, and the center of projection has coordinates [,, ] w For the the points listed below, compute the camera frame coordinates Indicate if any of these points will not be visible to a physical camera, and then compute the image plane coordinates for every visible point x w y w z w x c y c z c visible? u v 3 3 3 4 3 3 A stereo camera system consists of two cameras that share a common field of view By using two cameras, stereo vision methods can be used to compute 3D properties of the scene Consider stereo cameras with coordinate frames o and o such that H = b Here, b is called the baseline distance between the two cameras Suppose that a 3D point p projects onto these two images with image plane coordinates [u, v ] in the first camera and [u, v ] in the second camera Determine the depth, z = z = z, of the point p = [x, y, z] T 3 Show the projection of a line in R 3 is a line in the image plane A geometric explanation will be sufficient 4 Consider two lines in R 3, given parametrically by x y z = p i + α i n i, i {, }, in which p i = [ x i y i z i ] T is a point in R 3 on line i, and α i R is the distance traveled from this point along the direction n i given as a unit normal vector in R 3 with n T i n i = If the lines are parallel, then n = n = n = [ n x n y n z ] T Show the projections of these two lines in an image plane intersect at a single point This point is called the vanishing point 5 Show that the vanishing points for all 3D horizontal lines must lie on the line v = of the image plane Page of 4
ECE 47 : Homework 5 5 6 Suppose the vanishing point for two parallel lines has the image coordinates [u, v ] Show that the direction vector for the 3D line is given by u n = v u + v + λ λ in which λ is the focal length of the imaging system 7 Two parallel lines define a plane Consider a set of pairs of parallel lines such that the corresponding planes are all parallel Show that the vanishing points for the images of these lines are colinear Hint: let n be the normal vector for the parallel planes Π i and exploit the fact that n T i n = for the direction vector n i associated to the i th line 8 Optimal Thresholding: An image consists of an object and a background The probability that a randomly selected pixel belongs to the background is given by P, with < P < Similarly, the probability that a randomly selected pixel belongs to the object is given by P, with < P < The probability that a background pixel (resp object pixel) will have intensity value z is given by f (resp f ): f (z) = e (z µ ) σ, f (z) = e (z µ ) σ () πσ πσ Assume that µ < µ (ie, the background is darker than the object) Suppose now that a single threshold t is to be selected, such that any pixel with intensity z will be labeled as background if z t, and as object if z > t There are two possible kinds of error that can be made when applying the rule: (i) a background pixel has intensity z > t, or (ii) an object pixel has intensity z t The former case is called a false positive, and the latter is called a false negative For a given threshold t, denote the probability of a false positive by E (t), and the probability of a false negative by E (t) These probabilities are given by E (t) = t P f (z)dz E (t) = The total probability of error is, P err (t) = E (t) + E (t) 8 (a) t P f (z)dz () Assuming σ σ, find an expression for t that minimizes P err (t) The expression will be a quadratic function of t, parameterized by P, P, σ, σ, µ, and µ This expression should not contain any integrals 8 (b) Suppose that σ = σ Find a closed form expression for the optimal value of t Page of 4
ECE 47 : Homework 5 8 9 Extra Credit: Inverse Homography Consider two image planes (prime and unprime) and point i with projected coordinates [, vi ]T and [, vi ]T in the image planes Expressing these as homogeneous coordinates, they have the linear relationship h γ vi h h3 h3 h3 vi, h33 h h3 where γ = h3 + h3 vi + h33 This can be rewritten in nonlinear form as (h3 + h3 vi + h33 ) (h3 + h3 vi + h33 ) vi h h h h3 h3 vi For N points, these equations can be expressed linearly with respect to the unknown values of H with ~ = AH un vi un vi vi un un un {z A vi vi vi vi un un } h h h3 h h3 h3 h3 h33 ~ that minimizes, (AH) ~ T (AH) ~ =H ~ T (AT A)H, ~ which should ideally This equation can be solved by finding H T T be zero The matrix A A is symmetric and can be decomposed into V DV, where D is a diagonal of eigenvalues and V is an orthogonal matrix In Matlab, this can be computed with, [V,D] = eig(a *A) The ~ This can be computed in Matlab eigenvector with the smallest eigenvalue will be the optimal choice for H with, [value,index]=min(diag(d));vech=v(:,index) H 9 continued on next page Page 3 of 4
ECE 47 : Homework 5 9 (continued) If the first four corners are given by Point : [u, v ] = [ 9, 9] [u, v ] = [, ] Point : [u, v ] = [, 387] [u, v ] = [, ] Point 3: [u 3, v 3 ] = [9, ] [u 3, v 3] = [, ] Point 4: [u 4, v 4 ] = [86, 497] [u 4, v 4] = [, ] and the 5 th point gives the center of the ball at [u 5, v 5 ] T = [96, 38] T, what is [u 5, v 5] T? Page 4 of 4