Affine and Projective Transformations

Similar documents
CS 2770: Intro to Computer Vision. Multiple Views. Prof. Adriana Kovashka University of Pittsburgh March 14, 2017

Local features and image matching May 8 th, 2018

Image warping and stitching

Computer Vision Lecture 13

N-Views (1) Homographies and Projection

Image warping and stitching

Image warping and stitching

Warping, Morphing and Mosaics

Image Warping. Some slides from Steve Seitz

Image Warping CSE399b, Spring 07 Computer Vision

CS6670: Computer Vision

Image Warping. Computational Photography Derek Hoiem, University of Illinois 09/28/17. Photo by Sean Carroll

Epipolar Geometry and Stereo Vision

MAPI Computer Vision

Image Warping and Mosacing

2D transformations Homogeneous coordinates. Uses of Transformations

Image Warping (Szeliski Sec 2.1.2)

Image Warping. Some slides from Steve Seitz

Image Warping : Computational Photography Alexei Efros, CMU, Fall Some slides from Steve Seitz

Image Warping. Many slides from Alyosha Efros + Steve Seitz. Photo by Sean Carroll

Fitting a transformation: Feature-based alignment April 30 th, Yong Jae Lee UC Davis

Determining the 2d transformation that brings one image into alignment (registers it) with another. And

Modeling Transformations

CS4670: Computer Vision

Image Stitching. Slides from Rick Szeliski, Steve Seitz, Derek Hoiem, Ira Kemelmacher, Ali Farhadi

Modeling Transformations

Image warping. image filtering: change range of image. image warping: change domain of image g(x) = f(h(x)) h(y)=0.5y+0.5. h([x,y])=[x,y/2] f h

CSE328 Fundamentals of Computer Graphics: Theory, Algorithms, and Applications

Photo by Carl Warner

Prof. Feng Liu. Winter /05/2019

MAN-522: COMPUTER VISION SET-2 Projections and Camera Calibration

2 The Derivative. 2.0 Introduction to Derivatives. Slopes of Tangent Lines: Graphically

Interactive Computer Graphics. Warping and morphing. Warping and Morphing. Warping and Morphing. Lecture 14+15: Warping and Morphing. What is.

Multi-stable Perception. Necker Cube

Image stitching. Digital Visual Effects Yung-Yu Chuang. with slides by Richard Szeliski, Steve Seitz, Matthew Brown and Vaclav Hlavac

Modeling Transformations

Image Warping, mesh, and triangulation CSE399b, Spring 07 Computer Vision

3D Geometry and Camera Calibration

Panoramas. Why Mosaic? Why Mosaic? Mosaics: stitching images together. Why Mosaic? Olivier Gondry. Bill Freeman Frédo Durand MIT - EECS

Section 1.2 The Slope of a Tangent

4.2 The Derivative. f(x + h) f(x) lim

Section 2.3: Calculating Limits using the Limit Laws

Prof. Kristen Grauman

Section 3. Imaging With A Thin Lens

6.098 Digital and Computational Photography Advanced Computational Photography. Panoramas. Bill Freeman Frédo Durand MIT - EECS

Perspective Projection Transformation

Jorge Salvador Marques, geometric camera model

Computer Graphics. Geometric Transformations

Image warping/morphing

Modeling Transformations

How is project #1 going?

CS 1674: Intro to Computer Vision. Midterm Review. Prof. Adriana Kovashka University of Pittsburgh October 10, 2016

1.4 RATIONAL EXPRESSIONS

12.2 Techniques for Evaluating Limits

Single-view 3D Reconstruction

19.2 Surface Area of Prisms and Cylinders

Last Lecture. Edge Detection. Filtering Pyramid

Geometric Transformations and Multiple Views

Modeling Transformations

2.8 The derivative as a function

Computer Graphics. Geometric Transformations

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

Epipolar Geometry and Stereo Vision

12.2 TECHNIQUES FOR EVALUATING LIMITS

You Try: A. Dilate the following figure using a scale factor of 2 with center of dilation at the origin.

Uses of Transformations. 2D transformations Homogeneous coordinates. Transformations. Transformations. Transformations. Transformations and matrices

Announcements. Mosaics. How to do it? Image Mosaics

UUV DEPTH MEASUREMENT USING CAMERA IMAGES

Epipolar Geometry and Stereo Vision

Geometric Model of Camera

Materials: Whiteboard, TI-Nspire classroom set, quadratic tangents program, and a computer projector.

Structure from Motion

To Do. Demo (Projection Tutorial) Motivation. What we ve seen so far. Outline. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 5: Viewing

CSE528 Computer Graphics: Theory, Algorithms, and Applications

4.1 Tangent Lines. y 2 y 1 = y 2 y 1

