Computer Vision I Name : CSE 252A, Fall 2012 Student ID : David Kriegman Assignment #1. (Due date: 10/23/2012) x P. = z

Similar documents
Perspective Projection [2 pts]

CSE 252A Computer Vision Homework 3 Instructor: Ben Ochoa Due : Monday, November 21, 2016, 11:59 PM

CS6670: Computer Vision

N-Views (1) Homographies and Projection

Pin Hole Cameras & Warp Functions

Agenda. Rotations. Camera models. Camera calibration. Homographies

calibrated coordinates Linear transformation pixel coordinates

Computer Vision Projective Geometry and Calibration. Pinhole cameras

Two-View Geometry (Course 23, Lecture D)

CSE152a Computer Vision Assignment 1 WI14 Instructor: Prof. David Kriegman. Revision 0

Agenda. Rotations. Camera calibration. Homography. Ransac

Vision Review: Image Formation. Course web page:

Two-view geometry Computer Vision Spring 2018, Lecture 10

COMP 558 lecture 19 Nov. 17, 2010

Pin Hole Cameras & Warp Functions

3D Geometry and Camera Calibration

COSC579: Scene Geometry. Jeremy Bolton, PhD Assistant Teaching Professor

16720: Computer Vision Homework 1

CSE 252B: Computer Vision II

Image warping and stitching

Perspective Projection in Homogeneous Coordinates

Homework #1. Displays, Alpha Compositing, Image Processing, Affine Transformations, Hierarchical Modeling

Stereo Vision. MAN-522 Computer Vision

Rectification and Distortion Correction

Geometric camera models and calibration

CS223b Midterm Exam, Computer Vision. Monday February 25th, Winter 2008, Prof. Jana Kosecka

Reminder: Lecture 20: The Eight-Point Algorithm. Essential/Fundamental Matrix. E/F Matrix Summary. Computing F. Computing F from Point Matches

DD2423 Image Analysis and Computer Vision IMAGE FORMATION. Computational Vision and Active Perception School of Computer Science and Communication

Image warping and stitching

