Perspective Projection [2 pts]

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

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

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

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

Pin Hole Cameras & Warp Functions

CS6670: Computer Vision

CSCI 5980: Assignment #3 Homography

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

calibrated coordinates Linear transformation pixel coordinates

Pin Hole Cameras & Warp Functions

16720: Computer Vision Homework 1

Agenda. Rotations. Camera calibration. Homography. Ransac

Agenda. Rotations. Camera models. Camera calibration. Homographies

Computer Vision Project-1

Module 6: Pinhole camera model Lecture 32: Coordinate system conversion, Changing the image/world coordinate system

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

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

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

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

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

Vision Review: Image Formation. Course web page:

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

Computer Vision Projective Geometry and Calibration. Pinhole cameras

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

Camera Model and Calibration

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

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

CSE152 Introduction to Computer Vision Assignment 3 (SP15) Instructor: Ben Ochoa Maximum Points : 85 Deadline : 11:59 p.m., Friday, 29-May-2015

Stereo Vision. MAN-522 Computer Vision

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

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

CSE 252B: Computer Vision II

Midterm Examination CS 534: Computational Photography

CS4670: Computer Vision

Image Formation. Antonino Furnari. Image Processing Lab Dipartimento di Matematica e Informatica Università degli Studi di Catania

Introduction to Computer Graphics and Computer Vision Assignment 3: Due 7/27/2015

CS6670: Computer Vision

Geometric camera models and calibration

Mosaics. Today s Readings

Image Warping and Mosacing

HW 1: Project Report (Camera Calibration)

Perspective projection and Transformations

Perspective Projection in Homogeneous Coordinates

Midterm Exam Solutions

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

N-Views (1) Homographies and Projection

Computer Vision Projective Geometry and Calibration. Pinhole cameras

3D Geometry and Camera Calibration

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

1 Projective Geometry

Rectification and Distortion Correction

Today s lecture. Image Alignment and Stitching. Readings. Motion models

Camera model and multiple view geometry

Stereo Image Rectification for Simple Panoramic Image Generation

Projective Geometry and Camera Models

Instance-level recognition I. - Camera geometry and image alignment

Computer Vision. Coordinates. Prof. Flávio Cardeal DECOM / CEFET- MG.

Camera Model and Calibration. Lecture-12

1 CSE 252A Computer Vision I Fall 2017

METRIC PLANE RECTIFICATION USING SYMMETRIC VANISHING POINTS

Image warping and stitching

Rigid Body Motion and Image Formation. Jana Kosecka, CS 482

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

Hartley - Zisserman reading club. Part I: Hartley and Zisserman Appendix 6: Part II: Zhengyou Zhang: Presented by Daniel Fontijne

ECE-161C Cameras. Nuno Vasconcelos ECE Department, UCSD

Agenda. Perspective projection. Rotations. Camera models

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

Homographies and RANSAC

Project Title: Welding Machine Monitoring System Phase II. Name of PI: Prof. Kenneth K.M. LAM (EIE) Progress / Achievement: (with photos, if any)

Image warping and stitching

521466S Machine Vision Exercise #1 Camera models

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

Single-view metrology

Introduction to Computer Vision

Two-view geometry Computer Vision Spring 2018, Lecture 10

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

1 (5 max) 2 (10 max) 3 (20 max) 4 (30 max) 5 (10 max) 6 (15 extra max) total (75 max + 15 extra)

Unit 3 Multiple View Geometry

Computer Vision CSCI-GA Assignment 1.

Discriminant Functions for the Normal Density

Structure from Motion. Prof. Marco Marcon

CS4620/5620. Professor: Kavita Bala. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Image formation - About the course. Grading & Project. Tentative Schedule. Course Content. Students introduction

COMPARATIVE STUDY OF DIFFERENT APPROACHES FOR EFFICIENT RECTIFICATION UNDER GENERAL MOTION

Projective Geometry and Camera Models

Image Rectification (Stereo) (New book: 7.2.1, old book: 11.1)

CSE 527: Introduction to Computer Vision

Introduction to 3D Concepts

Single-view 3D Reconstruction

Announcements. Mosaics. How to do it? Image Mosaics

Assignment 2 : Projection and Homography

Topics and things to know about them:

An idea which can be used once is a trick. If it can be used more than once it becomes a method

CS 231A Computer Vision (Winter 2014) Problem Set 3

Image warping and stitching

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

3D Modeling using multiple images Exam January 2008

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

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

Pinhole Camera Model 10/05/17. Computational Photography Derek Hoiem, University of Illinois

Transcription:

Instructions: CSE252a Computer Vision Assignment 1 Instructor: Ben Ochoa Due: Thursday, October 23, 11:59 PM Submit your assignment electronically by email to iskwak+252a@cs.ucsd.edu with the subject line CSE252 Assignment 1. The email should have one file attached. Name this file: CSE 252 hw01 lastname studentid.zip. The contents of the file should be: 1. A pdf file with your writeup. This should have all code attached in the appendix. Name this file: CSE 252 hw01 lastname.pdf. 2. All of your source code in a folder called code. No physical hand-in for this assignment. In general, code does not have to be efficient. Focus on clarity, correctness and function here, and we can worry about speed in another course. Perspective Projection [2 pts] Consider a perspective projection where a point x P = y z is projected onto an image plane Π represented by k = f > 0 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 Part A Q = 4 2 0 What is the projection of the point when t = 1? + t 0 1 1 1

