Image Warping Szeliski Sec 2 1 2 http
- Slides: 32
Image Warping (Szeliski Sec 2. 1. 2) http: //www. jeffrey-martin. com CS 194: Image Manipulation & Computational Photography Alexei Efros, UC Berkeley, Fall 2018 Some slides from Steve Seitz
Image Transformations image filtering: change range of image g(x) = T(f(x)) f f T x x image warping: change domain of image g(x) = f(T(x)) f f T x x
Image Transformations image filtering: change range of image g(x) = T(f(x)) f g T image warping: change domain of image g(x) = f(T(x)) f T g
Parametric (global) warping Examples of parametric warps: translation affine rotation perspective aspect cylindrical
Parametric (global) warping T p = (x, y) p’ = (x’, y’) Transformation T is a coordinate-changing machine: p’ = T(p) What does it mean that T is global? • Is the same for any point p • can be described by just a few numbers (parameters) Let’s represent a linear T as a matrix: p’ = Mp
Scaling a coordinate means multiplying each of its components by a scalar Uniform scaling means this scalar is the same for all components: 2
Scaling Non-uniform scaling: different scalars per component: X 2, Y 0. 5
Scaling operation: Or, in matrix form: scaling matrix S What’s inverse of S?
2 -D Rotation (x’, y’) (x, y) x’ = x cos( ) - y sin( ) y’ = x sin( ) + y cos( )
2 -D Rotation (x’, y’) (x, y) f x = r cos (f) y = r sin (f) x’ = r cos (f + ) y’ = r sin (f + )
2 -D Rotation (x’, y’) (x, y) f x = r cos (f) y = r sin (f) x’ = r cos (f + ) y’ = r sin (f + ) Trig Identity… x’ = r cos(f) cos( ) – r sin(f) sin( ) y’ = r sin(f) cos( ) + r cos(f) sin( )
2 -D Rotation (x’, y’) (x, y) f x = r cos (f) y = r sin (f) x’ = r cos (f + ) y’ = r sin (f + ) Trig Identity… x’ = r cos(f) cos( ) – r sin(f) sin( ) y’ = r sin(f) cos( ) + r cos(f) sin( ) Substitute… x’ = x cos( ) - y sin( ) y’ = x sin( ) + y cos( )
2 -D Rotation This is easy to capture in matrix form: R Even though sin( ) and cos( ) are nonlinear functions of , • x’ is a linear combination of x and y • y’ is a linear combination of x and y What is the inverse transformation? • Rotation by – • For rotation matrices
2 x 2 Matrices What types of transformations can be represented with a 2 x 2 matrix? 2 D Identity? 2 D Scale around (0, 0)?
2 x 2 Matrices What types of transformations can be represented with a 2 x 2 matrix? 2 D Rotate around (0, 0)? 2 D Shear?
2 x 2 Matrices What types of transformations can be represented with a 2 x 2 matrix? 2 D Mirror about Y axis? 2 D Mirror over (0, 0)?
2 x 2 Matrices What types of transformations can be represented with a 2 x 2 matrix? 2 D Translation? NO! Only linear 2 D transformations can be represented with a 2 x 2 matrix
All 2 D Linear Transformations Linear transformations are combinations of … • • Scale, Rotation, Shear, and Mirror Properties of linear transformations: • • • Origin maps to origin Lines map to lines Parallel lines remain parallel Ratios are preserved Closed under composition
Consider a different Basis j =(0, 1) v =(vx, vy) p q u=(ux, uy) i =(1, 0) q=4 i+3 j = (4, 3) p=4 u+3 v
Linear Transformations as Change of Basis v =(vx, vy) j =(0, 1) puv pij u=(ux, uy) i =(1, 0) puv = (4, 3) px=4 ux+3 vx py=4 uy+3 vy pij = 4 u+3 v éux pij = ê ëu y v x ù é 4ù é u x úê ú = ê v y û ë 3û ëu y Any linear transformation is a basis!!! vx ù úpuv vy û
What’s the inverse transform? j =(0, 1) v =(vx, vy) pij puv u=(ux, uy) i =(1, 0) pij = (5, 4) = pxu + pyv puv = éux ê ëu y -1 vx ù ú vy û é 5ù é u x ê ú = êu ë 4û ë y puv = (px, py) = ? -1 vx ù ú pij vy û • How can we change from any basis to any basis? • What if the basis are orthogonal?
Projection onto orthogonal basis j =(0, 1) v =(vx, vy) pij puv u=(ux, uy) i =(1, 0) pij = (5, 4) puv = (u·pij, v·pij) éux ê ëv y ux ù ú vy û é 5ù é u x ê ú = êv ë 4û ë x uy ù ij p ú vy û
Homogeneous Coordinates Q: How can we represent translation as a 3 x 3 matrix?
Homogeneous Coordinates Homogeneous coordinates • represent coordinates in 2 dimensions with a 3 -vector
Homogeneous Coordinates Add a 3 rd coordinate to every 2 D point • (x, y, w) represents a point at location (x/w, y/w) • (x, y, 0) represents a point at infinity • (0, 0, 0) is not allowed y 2 (2, 1, 1) or (4, 2, 2) or (6, 3, 3) 1 Convenient coordinate system to represent many useful transformations 1 2 x
Homogeneous Coordinates Q: How can we represent translation as a 3 x 3 matrix? A: Using the rightmost column:
Translation Example of translation Homogeneous Coordinates tx = 2 ty = 1
Basic 2 D Transformations Basic 2 D transformations as 3 x 3 matrices Translate Scale Rotate Shear
Matrix Composition Transformations can be combined by matrix multiplication p’ = T(tx, ty) R(Q) S(sx, sy) Does the order of multiplication matter? p
Affine Transformations Affine transformations are combinations of … • Linear transformations, and • Translations Properties of affine transformations: • • • Origin does not necessarily map to origin Lines map to lines Parallel lines remain parallel Ratios are preserved Closed under composition Models change of basis Will the last coordinate w always be 1?
Projective Transformations Projective transformations … • Affine transformations, and • Projective warps Properties of projective transformations: • • • Origin does not necessarily map to origin Lines map to lines Parallel lines do not necessarily remain parallel Ratios are not preserved Closed under composition Models change of basis
2 D image transformations These transformations are a nested set of groups • Closed under composition and inverse is a member
- Szeliski computer vision
- Rick szeliski
- Matlab dctmtx
- Affine image warping
- Warping in computer graphics
- Morphing and warping in multimedia
- Animation warping
- Eamonn keogh
- Morphing
- Exact indexing of dynamic time warping
- Dynamic time warping stock market
- Introduction to dsp
- Dynamic time warping
- Http //mbs.meb.gov.tr/ http //www.alantercihleri.com
- Http //siat.ung.ac.id atau http //pmb.ung.ac.id
- Gestalt leveling
- Http:/image of fig. 1
- Real image vs virtual image
- Real image vs virtual
- Translate
- What is image restoration in digital image processing
- Image compression model in digital image processing
- Key stage in digital image processing
- Analog image and digital image
- Objective fidelity criteria
- Image sharpening and restoration
- Static image vs dynamic
- Image geometry in digital image processing
- Gravitational blood drop
- Zooming and shrinking in digital image processing
- Ce n'est pas une image juste c'est juste une image
- Difference between logical file and physical file
- Perturbação