Areas of Parallelograms and Triangles. To find the area of parallelograms and triangles

Editing and Transformation

You should be able to visually approximate the slope of a graph. The slope m of the graph of f at the point x, f x is given by

Motivation. What we ve seen so far. Demo (Projection Tutorial) Outline. Projections. Foundations of Computer Graphics

CS4670: Computer Vision

Transformations II. Week 2, Wed Jan 17

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

Warping. 12 May 2015

3-Dimensional Viewing

Haar Transform CS 430 Denbigh Starkey

Computer Vision Lecture 20

Homographies and RANSAC

CHAPTER 7: TRANSCENDENTAL FUNCTIONS

Mosaics. Today s Readings

12.2 Investigate Surface Area

Homographies and Mosaics

Scene Graphs & Modeling Transformations COS 426

Two Dimensional Viewing

What and Why Transformations?

CS 335 Graphics and Multimedia. Geometric Warping

Image warping , , Computational Photography Fall 2017, Lecture 10

Today s class. Geometric objects and transformations. Informationsteknologi. Wednesday, November 7, 2007 Computer Graphics - Class 5 1

NOTES: A quick overview of 2-D geometry

Two Modifications of Weight Calculation of the Non-Local Means Denoising Method

CS559: Computer Graphics

Transcription:

CS 674: Intro to Computer Vision Affine and Projective Transformations Prof. Adriana Kovaska Universit of Pittsburg October 3, 26

Alignment problem We previousl discussed ow to matc features across images, of te same or different objects Now let s focus on te case of two images of te same object (e.g. i and i ) and eamine it in more detail Wat transformation relates i and i? In alignment, we will fit te parameters of some transformation according to a set of matcing feature pairs ( correspondences ). i T i Adapted from Kristen Grauman and Derek Hoiem

Two questions T Alignment: Given two images, wat is te transformation between tem? T Warping: Given a source image and a transformation, wat does te transformed output look like? Kristen Grauman

Motivation for feature-based alignment: Image mosaics Kristen Grauman Image from ttp://grapics.cs.cmu.edu/courses/5-463/2_fall/

Wat are te correspondences? Min SSD = matc? Compare content in local patces, find best matces. Simplest approac: Scan i wit template formed from a point in i, and compute Euclidean distance (a.k.a. SSD) or normalized crosscorrelation between list of piel intensities in te patc. Kristen Grauman

Wat are te transformations? Eamples of transformations: translation rotation aspect affine perspective Alosa Efros

Parametric (global) warping T p = (,) p = (, ) Transformation T is a coordinate-canging macine: p = T(p) Wat does it mean tat T is global? It is te same for an point p It can be described b just a few numbers (parameters) Let s represent T as a matri: p = Mp Alosa Efros M

Scaling Scaling a coordinate means multipling eac of its components b a scalar Uniform scaling means tis scalar is te same for all components: 2 Alosa Efros

Scaling Non-uniform scaling: different scalars per component: X 2, Y.5 Alosa Efros

Scaling Scaling operation: Or, in matri form: b a q p n m scaling matri S Alosa Efros b a b a q p n m

2D Linear Transformations a c b d Onl linear 2D transformations can be represented wit a 22 matri. Linear transformations are combinations of Scale, Rotation, Sear, and Mirror Alosa Efros

2D Rotate around (,)? cos sin sin cos cos sin sin cos 2D Sear? s s s s 2D Scaling? s s s s Modified from Alosa Efros Fig. from ttps://www.siggrap.org/education/materials/hpergrap/modeling/mod_tran/2dsear.tm Wat transforms can we write wit a 22 matri?

Wat transforms can we write wit a 22 matri? 2D Mirror about Y ais? 2D Mirror over (,)? Alosa Efros 2D Translation? t t CAN T DO!

Homogeneous coordinates To convert to omogeneous coordinates: omogeneous image coordinates Converting from omogeneous coordinates Kristen Grauman

t t Translation t t t t t = 2 t = Homogeneous Coordinates Alosa Efros

2D Affine Transformations Affine transformations are combinations of Linear transformations, and Translations Maps lines to lines, parallel lines remain parallel w f e d c b a w Adapted from Alosa Efros

