CMT107 Visual Computing
Camera Calibration
Copyright By PowCoder代写 加微信 powcoder
School of Computer Science and Informatics
Cardiff University
• Pinhole cameras
• Vanishing points
• Real camera
• Aperture adjustment
• Thin lens formula
• Lens flaws
• Pinhole camera model
• Camera parameters: intrinsic parameters, extrinsic parameters
• Camera calibration
• Linear method
Acknowledgement
The majority of the slides in this section are from at University of Illinois at Urbana-Champaign
Let’s Design a Camera
• Idea 1: put a piece of film in front of an object?
• Do we get a reasonable image?
Let’s Design a Camera
• Add a barrier to block off most of the rays
• This reduces blurring
• The opening is know as the aperture
Pinhole Camera Model
• Pinhole model:
• Captures pencil of rays – all rays through a single point (pinhole)
• The point is called centre of projection (focal point)
• The image is formed on the image plane
• A virtual image plane is used as mathematical description of the real image plane
Image plane
Vanishing Points
• Parallel lines are no longer parallel after projection. They converge at a single
point on the image plane – vanishing point
• Each direction in space has its own vanishing point
• Exception: directions parallel to the image plane
vanishing point
Building a Real Camera
Home-made Pinhole Camera
• Why so blurry?
“a larger pinhole to compensate for
the smaller amount of light. The result
is an image with more blur.”
http://www.debevec.org/Pinhole/
http://www.debevec.org/Pinhole/35mm-pinhole-camera.jpg
http://www.debevec.org/Pinhole/
Shrinking the Aperture
• Why not make the aperture as small as possible?
• Less light get through
• Diffraction effects …
Shrinking the Aperture
Adding a Lens
• A lens focuses light onto the film
• Thin lens model:
• Rays passing through the centre are not deviated (pinhole projection model still holds)
• A lens focuses light onto the film
• Thin lens model:
• Rays passing through the centre are not deviated (pinhole projection model still holds)
• All parallel rays converge to one point on a plane located at the focal length 𝑓
Adding a Lens
focal point
Adding a Lens
• A lens focuses light onto the film
• There is a specific distance at which an object is “in focus”, other points project to a
“circle of confusion” in the image
“circle of
confusion”
Thin Lens Formula
• What is the relation between:
The focal length 𝑓
The distance of the object
from the optical centre 𝐷
The distance at which the
object will be in focus 𝐷′
objectimage
Thin Lens Formula
• Similar triangles everywhere!
objectimage
Thin Lens Formula
• Similar triangles everywhere!
objectimage
Thin Lens Formula
• Similar triangles everywhere!
objectimage
Thin Lens Formula
• Any point satisfying the thin
lens equation is in focus
• As 𝑓 is fixed, the farther the
object, the closer the plane of
objectimage
Real Lenses
Lens Flaws: Chromatic Aberration
• Lens has different refractive indices for different
wavelengths, causes colour fringing
Near Lens centre Near Lens Outer Edge
Lens Flaws: Spherical Aberration
• Spherical lenses do not focus light perfectly
• Rays farther from the optical axis focus closer
Lens Flaws: Vignetting
Lens Flaws: Radial Distortion
• Caused by imperfect lenses
• Deviations are most noticeable near the edge of the lens
No distortion Pin cushion Barrel
Pinhole Camera Model Revisit
• Principal axis: line from the camera centre perpendicular to the image plane
• Camera coordinate system: camera centre is at the origin and the principal
axis is the z-axis
Pinhole Camera Model Revisit
)/,/(),,( ZYfZXfZYX
Principal Point
• Principal point (p): point where principal axis intersects the image plane
• Normalised coordinate system: origin is at the principal point
• Image coordinate system: origin is in the corner
• How to go from normalized coordinate system to image coordinate system?
Principal Point Offset
Principal point:
pZYfpZXfZYX ++
Principal Point Offset
K 0|IKP =Calibration Matrix
Pixel Coordinates
• 𝑚𝑥 pixels per meter in horizontal direction;
𝑚𝑦 pixels per meter in vertical direction
Pixel size:
Camera Rotation and Translation
• In general, the camera coordinate
frame will be related to the world
coordinate frame by a rotation and
a translation
( )C~-X~RX~
coords. of point
in camera frame
coords. of camera centre
in world frame
coords. of a point
in world frame (nonhomogeneous)
Camera Rotation and Translation
• In non-homogenous coordinates
• In homogenous coordinates
( )C~-X~RX~
XC~R|RKX0|IKx
−== ,t|RKP = C
Camera Parameters
• Intrinsic parameters
• Principal point coordinates
• Focal length
• Pixel magnification factors
• Skew (non-rectangular pixels)
• Radio distortion
Camera Parameters
• Intrinsic parameters
• Principal point coordinates
• Focal length
• Pixel magnification factors
• Skew (non-rectangular pixels)
• Radio distortion
• Extrinsic parameters
• Rotation and translation relative to world coordinate system
Camera Calibration
𝐱 = 𝐏𝐗 = 𝐊 𝐑 𝐓 𝐗
Camera Calibration
• Given 𝑛 points with known 3D coordinates 𝑋𝑖 and known image projections
𝑥𝑖, estimate the camera parameters
Camera Calibration: Linear Method
T = 𝑃11 𝑃12 𝑃13 𝑃14
T = 𝑃21 𝑃22 𝑃23 𝑃24
T = 𝑃31 𝑃32 𝑃33 𝑃34
Two linearly independent equations
xi × PXi = 0,
Camera Calibration: Linear Method
= 0 AP = 0
• P has 11 degrees of freedom (12 parameters, but scale is arbitrary
• One 2D/3D correspondence gives two linearly independent equations
• At least 6 correspondences are needed for a solution
• Homogeneous least squares
• The eigenvector corresponding to the smallest eigenvalue of ATA
Camera Calibration: Linear Method
= 0 AP = 0
• Note: for coplanar points that satisfy Π𝑇X = 0, we will get the degenerate
solutions: Π, 0, 0 , 0, Π, 0 , or 0, 0, Π .
Camera Calibration: Linear Method
• Advantages
• Easy to formulate and solve
• Disadvantages
• Doesn’t directly tell you camera parameters
• Can’t impose constraints, such as known focal length and orthogonality
• Doesn’t model radial distortion
• Only an approximate solution
• Non-linear methods are preferred
• Define error as difference between projected points and measured points
• Minimise error using Newton’s method or other non-linear optimisation
• Describe pinhole model.
• What is vanishing point?
• What are intrinsic/extrinsic camera parameters?
• Describe the linear camera calibration method.
• What are the advantages and disadvantages of linear method for camera
calibration?
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com