More Mosaic Madness. CS194: Image Manipulation & Computational Photography. Steve Seitz and Rick Szeliski. Jeffrey Martin (jeffrey-martin.

1 Projective Geometry

Homogeneous Coordinates. Lecture18: Camera Models. Representation of Line and Point in 2D. Cross Product. Overall scaling is NOT important.

Camera Calibration. Schedule. Jesus J Caban. Note: You have until next Monday to let me know. ! Today:! Camera calibration

Computer Vision I - Algorithms and Applications: Multi-View 3D reconstruction

Introduction to Homogeneous coordinates

Assignment 2 : Projection and Homography

Projective geometry for Computer Vision

Midterm Exam Solutions

MERGING POINT CLOUDS FROM MULTIPLE KINECTS. Nishant Rai 13th July, 2016 CARIS Lab University of British Columbia

Massachusetts Institute of Technology Department of Computer Science and Electrical Engineering 6.801/6.866 Machine Vision QUIZ II

ECE 470: Homework 5. Due Tuesday, October 27 in Seth Hutchinson. Luke A. Wendt

CV: 3D sensing and calibration

CS 130 Final. Fall 2015

CSE 252B: Computer Vision II

Stereo CSE 576. Ali Farhadi. Several slides from Larry Zitnick and Steve Seitz

Single-view 3D Reconstruction

Computer Vision Projective Geometry and Calibration. Pinhole cameras

55:148 Digital Image Processing Chapter 11 3D Vision, Geometry

Structure from Motion

CS 664 Slides #9 Multi-Camera Geometry. Prof. Dan Huttenlocher Fall 2003

Epipolar Geometry and Stereo Vision

EXAM SOLUTIONS. Image Processing and Computer Vision Course 2D1421 Monday, 13 th of March 2006,

COMPARATIVE STUDY OF DIFFERENT APPROACHES FOR EFFICIENT RECTIFICATION UNDER GENERAL MOTION

Recovering structure from a single view Pinhole perspective projection

Computer Vision Project-1

Exercise session using MATLAB: Quasiconvex Optimixation

Machine vision. Summary # 11: Stereo vision and epipolar geometry. u l = λx. v l = λy

CS-9645 Introduction to Computer Vision Techniques Winter 2019

CS201 Computer Vision Camera Geometry

Camera Model and Calibration

Computer Vision Projective Geometry and Calibration

CIS 580, Machine Perception, Spring 2016 Homework 2 Due: :59AM

Midterm Examination CS 534: Computational Photography

3D Reconstruction from Two Views

CIS 580, Machine Perception, Spring 2014: Assignment 4 Due: Wednesday, April 10th, 10:30am (use turnin)

MAPI Computer Vision. Multiple View Geometry

Multiple View Geometry in Computer Vision

Unit 3 Multiple View Geometry

Epipolar Geometry and the Essential Matrix

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

1 CSE 252A Computer Vision I Fall 2017

CHAPTER 3. Single-view Geometry. 1. Consequences of Projection

Image formation. Thanks to Peter Corke and Chuck Dyer for the use of some slides

Homework #1. Displays, Image Processing, Affine Transformations, Hierarchical Modeling

Mathematics 308 Geometry. Chapter 9. Drawing three dimensional objects

CHAPTER 2 REVIEW COORDINATE GEOMETRY MATH Warm-Up: See Solved Homework questions. 2.2 Cartesian coordinate system

Camera Models and Image Formation. Srikumar Ramalingam School of Computing University of Utah

Stereo imaging ideal geometry

METRIC PLANE RECTIFICATION USING SYMMETRIC VANISHING POINTS

CSE 252B: Computer Vision II

Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation

Module 4F12: Computer Vision and Robotics Solutions to Examples Paper 2

MA 323 Geometric Modelling Course Notes: Day 21 Three Dimensional Bezier Curves, Projections and Rational Bezier Curves

CS231A Course Notes 4: Stereo Systems and Structure from Motion

Epipolar Geometry and Stereo Vision

Homographies and RANSAC

Homework 1: Getting Started with WebGL and Transformations EE267 Virtual Reality 2018

CSE 252B: Computer Vision II

Mosaics. Today s Readings

2D Object Definition (1/3)

Perspective projection and Transformations

Multiple Views Geometry

Synchronized Ego-Motion Recovery of Two Face-to-Face Cameras

Short on camera geometry and camera calibration

Dense 3D Reconstruction. Christiano Gava

Week 2: Two-View Geometry. Padua Summer 08 Frank Dellaert

CIS 580, Machine Perception, Spring 2015 Homework 1 Due: :59AM

Camera Model and Calibration. Lecture-12

Metric Rectification for Perspective Images of Planes

Cameras and Radiometry. Last lecture in a nutshell. Conversion Euclidean -> Homogenous -> Euclidean. Affine Camera Model. Simplified Camera Models

Transcription:

Computer Vision I Name : CSE 252A, Fall 202 Student ID : David Kriegman E-Mail : Assignment (Due date: 0/23/202). Perspective Projection [2pts] Consider a perspective projection where a point = z y x P is projected onto an image plane Π represented by f =-k as shown in the following figure. The first, second, and third coordinate axes are denoted by i, j, and k respectively. Consider the projection of a ray in the world coordinate system Q = 2 0! " $ % + t 0 2! " $ % where t. Calculate its two endpoints. 2. Rigid Transformation [3pts] a) Consider a rigid transformation where a point A is rotated about the k-axis by the angle θ=65 (degrees) and then translated by t = 0 2! " $ % to another point A. When the two points A and A are represented in the homogeneous coordinate system by = z y x A and = z y x A

