SlideShare a Scribd company logo
Lecture 7: Transformations and warping
CS5670: Computer Vision
Noah Snavely
Reading
• Szeliski: Chapter 3.6
Announcements
• Project 2 out, due Monday, March 4, by
11:59pm on CMS
– Please form teams of 2, and create your team on
CMS
• Project 1 artifact voting
Image alignment
Why don’t these image line up exactly?
What is the geometric relationship
between these two images?
?
Answer: Similarity transformation (translation, rotation, uniform scale)
What is the geometric relationship
between these two images?
?
What is the geometric relationship
between these two images?
Very important for creating mosaics!
First, we need to know what this transformation is.
Second, we need to figure out how to compute it using feature matches.
Richard Szeliski Image Stitching 8
Image Warping
• image filtering: change range of image
• g(x) = h(f(x))
• image warping: change domain of image
• g(x) = f(h(x))
f
x
h
g
x
f
x
h
g
x
Richard Szeliski Image Stitching 9
Image Warping
• image filtering: change range of image
• g(x) = h(f(x))
• image warping: change domain of image
• g(x) = f(h(x))
h
h
f
f g
g
Richard Szeliski Image Stitching 11
Parametric (global) warping
• Examples of parametric warps:
translation rotation aspect
Parametric (global) warping
• 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 consider linear xforms (can be represented by a 2x2 matrix):
T
p = (x,y) p’ = (x’,y’)
Common linear transformations
• Uniform scaling by s:
(0,0) (0,0)
What is the inverse?
Common linear transformations
• Rotation by angle θ (about the origin)
(0,0) (0,0)
What is the inverse?
For rotations:
θ
2x2 Matrices
• What types of transformations can be
represented with a 2x2 matrix?
2D mirror about Y axis?
2D mirror across line y = x?
• What types of transformations can be
represented with a 2x2 matrix?
2D Translation?
Translation is not a linear operation on 2D coordinates
NO!
2x2 Matrices
All 2D 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



















y
x
d
c
b
a
y
x
'
'































y
x
l
k
j
i
h
g
f
e
d
c
b
a
y
x
'
'
Homogeneous coordinates
Trick: add one more coordinate:
homogeneous image
coordinates
Converting from homogeneous coordinates
x
y
w
(x, y, w)
w = 1
(x/w, y/w, 1)
homogeneous plane
Translation
• Solution: homogeneous coordinates to the
rescue
Affine transformations
any transformation
represented by a 3x3 matrix
with last row [ 0 0 1 ] we call
an affine transformation
Basic affine transformations



















 











1
1
0
0
0
cos
sin
0
sin
cos
1
'
'
y
x
y
x



































1
1
0
0
1
0
0
1
1
'
'
y
x
t
t
y
x
y
x































1
1
0
0
0
1
0
1
1
'
'
y
x
sh
sh
y
x
y
x
Translate
2D in-plane rotation Shear































1
1
0
0
0
0
0
0
1
'
'
y
x
s
s
y
x
y
x
Scale
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

























w
y
x
f
e
d
c
b
a
w
y
x
1
0
0
'
'
Is this an affine transformation?
Where do we go from here?
affine transformation
what happens when we
mess with this row?
Projective Transformations aka
Homographies aka Planar Perspective Maps
Called a homography
(or planar perspective map)
Homographies
What happens when
the denominator is 0?
Points at infinity
Image warping with homographies
image plane in front image plane below
black area
where no pixel
maps to
Homographies
Homographies
• Homographies …
– 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
Alternate formulation for
homographies
where the length of the vector [h00 h01 … h22] is 1
2D image transformations
These transformations are a nested set of groups
• Closed under composition and inverse is a member
Implementing image warping
• Given a coordinate xform (x’,y’) = T(x,y) and a
source image f(x,y), how do we compute an
xformed image g(x’,y’) = f(T(x,y))?
f(x,y) g(x’,y’)
x x’
T(x,y)
y y’
Forward Warping
• Send each pixel f(x) to its corresponding
location (x’,y’) = T(x,y) in g(x’,y’)
f(x,y) g(x’,y’)
x x’
T(x,y)
• What if pixel lands “between” two pixels?
y y’
Forward Warping
• Send each pixel f(x,y) to its corresponding
location x’ = h(x,y) in g(x’,y’)
f(x,y) g(x’,y’)
x x’
T(x,y)
• What if pixel lands “between” two pixels?
• Answer: add “contribution” to several pixels,
normalize later (splatting)
• Can still result in holes
y y’
Inverse Warping
• Get each pixel g(x’,y’) from its corresponding
location (x,y) = T-1(x,y) in f(x,y)
f(x,y) g(x’,y’)
x x’
T-1(x,y)
• Requires taking the inverse of the transform
• What if pixel comes from “between” two pixels?
y y’
Inverse Warping
• Get each pixel g(x’) from its corresponding
location x’ = h(x) in f(x)
• What if pixel comes from “between” two pixels?
• Answer: resample color value from interpolated
(prefiltered) source image
f(x,y) g(x’,y’)
x x’
y y’
T-1(x,y)
Interpolation
• Possible interpolation filters:
– nearest neighbor
– bilinear
– bicubic
– sinc
• Needed to prevent “jaggies”
and “texture crawl”
(with prefiltering)
Questions?

