Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm...
Transcript of Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm...
![Page 1: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/1.jpg)
Lecture 11: Camera Models
CSE 152: Computer VisionHao Su
Credit: CS231a, Stanford, Silvio Savarese
![Page 2: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/2.jpg)
Agenda• Pinhole cameras• Cameras & lenses• The geometry of pinhole cameras
![Page 3: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/3.jpg)
Agenda• Pinhole cameras• Cameras & lenses• The geometry of pinhole cameras
![Page 4: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/4.jpg)
Pinhole camera
f
f = focal lengtho = aperture = pinhole = center of the camera
o
![Page 5: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/5.jpg)
ï
ï í yïîy'= f z
zìx'= f x
Pinhole camera
Derived using similar triangles
[Eq. 1]
f
![Page 6: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/6.jpg)
O
P = [x, z]
P’=[x’, f ]
f xf z
=x¢
i
k
Pinhole camera
[Eq. 2]
f
![Page 7: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/7.jpg)
Kate lazuka ©
Is the size of the apertureimportant?
Pinhole camera
![Page 8: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/8.jpg)
Shrinking aperture
size
Adding lenses!-What happens if the aperture is too small?
-Less light passes through
![Page 9: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/9.jpg)
Agenda• Pinhole cameras• Cameras & lenses• The geometry of pinhole cameras
![Page 10: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/10.jpg)
Cameras & Lenses
• A lens focuses light onto the film
imageP
P’
![Page 11: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/11.jpg)
focal point
f
• A lens focuses light onto the film– All rays parallel to the optical (or principal) axis converge to one
point (the focal point) on a plane located at the focal length f from the center of the lens.
– Rays passing through the center are not deviated
Cameras & Lenses
![Page 12: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/12.jpg)
Pin cushion
Barrel (fisheye lens)
Issues with lenses: Radial Distortion– Deviations are most noticeable for rays that pass through the
edge of the lens
No distortion
Image magnification decreases with distance from the optical axis
![Page 13: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/13.jpg)
Agenda• Pinhole cameras• Cameras & lenses• The geometry of pinhole cameras
– Intrinsic– Extrinsic
![Page 14: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/14.jpg)
Pinhole camera
f = focal lengtho = center of the camera
 3®Â2E
ï
ïí yïîy'= f z
zìx'= f x
f
![Page 15: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/15.jpg)
From retina plane to images
Pixels, bottom-left coordinate systems
fRetina plane
Digital image
![Page 16: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/16.jpg)
Coordinate systems
x
y
xc
yc
C’’=[cx, cy]z zx y(x, y, z)® (f x + c , f y + c )
[Eq. 5]
1. Offset
![Page 17: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/17.jpg)
Converting to pixels
![Page 18: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/18.jpg)
x
y
xc
yc
C=[cx, cy]
z zx yP = (x, y, z)→P '= (α x +c , β y +c )
Is this projective transformation linear?
f
[Eq. 7]
• Is this a linear transformation?No — division by z is nonlinear
• Can we express it in a matrix form?
![Page 19: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/19.jpg)
Homogeneous coordinates
homogeneous image coordinates
homogeneous scene coordinates
• Converting back from homogeneous coordinates
![Page 20: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/20.jpg)
Projective transformation in the homogenous coordinate system
![Page 21: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/21.jpg)
Camera Skewness
![Page 22: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/22.jpg)
World reference system
intrinsic extrinsic
![Page 23: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/23.jpg)
The projective transformation
![Page 24: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/24.jpg)
Properties of projective transformations• Points project to points• line project to lines, rays or degenerate into points• Distant objects look smaller
![Page 25: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/25.jpg)
Properties of Projection
• Angles are not preserved• Parallel lines meet (except for
horizontal lines)
Parallel lines in the world intersect in the image at a “vanishing point”
![Page 26: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/26.jpg)
Horizon line (vanishing line)
• Angles are not preserved• Parallel lines meet (except for
horizontal lines)
Parallel lines in the world intersect in the image at a “vanishing point”
![Page 27: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal](https://reader035.fdocuments.net/reader035/viewer/2022062603/5f0f40827e708231d4433ccd/html5/thumbnails/27.jpg)
Horizon line (vanishing line)