Respectively, write a 4x4 matrix M such that A = MA b) If this same point is A is translated by t then rotated by θ would the resulting M matrix be the same? Explain your answer. 3. Thin Lens Equation [3pts] An illuminated arrow forms a real inverted image of itself at a distance w = 40cm, measured along the optic axis of a convex thin lens (see Figure ). The image is just half the size of the object. a. How far from the object must the lens be placed? b. What is the focal length of the lens? c. If the index of refraction for the lens is η =.5, what is the lens radius? d. Suppose the arrow moves 5cm to the right while the lens and image plane remain fixed. This will result in an out of focus image; what is the radius of the corresponding blur circle formed from the tip of the arrow on the image plane assuming the diameter of the lens is d? w Figure : Problem 3. setup. 4. Affine Projection [2pts] Consider an affine camera and two rectangles in 3D space. These two rectangles are coplanar and have two colinear sides. Consider the four corner points (A, B, C and D) of the larger rectangle. Now consider three additional points on the same plane (E, F and G). Two of these points (E and F) lie somewhere on the lines AB and AD respectively. The last point G lies inside the rectangle such that lines EG and FG are perpendicular and lies on the same plane as A B C D E and F. This will form two co-planar rectangles (ABCD and EBFG). Now consider the area of the two rectangles on the image plane. Show that the ratio of areas between the two rectangles in the image plane is constant regardless of their orientation relative to the camera.

Figure 2: Problem 4. 5. Affine Pose Estimation [5pts] T An affine camera transforms 3D (homogeneous) points x = ( x, y, z,) according to, x = Mx () where is the camera matrix and x= ( x, y,) T a b c d M = e f g h (2) 0 0 0 is the mapping onto the image plane. Given a set of corresponding points x and x, your task is to recover the affine camera parameters. a. What is the minimum number of corresponding points needed to recover the camera parameters? b. Are there any conditions on the positions of these corresponding points for successful recovery of M? List two degenerate configurations. Can you think of a necessary condition? c. Running house_model.m will display an image of an affine transformed house. A set of 8 corresponding points are contained in the matlab variables Xcorr (original points) and Xcorr_ (affine transformed points). Write a matlab function that takes as input Xcorr and Xcorr_ and returns the affine transformation matrix, M. What is the recovered affine transformation matrix? d. Repeat part (c) using only correspondence points,3,4, and 6. What happens when you try to estimate M? Why? e. Write a second program that prompts the user to manually click the correspondence points from the

plot of the house model shown after running house model.m. Using the manually selected correspondences, compute the affine transformation matrix M. Do you get the same result as in part (c)? How sensitive is the estimation to errors in the correspondences (experiment by purposely misclicking some of the points)? 6. Programming Assignment: Image Warping and Image Merging [0pts] This is a programming assignment, which should be done in Matlab as many of the necessary numerical routines are readily available (e.g., eig or svd for the computation of the eigenvalues and eigenvectors of a matrix). All data necessary for this assignment is available on the course web page. 6.. Introduction In this assignment, we consider a vision application in which components of the scene are replaced by components from another image scene. Consider for a moment that you are watching a sporting event on television whose audience, which has a broad, possibly multinational audience. During these events, it is advantageous and profitable to use different advertisements in different markets to target more directly viewers in those regions. In this assignment you will implement a simple version of this algorithm using multiple advertisements on a single scene. Given two scenes, the natural thing to do would be to compute how your object of interest is observed in the current scene and warp it to match the destination scene. This would allow you to paste together the two images where your new advertisement overlaps the particular billboard in the new scene even though these two images were obtained in different locations. This digital replacement is accomplished by a set of points for each advertisement in both the target (scene) and advertisement images. The task then consists of mapping the points from the advertisement to their respective points in the target image. In the most general case, there would be no constraints on the scene geometry, making the problem quite hard to solve. If, however, the scene can be approximated by a plane in 3D, a solution can be formulated much more easily even without the knowledge of camera calibration parameters. To solve this section of the homework, you will first derive the transformation that maps one image onto another in the planar scene case. Then you will write a program to find this warping and apply it to multiple advertisement images, and a single target image. 6.2. Projective Transformations of the Plane To begin, we consider the projection of planes in images in the general case. Imagine two cameras C and C 2 looking at a plane π in the world. Consider a point P on the plane π and its projections p =(u,v,) T in one image and q =(u2,v2, ) T in image in another image. Fact There exists a unique (up to scale) 3 3 matrix H such that, for any point P: q Hp (Here denotes equality in homogeneous coordinates, meaning that the left and right hand side are proportional.) Note that H only depends on the plane and the projection matrices of the two cameras. The interesting thing about this result is that by using H we can compute the image of P that would be seen in camera C 2 from the image of the point in camera C without knowing its three-dimensional The matlab command ginput will be useful here.