More Related Content

Similar to lec07_transformations.pptx

Two dimensionaltransformations
Two dimensionaltransformationsTwo dimensionaltransformations
Two dimensionaltransformations
Nareek
 
MLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
MLIP - Chapter 6 - Generation, Super-Resolution, Style transferMLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
MLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
Charles Deledalle
 
Lecture 9-online
Lecture 9-onlineLecture 9-online
Lecture 9-online
lifebreath
 
2D Transformation.pptx
2D Transformation.pptx2D Transformation.pptx
2D Transformation.pptx
MuhammadNaqi7
 
3-Game Graphics (Game Design and Development)
3-Game Graphics (Game Design and Development)3-Game Graphics (Game Design and Development)
3-Game Graphics (Game Design and Development)
Hafiz Ammar Siddiqui
 
2d Transformation.pdf
2d Transformation.pdf2d Transformation.pdf
2d Transformation.pdf
Mattupallipardhu
 
Transforms UNIt 2
Transforms UNIt 2 Transforms UNIt 2
Transforms UNIt 2
sandeep kumbhkar
 
Unit-3 overview of transformations
Unit-3 overview of transformationsUnit-3 overview of transformations
Unit-3 overview of transformations
Amol Gaikwad
 
Mk slides.ppt
Mk slides.pptMk slides.ppt
Mk slides.ppt
Tabassum Saher
 
Computer graphic
Computer graphicComputer graphic
Computer graphic
nusratema1
 
Edge linking via Hough transform.ppt
Edge linking via Hough transform.pptEdge linking via Hough transform.ppt
Edge linking via Hough transform.ppt
SivaSankar306103
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transform
Patel Punit
 
2 transformation computer graphics
2 transformation computer graphics2 transformation computer graphics
2 transformation computer graphics
cairo university
 
affine transformation for computer graphics
affine transformation for computer graphicsaffine transformation for computer graphics
affine transformation for computer graphics
DrSUGANYADEVIK
 
2d transformations
2d transformations2d transformations
2d transformations
rajeshranjithsingh
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
SHIVANI SONI
 
transformations.pdf
transformations.pdftransformations.pdf
transformations.pdf
shubhampatel67739
 
september4.ppt
september4.pptseptember4.ppt
september4.ppt
CharlesMatu2
 
Function transformations
Function transformationsFunction transformations
Function transformationsTerry Gastauer
 

Similar to lec07_transformations.pptx (20)

Two dimensionaltransformations
Two dimensionaltransformationsTwo dimensionaltransformations
Two dimensionaltransformations
 
MLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
MLIP - Chapter 6 - Generation, Super-Resolution, Style transferMLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
MLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
 
Lecture 9-online
Lecture 9-onlineLecture 9-online
Lecture 9-online
 
2D Transformation.pptx
2D Transformation.pptx2D Transformation.pptx
2D Transformation.pptx
 
3-Game Graphics (Game Design and Development)
3-Game Graphics (Game Design and Development)3-Game Graphics (Game Design and Development)
3-Game Graphics (Game Design and Development)
 
2d Transformation.pdf
2d Transformation.pdf2d Transformation.pdf
2d Transformation.pdf
 
Transforms UNIt 2
Transforms UNIt 2 Transforms UNIt 2
Transforms UNIt 2
 
Unit-3 overview of transformations
Unit-3 overview of transformationsUnit-3 overview of transformations
Unit-3 overview of transformations
 
Mk slides.ppt
Mk slides.pptMk slides.ppt
Mk slides.ppt
 
Computer graphic
Computer graphicComputer graphic
Computer graphic
 
Edge linking via Hough transform.ppt
Edge linking via Hough transform.pptEdge linking via Hough transform.ppt
Edge linking via Hough transform.ppt
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transform
 
2 transformation computer graphics
2 transformation computer graphics2 transformation computer graphics
2 transformation computer graphics
 
affine transformation for computer graphics
affine transformation for computer graphicsaffine transformation for computer graphics
affine transformation for computer graphics
 
2d transformations
2d transformations2d transformations
2d transformations
 