Fitting an affine transformation Assuming we know te correspondences, ow do we get te transformation? ), ( i i ), ( i i 2 4 3 2 t t m m m m i i i i i i i i i i t t m m m m 2 4 3 2 Alosa Efros

Fitting an affine transformation How man matces (correspondence pairs) do we need to solve for te transformation parameters? Once we ave solved for te parameters, ow do we compute given? Were do te matces come from? i i i i i i t t m m m m 2 4 3 2 ), ( new new Modified from Kristen Grauman ), ( new new

Projective Transformations Projective transformations: Affine transformations, and Projective warps Parallel lines do not necessaril remain parallel w i g f e d c b a w Kristen Grauman

Projection: world coord image coord Optical. center f z.. P z. p Camera center Modified from Derek Hoiem and Kristen Grauman Scene point Image coordinates

Image mosaics: Goals... image from S. Seitz Obtain a wider angle view b combining multiple images. Kristen Grauman

Image mosaics: Camera setup Two images wit camera rotation/zoom but no translation Adapted from Derek Hoiem Camera Center

Mosaic: Man 2D views of same 3D object Steve Seitz mosaic plane Te mosaic as a natural interpretation in 3D Te images are reprojected onto a common plane Te mosaic is formed on tis plane Mosaic is a sntetic wide-angle camera

Image reprojection Basic question How to relate two images from te same camera center? ow to map a piel from PP to PP2 Answer Cast a ra troug eac piel in PP Draw te piel were tat ra intersects PP2 PP2 Observation: Rater tan tinking of tis as a 3D reprojection, tink of it as a 2D image warp from one image to anoter. PP Alosa Efros

Projective transforms A projective transform is a mapping between an two PPs wit te same center of projection rectangle sould map to arbitrar quadrilateral parallel lines aren t but preserves straigt lines Also called Homograp PP2 w w w p H p PP Adapted from Alosa Efros

How to stitc togeter a panorama (a.k.a. Basic Procedure mosaic)? Take a sequence of images from te same position Rotate te camera about its optical center Compute te omograp (transformation) between second image and first Transform te second image to overlap wit te first Blend te two togeter to create a mosaic (If tere are more images, repeat) Modified from Steve Seitz

Computing te omograp,, 2, 2, 2 2,, n n n n To compute te omograp given pairs of corresponding points in te images, we need to set up an equation were te parameters of H are te unknowns Kristen Grauman

Computing te omograp p = Hp w a b c w d e f w g i Can set scale factor i=. So, tere are 8 unknowns. Set up a sstem of linear equations: A = b were vector of unknowns = [a,b,c,d,e,f,g,] T Need at least 8 eqs, but te more te better Solve for. If overconstrained, solve using least-squares: min A b 2 Kristen Grauman

Computing te omograp Assume we ave four matced points: How do we compute omograp H? p w w w 9 8 7 6 5 4 3 2 H 9 8 7 6 5 4 3 2 Derek Hoiem p =Hp Appl SVD: UDV T = A [U, S, V] = svd(a); = V smallest (column of V corr. to smallest singular value) A

How to stitc togeter a panorama (a.k.a. Basic Procedure mosaic)? Take a sequence of images from te same position Rotate te camera about its optical center Compute te omograp (transformation) between second image and first Transform te second image to overlap wit te first Blend te two togeter to create a mosaic (If tere are more images, repeat) Modified from Steve Seitz

w w w H p p w w w w,,, To appl a given omograp H Compute p = Hp (regular matri multipl) Convert p from omogeneous to image coordinates Modified from Kristen Grauman Transforming te second image Image canvas Image 2

Transforming te second image Image 2 Image canvas H(,) f(,) g(, ) Forward warping: Send eac piel f(,) to its corresponding location (, ) = H(,) in te rigt image Modified from Alosa Efros

Transforming te second image H(,) f(,) g(, ) Forward warping: Send eac piel f(,) to its corresponding location (, ) = H(,) in te rigt image Q: wat if piel lands between two piels? A: distribute color among neigboring piels (, ) Alosa Efros

Transforming te second image Image 2 Image canvas H - (,) f(,) g(, ) Inverse warping: Get eac piel g(, ) from its corresponding location (,) = H - (, ) in te left image Modified from Alosa Efros

Transforming te second image H - (,) f(,) g(, ) Alosa Efros Inverse warping: Get eac piel g(, ) from its corresponding location (,) = H - (, ) in te left image Q: wat if piel comes from between two piels? A: interpolate color value from neigbors >> elp interp2

Homograp eample: Image rectification p p To unwarp (rectif) an image solve for omograp H given p and p : p =Hp Derek Hoiem

Summar Write 2d transformations as matri-vector multiplication (including translation wen we use omogeneous coordinates) Projection equations epress ow world points mapped to 2d image. Fitting transformations: solve for unknown parameters given corresponding points from two views linear, affine, projective (omograp) Mosaics: uses omograp and image warping to merge views taken from same center of projection Perform image warping (forward, inverse) Adapted from Kristen Grauman

Te net 5 idden slides give some more detail about ow image formation works, i.e. ow 3D objects are mapped to 2D images. Please review on our own time if ou re interested.