location. Such an H is a projective transformation of the plane, also referred to as a homography. Perhaps even more interesting, a homography can also be used to represent the transformation between images of a genuine 3-D scene for multiple images taken by camera that rotates in 3-D about the optical center. 6.3. Estimating Transformations From the Image Points i i Given a set of points { u, v )}, i... N ( = in image and the corresponding set of points {(u i 2, v i 2 )},i =...N in image 2, show that H can be recovered from two sets of image points using homogeneous linear least squares (H is only defined up to scale). In this homework N = 4, and should be the 4 corners of the advertisements and the billboards. You should also note that four points should exactly solve for the homography which maps a square to an arbitrary quadrilateral and the solution for H should be unique. Write a program which computes the matrix H using the method you just derived. Input arrays should be 2 4 matrices, listing a single image point s coordinates per column. Verify your results by manually selecting two sets of corresponding image points on two of the provided images, and applying the transformation H to them. Note that, throughout this estimation procedure, camera projection matrices did not come into play at all! Hence, no calibration was necessary. Important hints: Recall that H is a projective transformation matrix and hence, defined only up to a scale. A good way to enforce this is by constraining the squared Frobenius norm (sum of the squared entries) of the matrix H to be equal to. Also remember that q and Hp are only proportional to each other, or equivalently we have q Hp = 0. Here are a few implementation tips: Some of these matlab functions may interest you: cpselect, ginput, svd, eig, and null Image coordinates of the points are the corresponding row and column indices of the image array. Beware of numerical ill-conditions: Your estimation procedure may perform better if image coordinates range from - to as opposed to from to 800. Consider scaling your measurements to avoid numerical issues 2. 6.4. Image Warping and Image Merging Write a program which takes as input images I ad, I scene and a 3 3 homography H then returns an image I merge which has the input image I ad warped according to H to be in the frame of the scene image I scene and placed at the proper coordinates. In order to avoid aliasing and sub-sampling effects, consider producing the output by solving for each pixel of the destination image rather than mapping each pixel in the input image to a point in the destination image Also note that the input and output images will be of different dimensions. Finally, write a program to apply these methods to each of the two advertisements and two placements in the scene. Calculate new homographies as necessary. Use this program twice to place the both advertisements in two different locations in the scene, i.e. create two unique scenes (you may reuse coordinates in the scene image). Here are a few implementation tips: 2 Hartley normalization is a well known procedure for doing this. Given a set of homogeneous 2D points { x,..., x n } point set is given by x ˆ = where A is a 3x3 linear transformation such that { xˆ,..., ˆ } Ax i homography estimation, we can write q = Hp A q = A qˆ and then solve for H as H = A Hˆ q A p q q x n, the Hartley normalized has zero mean and unit variance. In the context of HA A p qˆ = Hˆ pˆ. Thus, we can solve for Ĥ in term of pˆ and p p

Some of these matlab functions may interest you: interp2, meshgrid What to turn in: Submit a hardcopy at the due date with the following a. Derivation of the algorithm for estimating H. b. Your code for: estimating H, image warping, image merging and any other code you wrote to complete this assignment. c. An image showing the set of corresponding points you selected plotted on the original images. d. An image showing the result of your first placement of both advertisements e. An image showing the result of your second placement of both advertisements In addition, please email to jmerkow@ucsd.edu a copy of your code. If it is a single file, just send the.m file. If it is contained in multiple files, send a zip or tar file. In the subject line, please put the string: CSE252HW.