Lecture 2.1 2.2a bt
Lecture 2.1 2.2a btLecture 2.1 2.2a bt
Lecture 2.1 2.2a bt
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
 
transformations.pdf
transformations.pdftransformations.pdf
transformations.pdf
 
september4.ppt
september4.pptseptember4.ppt
september4.ppt
 
Function transformations
Function transformationsFunction transformations
Function transformations
 

More from AneesAbbasi14

Goal Setting UPDATED.pptx
Goal Setting UPDATED.pptxGoal Setting UPDATED.pptx
Goal Setting UPDATED.pptx
AneesAbbasi14
 
Lec_15_OOP_ObjectsAsParametersFriendClasses.pdf
Lec_15_OOP_ObjectsAsParametersFriendClasses.pdfLec_15_OOP_ObjectsAsParametersFriendClasses.pdf
Lec_15_OOP_ObjectsAsParametersFriendClasses.pdf
AneesAbbasi14
 
lecture-2021inheritance-160705095417.pdf
lecture-2021inheritance-160705095417.pdflecture-2021inheritance-160705095417.pdf
lecture-2021inheritance-160705095417.pdf
AneesAbbasi14
 
lecture-18staticdatamember-160705095116.pdf
lecture-18staticdatamember-160705095116.pdflecture-18staticdatamember-160705095116.pdf
lecture-18staticdatamember-160705095116.pdf
AneesAbbasi14
 
lec09_ransac.pptx
lec09_ransac.pptxlec09_ransac.pptx
lec09_ransac.pptx
AneesAbbasi14
 
02-07-20_Anees.pptx
02-07-20_Anees.pptx02-07-20_Anees.pptx
02-07-20_Anees.pptx
AneesAbbasi14
 
Yasir Presentation.pptx
Yasir Presentation.pptxYasir Presentation.pptx
Yasir Presentation.pptx
AneesAbbasi14
 
Lec5_OOP.pptx
Lec5_OOP.pptxLec5_OOP.pptx
Lec5_OOP.pptx
AneesAbbasi14
 
Lec_1,2_OOP_(Introduction).pdf
Lec_1,2_OOP_(Introduction).pdfLec_1,2_OOP_(Introduction).pdf
Lec_1,2_OOP_(Introduction).pdf
AneesAbbasi14
 
IntroComputerVision23.pptx
IntroComputerVision23.pptxIntroComputerVision23.pptx
IntroComputerVision23.pptx
AneesAbbasi14
 

More from AneesAbbasi14 (10)

Goal Setting UPDATED.pptx
Goal Setting UPDATED.pptxGoal Setting UPDATED.pptx
Goal Setting UPDATED.pptx
 
Lec_15_OOP_ObjectsAsParametersFriendClasses.pdf
Lec_15_OOP_ObjectsAsParametersFriendClasses.pdfLec_15_OOP_ObjectsAsParametersFriendClasses.pdf
Lec_15_OOP_ObjectsAsParametersFriendClasses.pdf
 
lecture-2021inheritance-160705095417.pdf
lecture-2021inheritance-160705095417.pdflecture-2021inheritance-160705095417.pdf
lecture-2021inheritance-160705095417.pdf
 
lecture-18staticdatamember-160705095116.pdf
lecture-18staticdatamember-160705095116.pdflecture-18staticdatamember-160705095116.pdf
lecture-18staticdatamember-160705095116.pdf
 
lec09_ransac.pptx
lec09_ransac.pptxlec09_ransac.pptx
lec09_ransac.pptx
 
02-07-20_Anees.pptx
02-07-20_Anees.pptx02-07-20_Anees.pptx
02-07-20_Anees.pptx
 
Yasir Presentation.pptx
Yasir Presentation.pptxYasir Presentation.pptx
Yasir Presentation.pptx
 
Lec5_OOP.pptx
Lec5_OOP.pptxLec5_OOP.pptx
Lec5_OOP.pptx
 
Lec_1,2_OOP_(Introduction).pdf
Lec_1,2_OOP_(Introduction).pdfLec_1,2_OOP_(Introduction).pdf
Lec_1,2_OOP_(Introduction).pdf
 
IntroComputerVision23.pptx
IntroComputerVision23.pptxIntroComputerVision23.pptx
IntroComputerVision23.pptx
 

Recently uploaded

Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 

Recently uploaded (20)

Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 

