CSCI 497P/597P: Computer Vision
Lecture 13 Forward and Inverse Warping
Projective Transformations
Announcements• Please add a username.txt to the base directory
of your P1 repository, containing (only) your WWU username.
• Reminder: HW1 due Wednesday; P1 due Friday
Goals• Know how to resample images using forward and
inverse warping
• Know the definition of a projective (homography) transformation, and gain some geometric intuition for what it represents in 2D.
• Understand the intuition behind a "point at infinity"
• Know why a homography has 8 degrees of freedom, not 9
Last time: Affine Transformations• Affine transformations
úúû
ù
êêë
é
úúû
ù
êêë
é=
úúû
ù
êêë
é
wyx
fedcba
wyx
100''
Last time: Affine Transformations• Affine transformations
• Properties: • Lines map to lines • Parallel lines remain parallel • Ratios of lengths along lines are preserved • Closed under composition • Origin maps to origin
úúû
ù
êêë
é
úúû
ù
êêë
é=
úúû
ù
êêë
é
wyx
fedcba
wyx
100''
linear
Last time: Affine Transformations• Affine transformations
• Properties: • Lines map to lines • Parallel lines remain parallel • Ratios of lengths along lines are preserved • Closed under composition • Origin does not necessarily map to origin
úúû
ù
êêë
é
úúû
ù
êêë
é=
úúû
ù
êêë
é
wyx
fedcba
wyx
100''
linearaffine
Warping
x
y
x'
y'(480, 241) (265, 238)
We've found correspondence. What's the transformation? 2
4x0
y0
1
3
5 =
2
4
3
5
2
4xy1
3
5
<latexit sha1_base64="GbcbUJICc4KkJ8JTr79IEOn+CpI=">AAAClHicfVFbS8MwFE7rbdbbpuCLL8Hh9Gm0IkxBYSqCT6LgVFjLSLOzLZimJUllo+wX+W9889+YdQO1Ew/k8OU7ty8nYcKZ0q77adkLi0vLK6VVZ219Y3OrXNl+UnEqKbRozGP5EhIFnAloaaY5vCQSSBRyeA5fryfx5zeQisXiUY8SCCLSF6zHKNGG6pTf/RD6TGRhRLRkw7EzPMS+74xy7zk+iO537MIpZvsDlRAKmQfRGNf+uU3a1WpTX+g6pyAX8Mf8Trnq1t3c8DzwZqCKZnbfKX/43ZimEQhNOVGq7bmJDjIiNaMczORUgZH4SvrQNlCQCFSQ5Usd4wPDdHEvluYIjXP2Z0VGIqVGUWgyjb6BKsYm5F+xdqp7p0HGRJJqEHQ6qJdyrGM8+SHcZRKo5iMDCJXMaMV0QCSh2vyjY5bgFZ88D56O695J/ezhpNq8mq2jhPbQPjpCHmqgJrpF96iFqFWxGlbTurR37XP72r6ZptrWrGYH/TL77guL8cX+</latexit>
Warping
x
y
x'
y'
We've found the transformation. How do we warp the image?
(480, 241) (265, 238)
2
4x0
y0
1
3
5 =
2
41 0 �1150 1 �30 9 1
3
5
2
4xy1
3
5
<latexit sha1_base64="6omCMVxRpqIRb3+y72yurOBehmI=">AAAChnicbVHJTsMwEHXCVsJW4MjFomI7UMVdBD0gVXDhCBIFpKaqHHdaLBwnsh1EFfEp/BQ3/gYnLQJaRhrr+c2M33gmTATXxvc/HXdhcWl5pbTqra1vbG6Vt3fudZwqBh0Wi1g9hlSD4BI6hhsBj4kCGoUCHsLnqzz+8AJK81jemXECvYiOJB9yRo2l+uX3IIQRl1kYUaP465v3eoSDwBsXJ/ECkIOf2IU3m03wIfatnxLSzCtynHOn9e9bK2dm3pnTLCT/UeyXK37VLwzPAzIFFTS1m375IxjELI1AGiao1l3iJ6aXUWU4E2CVUw0JZc90BF0LJY1A97JijG/4wDIDPIyVdWlwwf6uyGik9TgKbabt70nPxnLyv1g3NcPzXsZlkhqQbCI0TAU2Mc53ggdcATNibAFlitteMXuiijJjN+fZIZDZL8+D+1qVNKqt20alfTkdRwntoX10jAg6Q210jW5QBzFnwTlxak7dLblVt+meTVJdZ1qzi/6Y2/4CJW26sQ==</latexit>
Warpingy
x'
y'x x'
y'
Warping
x'
y'
x'
y'
Forward Warping
x x’
T(x,y)y y’
Warping
x
y
x'
y'
We've found the transformation. How do we warp the image?
(480, 241) (265.2, 238.1)
2
4x0
y0
1
3
5 =
2
41 0 �114.80 1 �2.90 9 1
3
5
2
4xy1
3
5
<latexit sha1_base64="AFJC5QwW97Bn2A1D6JLzGPEU5EE=">AAACinicbVHbTgIxEO2uF3C9oT760ki8vEB2iRGIMSHqg4+aiJqwhHTLAI3d7qbtGsiGj/GXfPNv7C4YFZxkmjNnZnramSDmTGnX/bTsldW19UJxw9nc2t7ZLe3tP6kokRTaNOKRfAmIAs4EtDXTHF5iCSQMODwHrzdZ/vkNpGKReNSTGLohGQo2YJRoQ/VK734AQybSICRasvHUGZ9i33cm+ek5Poj+T+7KWaz28Al2jVc877zayHqyKGMrtWrzO25m3MJdS7q57D+qvVLZrbq54WXgzUEZze2+V/rw+xFNQhCacqJUx3Nj3U2J1IxyMMqJgpjQVzKEjoGChKC6aT7KKT42TB8PImlcaJyzvztSEio1CQNTad43Uou5jPwv10n0oNFNmYgTDYLOhAYJxzrC2V5wn0mgmk8MIFQy81ZMR0QSqs32HDMEb/HLy+CpVjVraD6cl1vX83EU0SE6QmfIQ3XUQnfoHrURtQpWxbqw6vaWXbOb9uWs1LbmPQfoj9m3X5NEu6Q=</latexit>
f(x,y)x
y
g(x’,y’)x’
T
Inverse Warping
T-1(x,y)y y’
Bilinear Interpolation
Other interpolation filters exist
Image by Cmglee - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=53064904
Are these related by an affine transformation?
Affine Transformations
Scott: No messing with the third row!
Affine Transformations
Scott: No messing with the third row!
mess with the third
row
Students:
Well... you asked.
Hang on a minute: what does it even mean if w != 1?
Well... you asked.
To get the 2D coordinates, we need to normalize.
What does this do?
https://iis.uibk.ac.at/public/piater/courses/demos/homography/homography.xhtml
Projective Transformation (also known as Homograpy)
Homogeneous Coordinates:Intuition for our math hack
A 3-vector belongs to a family of 3-vectors representing the same 2D point.
1D example, for intuition: A 2-vector belongs to a family of 2-vectors representing the same 1D point.
Homographies for image alignment