Part B What is the projected point s coordinates when t =? Note, to get full credit you cannot take the limit as t goes to. Thin Lens Equation [2 pts] An illuminated arrow forms a real inverted image of itself at a distance w = 50cm, measured along the optic axis of a convex thin lens (see Figure 1). The image is just half the size of the object. Figure 1: Problem 3 Setup A. How far from the object must the lens be placed? B. What is the focal length of the lens? C. Suppose the arrow moves x cm 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? Affine Projection [2pts] Consider an affine camera and a line in 3D space. Consider three points (A, B, and C) on that line, and the image of those three points (a, b and c). Now consider the distance between a and b and the distance between a and c. Show that the ratio of the distance is independent of the direction of the line. Image formation and rigid body transformations [10 points] This problem has written and coding components. In this problem we will practice rigid body transformations and image formations through the projective and affine camera model. The goal will be to photograph the following four points given by A P 1 = ( 1, 0.5, 2) T, A P 2 = (1, 0.5, 2) T, A P 3 = (1, 0.5, 2) T, A P 4 = ( 1, 0.5, 2) T in world 2

coordinates. To do this we will need two matrices. Recall, first, the following formula for rigid body transformation B P = B AR A P + B O A (1) where B P is the point coordinate in the target (B) coordinate system, A P is the point coordinates in the source (A) coordinate system, B A R is the rotation matrix from A to B, and B O A is the origin of coordinate system A expressed in the B coordinates. The rotation and translation can be combined into a single 4 4 extrinsic parameter matrix, P e, so that B P = P e A P. Once transformed, the points can be photographed using the intrinsic camera matrix, P i which is a 3 4 Once these are found, the image of a point, A P, can be calculated as P i P e A P. We will consider four different settings of focal length, viewing angles and camera positions below. For each part calculate or provide the following: the extrinsic transformation matrix. intrinsic camera matrix under the perspective camera assumption. intrinsic camera matrix under the affine camera assumption. In particular, around what point do you do the taylor series expansion? The actual points around which you did the taylor series expansion for the affine camera models. How did you arrive at these points? The affine projection is an approximation. Plot what happens when using a poor choice for the taylor series expansion, for example try (0, 5, 2). Calculate the image of the four vertices and plot using the supplied plotsquare.m/plotsquare.py function (see e.g. output in figure 2). 1. [No rigid body transformation]. Focal length = 1. The optical axis of the camera is aligned with the z-axis. 2. [Translation] B O A = (0, 0, 1) T. The optical axis of the camera is aligned with the z-axis. 3. [Translation and rotation]. Focal length = 1. B AR encodes a 20 degrees around the z-axis and then 40 degrees around the y-axis. B O A = (0, 0, 1) T. 4. [Translation and rotation, long distance]. Focal length = 5. B A R encodes a 20 degrees around the z-axis and then 40 degrees around the y-axis. B O A = (0, 0, 10) T. Note: we will not use a full intrinsic camera matrix (e.g. that maps centimeters to pixels, and defines the coordinates of the center of the image), but only parameterize this with f, the focal length. In other words: the only parameter in the intrinsic camera matrix under the perspective assumption is f, and the only ones under the affine assumption are: f, x 0, y 0, z 0, where x 0, y 0, z 0 is the center of the taylor series expansion. Image warping and merging [10 pts] This is a programming assignment, which should be done in Matlab or python. All data necessary for this assignment is available on the course web page. 3

Figure 2: Example output for image formation problem. Note: the angles and offsets used to generate these plots are different from those in the problem statement, it s just to illustrate how to report your results. Introduction In this assignment, we consider a vision application in which components of the scene are replaced by components from another image scene. Optical character recognition, OCR, is one computer vision s more successful applications. However OCR can struggle with text that is distorted by imaging conditions. In order to help improve OCR, some people will rectify the image. An example is shown in Fig 3. Reading signs from Google street view images can also benefit from techniques such as this. This kind of rectification can be accomplished by finding a mapping from points on one plane to points another plane. In Fig 3, P 1, P 2, P 3, P 4 were mapped to (0, 0), (1, 0), (1, 1), (0, 1). To solve this section of the homework, you will begin by deriving the transformation that maps one image onto another in the planar scene case. Then you will write a program that implements this transformation and uses it to rectify ads from a stadium. To begin, we consider the projection of planes in images. Imagine two cameras C 1 and C 2 looking at a plane π in the world. Consider a point P on the plane π and its projections p = (u1, v1, 1) in image 1 and q = (u2, v2, 1) in image 2. Fact 1 There exists a unique (up to scale) 3x3 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. 4

Figure 3: Input image (left) and target (right) for image mapping problem The interesting thing about this result is that by using H we can compute the image of P that would be seen in camera C2 from the image of the point in camera C1 without knowing its threedimensional location. Such an H is a projective transformation of the plane, also referred to as a homography. Problem definition Write files computeh.m and warp.m that can be used in the following skeleton code. warp takes as inputs the original image, corners of an ad in the image, and finally, H, the homography. Note that the homography should map points from the gallery image to the sign image, that way you will avoid problems with aliasing and sub-sampling effects. I1 = imread('stadium.jpg'); % get points from the image figure(10) imshow(i1) % select points on the image, preferably the corners of an ad. points = ginput(4); figure(1) subplot(1,2,1); imshow(i1); new points = [...]; % choose your own set of points to warp your ad too H = computeh(points, new points); % warp will return just the ad rectified. This will require cropping the ad out of the % stadium image. warped img = warp(i1, points, H); subplot(1,2,2); imshow(warped img); Report Run the skeleton code and include the output image in your report. Attach source code for computeh.m and warp.m in the appendix. 5

For fun (no credit or hand-in) Try running an off the shelf OCR engine on the original picture and your rectified image! Good luck! 6