PowerPoint 프레젠테이션
Changjae Oh
Copyright By PowCoder代写 加微信 powcoder
Computer Vision
– Calibration –
Semester 1, 22/23
Objectives
• Understanding the concept of camera calibration
• Understanding the relationship between image coordinate,
camera coordinate, and world coordinate
• Understanding a linear method for camera calibration
Our goal: Recovery of 3D structure
J. Vermeer, Music Lesson, 1662
A. Criminisi, M. Kemp, and A. Zisserman,Bringing Pictorial Space to Life: computer techniques for the analysis of painti
ngs, Proc. Computers and the History of Art, 2002
http://research.microsoft.com/apps/pubs/default.aspx?id=67260
Things aren’t always as they appear…
http://en.wikipedia.org/wiki/Ames_room
http://en.wikipedia.org/wiki/Ames_room
Single-view ambiguity
Single-view ambiguity
Single-view ambiguity
shadow sculptures
Our goal: Recovery of 3D structure
• When certain assumptions hold, we ca
n recover structure from a single view
•In general, we need multi-view geometry
Image source
• But first, we need to understand the geometry of a single camera…
https://www.3dflow.net/elementsCV/S4.xhtml
Camera calibration
• Camera calibration:
̶ figuring out transformation from world coordinate system to image coordinate system
• Normalized (camera) coordinate system: camera center is at the origin,
the principal axis is the z-axis;
x and y axes of the image plane are parallel to x and y axes of the world
world coordinate system
)/,/(),,( ZYfZXfZYX
Review: Pinhole camera model
Principal point
• Principal point (𝒑): point where principal axis intersects the image plane
• Normalized coordinate system: origin of the image is at the principal point
• Image coordinate system: origin is in the corner
Principal point offset
pZYfpZXfZYX ++
We want the principal point to
map to (px, py) instead of (0,0)
Principal point offset
principal point: ),(
Principal point offset
calibration matrix
0|IKP =
principal point: ),(
projection matrix
Pixel coordinates
• mx pixels per meter in horizontal direction,
my pixels per meter in vertical direction
Pixel size:
pixels/m m pixels
( )C~X~RX~
Camera rotation and translation
• In general, the camera coordin
ate frame will be related to th
e world coordinate frame by a
rotation and a translation
coords. of point
in camera frame
coords. of camera center
in world frame
coords. of a point
in world frame
• Conversion from world to camera coordinate system
(in non-homogeneous coordinates):
camera coordinate
system world coordinate
Camera rotation and translation
( )C~X~RX~
3D transformation
matrix (4 x 4)
camera coordinate system world coordinate system
Camera rotation and translation
( )C~X~RX~
3D transformation
matrix (4 x 4)
camera coordinate system world coordinate system
Camera rotation and translation
3D transformation
matrix (4 x 4)
perspective project
ion matrix (3 x 4)
2D transformatio
n matrix (3 x 3)
camera coordinate system world coordinate system
Camera rotation and translation
camera coordinate system world coordinate system
Camera rotation and translation
camera coordinate system world coordinate system
Camera parameters
• Intrinsic parameters
̶ Principal point coordinates
̶ Focal length
̶ Pixel magnification factors
̶ Skew (non-rectangular pixels), Radial distortion
Camera parameters
• Intrinsic parameters
̶ Principal point coordinates
̶ Focal length
̶ Pixel magnification factors
̶ Skew (non-rectangular pixels), Radial distortion
• Extrinsic parameters
̶ Rotation and translation relative
to world coordinate system
̶ What is the projection of the
camera center?
CRRKP ~−=
coords. of camera center
in world frame
CRRKPC The camera center is the null space
of the projection matrix!
Camera calibration
XtRKx =
Camera calibration
• Given n points with known 3D coordinates Xi and known image projections
xi, estimate the camera parameters
Camera calibration: Linear method
• 𝑷 has 11 degrees of freedom
• One 2D/3D correspondence gives us two linearly independent equations
̶ 6 correspondences needed for a minimal solution
Camera calibration: Linear method
• 𝑷 has 11 degrees of freedom
• One 2D/3D correspondence gives us two linearly independent equations
̶ 6 correspondences needed for a minimal solution
Recall: Week1 quiz
Camera calibration: Linear method
• Directly estimate 11 unknowns in the P matrix using known 3D points
(𝑋, 𝑌, 𝑍) and measured (𝑋𝑖 , 𝑌𝑖 , 𝑍𝑖) and measured feature positions (𝑢𝑖 , 𝑣𝑖)
Camera calibration: Linear method
• Directly estimate 11 unknowns in the P matrix using known 3D points
(𝑋, 𝑌, 𝑍) and measured (𝑋𝑖 , 𝑌𝑖 , 𝑍𝑖) and measured feature positions (𝑢𝑖 , 𝑣𝑖)
Camera calibration: Linear method
• Solve for Projection Matrix 𝑷 using least-square techniques
Camera calibration: linear vs. nonlinear
• Linear calibration is easy to formulate and solve, but it doesn’t directly
tell us the camera parameters
• In practice, non-linear methods are preferred
̶ Write down objective function in terms of intrinsic and extrinsic parameters
̶ Define error as sum of squared distances between measured 2D points and estimated
projections of 3D points
̶ Minimize error using Newton’s method or other non-linear optimization
̶ Can model radial distortion and impose constraints such as known focal length and or
thogonality
XtRKx =vs.
Application?
• Calibration is fundamental task for various computer vision tasks
https://ch.mathworks.com/help/vision/ug/single-camera-calibrator-app.html
Application?
• Calibration is fundamental task for various computer vision tasks
Xiang et al. “PoseCNN: A Convolutional Neural Network for 6D Object Pose Estimation in Cluttered Scenes.” RSS, 2018
Changjae Oh
Computer Vision
– Single-view Modeling –
Semester 1, 22/23
Objectives
• To understand calibration from vanishing points
• To understand measuring height without ruler
Application: Single-view modelling
A. Criminisi, I. Reid, and A. Zisserman, Sin
gle View Metrology, IJCV 2000
http://dhoiem.cs.illinois.edu/courses/vision_spring10/sources/criminisi00.pdf
Camera calibration revisited
• What if world coordinates of reference 3D points are not known?
• We can use scene features such as vanishing points
Camera calibration revisited
• What if world coordinates of reference 3D points are not known?
• We can use scene features such as vanishing points
Vertical vanishing
(at infinity)
Slide from Efros, Photo from Criminisi
Recall: Vanishing points
• All lines having the same direction share the same vanishing point
image plane
line in the scene
vanishing point v
Computing vanishing points
̶ X∞ is a point at infinity, v is its projection: v = PX∞
̶ The vanishing point depends only on line direction
̶ All lines having direction d intersect at X∞
Calibration from vanishing points
• Consider a scene with three orthogonal vanishing directions:
• Note: v1, v2 are finite vanishing points and v3 is an infinite vanishing point
Calibration from vanishing points
• Consider a scene with three orthogonal vanishing directions:
• We can align the world coordinate system with these directions
Calibration from vanishing points
• p1 = P(1,0,0,0)
T – the vanishing point in the x direction
• Similarly, p2 and p3 are the vanishing points in the y and z directions
• p4 = P(0,0,0,1)
T – projection of the origin of the world coordinate system
• Problem: we can only know the four columns up to independent scale factors, addition
al constraints needed to solve for them
Calibration from vanishing points
• Let us align the world coordinate system with three orthogonal vanishing
directions in the scene:
Calibration from vanishing points
• Let us align the world coordinate system with three orthogonal vanishing
directions in the scene:
• Orthogonality constraint:
Calibration from vanishing points
• Let us align the world coordinate system with three orthogonal vanishing
directions in the scene:
• Orthogonality constraint:
• Rotation disappears, each pair of vanishing points gives constraint on focal
length and principal point
Calibration from vanishing points
Can solve for focal length, principal pointCannot recover focal length, principal
point is the third vanishing point
Rotation from vanishing points
• Constraints on vanishing points:
• After solving for the calibration matrix:
• Get λi by using the constraint ||ri||
Calibration from vanishing points: Summary
• Solve for K (focal length, principal point) using three orthogonal vanishing points
• Get rotation directly from vanishing points once calibration matrix is known
• Advantages
̶ No need for calibration chart, 2D-3D correspondences
̶ Could be completely automatic
• Disadvantages
̶ Only applies to certain kinds of scenes
̶ Inaccuracies in computation of vanishing points
̶ Problems due to infinite vanishing points
Making measurements from a single image
http://en.wikipedia.org/wiki/Ames_room
http://en.wikipedia.org/wiki/Ames_room
Recall: Measuring height
Camera height
Measuring height without a ruler
ground plane
Compute Z from image measurements
• Need more than vanishing points to do this
Projective invariant
• We need to use a projective invariant: a quantity that does not change u
nder projective transformations (including perspective projection)
̶ What are some invariants for similarity, affine transformations?
Projective invariant
• We need to use a projective invariant: a quantity that does not change u
nder projective transformations (including perspective projection)
̶ The cross-ratio of four points:
image cross ratio
Measuring height
B (bottom of object)
T (top of object)
R (reference point)
ground plane
scene cross ratio
Measuring height without a ruler
image cross ratio
vanishing line (horizon)
A. Criminisi, I. Reid, and A. Zisserman, Single View Metrology, IJCV 2000
Figure from UPenn CIS580 slides
http://dhoiem.cs.illinois.edu/courses/vision_spring10/sources/criminisi00.pdf
http://cis.upenn.edu/~cis580/Spring2015/Lectures/cis580-04-singleview.pdf
Measurements on planes
Approach: unwarp then measure
What kind of warp is this?
Image rectification
• To unwarp (rectify) an image
̶ solve for homography H given p and p′
̶ how many points are necessary to solve for H?
Image rectification: example
Piero della Francesca, Flagellation, ca. 1455
Application: 3D modeling from a single image
A. Criminisi, M. Kemp, and A. Zisserman,Bringing Pictorial Space to Life: computer techniques for the analysis of paintings,
Proc. Computers and the History of Art, 2002
http://research.microsoft.com/apps/pubs/default.aspx?id=67260
Application: 3D modeling from a single image
J. Vermeer, Music Lesson, 1662
A. Criminisi, M. Kemp, and A. Zisserman,Bringing Pictorial Space to Life: computer techniques for the analysis of paintings,
Proc. Computers and the History of Art, 2002
http://research.microsoft.com/apps/pubs/default.aspx?id=67260
Application: Fully automatic modeling
D. Hoiem, A.A. Efros, and M. Hebert, Automatic Photo Pop-up, SIGGRAPH 2005.
http://dhoiem.cs.illinois.edu/publications/popup.pdf
Application: Object detection
D. Hoiem, A.A. Efros, and M. Hebert, Putting Objects in Perspective, CVPR 2006
https://web.engr.illinois.edu/~dhoiem/publications/hoiem_cvpr06.pdf
Next Topic
• How about using two cameras?
̶ Prerequisite
• Review Part2-3: Calibration (this content!)
• Review Part1-3: Bilateral filtering
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com