lec07_transformations.pptx

  • 1. Lecture 7: Transformations and warping CS5670: Computer Vision Noah Snavely
  • 3. Announcements • Project 2 out, due Monday, March 4, by 11:59pm on CMS – Please form teams of 2, and create your team on CMS • Project 1 artifact voting
  • 4. Image alignment Why don’t these image line up exactly?
  • 5. What is the geometric relationship between these two images? ? Answer: Similarity transformation (translation, rotation, uniform scale)
  • 6. What is the geometric relationship between these two images? ?
  • 7. What is the geometric relationship between these two images? Very important for creating mosaics! First, we need to know what this transformation is. Second, we need to figure out how to compute it using feature matches.
  • 8. Richard Szeliski Image Stitching 8 Image Warping • image filtering: change range of image • g(x) = h(f(x)) • image warping: change domain of image • g(x) = f(h(x)) f x h g x f x h g x
  • 9. Richard Szeliski Image Stitching 9 Image Warping • image filtering: change range of image • g(x) = h(f(x)) • image warping: change domain of image • g(x) = f(h(x)) h h f f g g
  • 10. Richard Szeliski Image Stitching 11 Parametric (global) warping • Examples of parametric warps: translation rotation aspect
  • 11. Parametric (global) warping • 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 consider linear xforms (can be represented by a 2x2 matrix): T p = (x,y) p’ = (x’,y’)
  • 12. Common linear transformations • Uniform scaling by s: (0,0) (0,0) What is the inverse?
  • 13. Common linear transformations • Rotation by angle θ (about the origin) (0,0) (0,0) What is the inverse? For rotations: θ
  • 14. 2x2 Matrices • What types of transformations can be represented with a 2x2 matrix? 2D mirror about Y axis? 2D mirror across line y = x?
  • 15. • What types of transformations can be represented with a 2x2 matrix? 2D Translation? Translation is not a linear operation on 2D coordinates NO! 2x2 Matrices
  • 16. All 2D 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                    y x d c b a y x ' '                                y x l k j i h g f e d c b a y x ' '
  • 17. Homogeneous coordinates Trick: add one more coordinate: homogeneous image coordinates Converting from homogeneous coordinates x y w (x, y, w) w = 1 (x/w, y/w, 1) homogeneous plane
  • 18. Translation • Solution: homogeneous coordinates to the rescue
  • 19. Affine transformations any transformation represented by a 3x3 matrix with last row [ 0 0 1 ] we call an affine transformation
  • 20. Basic affine transformations                                 1 1 0 0 0 cos sin 0 sin cos 1 ' ' y x y x                                    1 1 0 0 1 0 0 1 1 ' ' y x t t y x y x                                1 1 0 0 0 1 0 1 1 ' ' y x sh sh y x y x Translate 2D in-plane rotation Shear                                1 1 0 0 0 0 0 0 1 ' ' y x s s y x y x Scale
  • 21. 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                          w y x f e d c b a w y x 1 0 0 ' '
  • 22. Is this an affine transformation?
  • 23. Where do we go from here? affine transformation what happens when we mess with this row?
  • 24. Projective Transformations aka Homographies aka Planar Perspective Maps Called a homography (or planar perspective map)
  • 27. Image warping with homographies image plane in front image plane below black area where no pixel maps to
  • 29. Homographies • Homographies … – 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
  • 30. Alternate formulation for homographies where the length of the vector [h00 h01 … h22] is 1
  • 31. 2D image transformations These transformations are a nested set of groups • Closed under composition and inverse is a member
  • 32. Implementing image warping • Given a coordinate xform (x’,y’) = T(x,y) and a source image f(x,y), how do we compute an xformed image g(x’,y’) = f(T(x,y))? f(x,y) g(x’,y’) x x’ T(x,y) y y’
  • 33. Forward Warping • Send each pixel f(x) to its corresponding location (x’,y’) = T(x,y) in g(x’,y’) f(x,y) g(x’,y’) x x’ T(x,y) • What if pixel lands “between” two pixels? y y’
  • 34. Forward Warping • Send each pixel f(x,y) to its corresponding location x’ = h(x,y) in g(x’,y’) f(x,y) g(x’,y’) x x’ T(x,y) • What if pixel lands “between” two pixels? • Answer: add “contribution” to several pixels, normalize later (splatting) • Can still result in holes y y’
  • 35. Inverse Warping • Get each pixel g(x’,y’) from its corresponding location (x,y) = T-1(x,y) in f(x,y) f(x,y) g(x’,y’) x x’ T-1(x,y) • Requires taking the inverse of the transform • What if pixel comes from “between” two pixels? y y’
  • 36. Inverse Warping • Get each pixel g(x’) from its corresponding location x’ = h(x) in f(x) • What if pixel comes from “between” two pixels? • Answer: resample color value from interpolated (prefiltered) source image f(x,y) g(x’,y’) x x’ y y’ T-1(x,y)
  • 37. Interpolation • Possible interpolation filters: – nearest neighbor – bilinear – bicubic – sinc • Needed to prevent “jaggies” and “texture crawl” (with prefiltering)