close

Вход

Забыли?

вход по аккаунту

?

Vision for Graphics: Single View Modeling

код для вставкиСкачать
Announcements
• Email list – let me know if you have NOT been getting mail
• Assignment hand in procedure
– web page
– at least 3 panoramas:
В» (1) sample sequence, (2) w/Kaidan, (3) handheld
– hand procedure will be posted online
• Readings for Monday (via web site)
• Seminar on Thursday, Jan 18
Ramin Zabih:
“Energy Minimization for Computer Vision via Graph Cuts “
• Correction to radial distortion term
Today
Single View Modeling
Projective Geometry for Vision/Graphics
on Monday (1/22)
• camera pose estimation and calibration
• bundle adjustment
• nonlinear optimization
3D Modeling from a Photograph
Shape from X
Lee & Kau 91 (from survey by Zhang et al., 1999)
Shape from X
•
•
•
•
Shape from shading
Shape from texture
Shape from focus
Others…
Make strong assumptions – limited applicability
Model-Based Techniques
Blanz & Vetter, Siggraph 1999
Model-based reconstruction
• Acquire a prototype face, or database of prototypes
• Find best fit of prototype(s) to new image
User Input + Projective Geometry
•
•
•
•
Horry et al., “Tour Into the Picture”, SIGGRAPH 96
Criminisi et al., “Single View Metrology”, ICCV 1999
Shum et al., CVPR 98
Images above by Jing Xiao, CMU
Projective Geometry for Vision & Graphics
Uses of projective geometry
•
•
•
•
•
•
•
Drawing
Measurements
Mathematics for projection
Undistorting images
Focus of expansion
Camera pose estimation, match move
Object recognition via invariants
Today: single-view projective geometry
•
•
•
•
•
Projective representation
Point-line duality
Vanishing points/lines
Homographies
The Cross-Ratio
Later: multi-view geometry
Measurements on Planes
4
3
2
1
1
2
Approach: unwarp then measure
3
4
Planar Projective Transformations
Perspective projection of a plane
• lots of names for this:
– homography, texture-map, colineation, planar projective map
• Easily modeled using homogeneous coordinates
пѓ© sx ' пѓ№
пѓ©*
пѓЄ пѓє
пѓЄ
sy ' пЂЅ *
пѓЄ пѓє
пѓЄ
пѓЄпѓ« s пѓєпѓ»
пѓЄпѓ«*
p’
*
*пѓ№ пѓ© x пѓ№
пѓєпѓЄ пѓє
* y
пѓєпѓЄ пѓє
* пѓєпѓ» пѓЄпѓ« 1 пѓєпѓ»
H
p
*
*
To apply a homography H
• compute p’ = Hp
• p’’ = p’/s normalize by dividing by third component
Image Rectification
To unwarp (rectify) an image
• solve for H given p’’ and p
• solve equations of the form: sp’’ = Hp
– linear in unknowns: s and coefficients of H
– need at least 4 points
The Projective Plane
Why do we need homogeneous coordinates?
• represent points at infinity, homographies, perspective projection,
multi-view relationships
What is the geometric intuition?
• a point in the image is a ray in projective space
y
(x,y,1)
(0,0,0)
z
x
(sx,sy,s)
image plane
• Each point (x,y) on the plane is represented by a ray (sx,sy,s)
– all points on the ray are equivalent: (x, y, 1)  (sx, sy, s)
Projective Lines
What is a line in projective space?
• A line is a plane of rays through origin
• all rays (x,y,z) satisfying: ax + by + cz = 0
in vector notation
:
0 пЂЅ пЃ›a
b
пѓ©xпѓ№
пѓЄ пѓє
cпЃќ y
пѓЄ пѓє
пѓЄпѓ« z пѓєпѓ»
l p
• A line is also represented as a homogeneous 3-vector l
Point and Line Duality
• A line l is a homogeneous 3-vector (a ray)
• It is  to every point (ray) p on the line: l p=0
l
p1
p2
l1
p
l2
• What is the line l spanned by rays p1 and p2 ?
• l is  to p1 and p2  l = p1  p2
• l is the plane normal
• What is the intersection of two lines l1 and l2 ?
• p is  to l1 and l2  p = l1  l2
• Points and lines are dual in projective space
• every property of points also applies to lines
Ideal points and lines
y
(sx,sy,0)
y
(sx,sy,0)
z
image plane
z
x
image plane
x
Ideal point (“point at infinity”)
• p  (x, y, 0) – parallel to image plane
• It has infinite image coordinates
Ideal line
• l  (a, b, 0) – parallel to image plane
• Corresponds to a line in the image (finite coordinates)
Homographies of Points and Lines
Computed by 3x3 matrix multiplication
• To transform a point: p’ = Hp
• To transform a line: lp=0  l’p’=0
– 0 = lp = lH-1Hp = lH-1p’  l’ = lH-1
– lines are transformed by premultiplication of H-1
3D Projective Geometry
These concepts generalize naturally to 3D
• Homogeneous coordinates
– Projective 3D points have four coords: P = (X,Y,Z,W)
• Duality
– A plane L is also represented by a 4-vector
– Points and planes are dual in 3D: L P=0
• Projective transformations
– Represented by 4x4 matrices T: P’ = TP,
L’ = L T-1
However
• Can’t use cross-products in 4D. We need new tools
– Grassman-Cayley Algebra
В» generalization of cross product, allows interactions between
points, lines, and planes via “meet” and “join” operators
– Won’t get into this stuff today
3D to 2D: “Perspective” Projection
Matrix Projection:
p
пѓ© sx пѓ№ пѓ©*
пѓЄ пѓє пѓЄ
пЂЅ sy пЂЅ *
пѓЄ пѓє пѓЄ
пѓЄпѓ« s пѓєпѓ» пѓЄпѓ«*
*
*
*
*
*
*
*пѓ№
пѓє
*
пѓє
* пѓєпѓ»
пѓ©X
пѓЄ
Y
пѓЄ
пѓЄZ
пѓЄ
пѓ«1
пѓ№
пѓє
пѓєпЂЅ
пѓє
пѓє
пѓ»
О P
It’s useful to decompose  into T  R  project  A
О пѓ©sx
пѓЄ
пЂЅ 0
пѓЄ
пѓЄпѓ« 0
0
sy
0
пЂ­ t x пѓ№ пѓ©1
пѓєпѓЄ
пЂ­ ty 0
пѓєпѓЄ
1 f пѓєпѓ» пѓЄпѓ« 0
intrinsics
0
0
1
0
0
1
0пѓ№
пѓє пѓ©R 3x3
0 пѓЄ
пѓє
пѓЄ 0
0 пѓєпѓ» пѓ« 1 x 3
projection
0 3 x1 пѓ№ пѓ© I 3 x 3
пѓєпѓЄ
1 пѓєпѓ» пѓЄпѓ« 0 1 x 3
orientation
пѓ№
пѓє
1 пѓєпѓ»
T
3 x1
position
Projection Models
Orthographic
Weak Perspective
Affine
пѓ© ix
пѓЄ
пЂЅ jx
пѓЄ
пѓЄпѓ« 0
iy
iz
jy
jz
0
0
пѓ© ix
пѓЄ
пЂЅ f jx
пѓЄ
пѓЄпѓ« 0
iy
iz
jy
jz
0
0
О О О пѓ©*
пѓЄ
пЂЅ *
пѓЄ
пѓЄпѓ« 0
*
*
*
*
0
0
Perspective
О пЂЅ пЃ›R
tпЃќ
Projective
пѓ©*
пѓЄ
пЂЅ *
пѓЄ
пѓЄпѓ«*
*
*
*
*
*
*
О tx пѓ№
пѓє
ty
пѓє
1 пѓєпѓ»
tx пѓ№
пѓє
ty
пѓє
1 пѓєпѓ»
*пѓ№
пѓє
*
пѓє
1 пѓєпѓ»
*пѓ№
пѓє
*
пѓє
* пѓєпѓ»
Properties of Projection
Preserves
• Lines and conics
• Incidence
• Invariants (cross-ratio)
Does not preserve
• Lengths
• Angles
• Parallelism
Vanishing Points
image plane
vanishing point
camera
center
ground plane
Vanishing point
• projection of a point at infinity
Vanishing Points (2D)
image plane
vanishing point
camera
center
line on ground plane
Vanishing Points
image plane
vanishing point V
camera
center
C
line on ground plane
line on ground plane
Properties
• Any two parallel lines have the same vanishing point
• The ray from C through v point is parallel to the lines
• An image may have more than one vanishing point
Vanishing Lines
v1
v2
Multiple Vanishing Points
• Any set of parallel lines on the plane define a vanishing point
• The union of all of these vanishing points is the horizon line
– called vanishing line in the Criminisi paper
• Note that different planes define different vanishing lines
Vanishing Lines
Multiple Vanishing Points
• Any set of parallel lines on the plane define a vanishing point
• The union of all of these vanishing points is the horizon line
– called vanishing line in the Criminisi paper
• Note that different planes define different vanishing lines
Computing Vanishing Points
V
P0
D
пѓ© PX
пѓЄ
PY
Pt пЂЅ пѓЄ
пѓЄ PZ
пѓЄ
пѓ«
Properties
пЂ« tD X пѓ№
пѓ© PX
пѓє
пѓЄ
пЂ« tD Y
P
пѓє пЃЂ пѓЄ Y
пѓЄ PZ
пЂ« tD Z пѓє
пѓє
пѓЄ
1
пѓ»
пѓ«
/ t пЂ« DX пѓ№
пѓє
/ t пЂ« DY
пѓє
/ t пЂ« DZ пѓє
пѓє
1/ t
пѓ»
tп‚® п‚Ґ
v пЂЅ О P п‚Ґ
• P is a point at infinity, v is its projection
• They depend only on line direction
• Parallel lines P0 + tD, P1 + tD intersect at X
P пЂЅ P0 пЂ« t D
пѓ©DX
пѓЄ
DY
Pп‚Ґ пЃЂ пѓЄ
пѓЄ DZ
пѓЄ
пѓ« 0
пѓ№
пѓє
пѓє
пѓє
пѓє
пѓ»
Computing Vanishing Lines
C
l
ground plane
Properties
•
•
•
•
l is intersection of horizontal plane through C with image plane
Compute l from two sets of parallel lines on ground plane
All points at same height as C project to l
Provides way of comparing height of objects in the scene
Fun With Vanishing Points
Perspective Cues
Perspective Cues
Perspective Cues
Comparing Heights
Vanishing
Point
Measuring Height
5
4
3
2
1
5.4
Camera height
3.3
2.8
Measuring Height Without a Ruler
C
Y
ground plane
Compute Y from image measurements
• Need more than vanishing points to do this
The Cross Ratio
A Projective Invariant
• Something that does not change under projective
transformations (including perspective projection)
The Cross-Ratio of 4 Collinear Points
P3
P4
P2
P1
P3 пЂ­ P1
P4 пЂ­ P2
P3 пЂ­ P2
P4 пЂ­ P1
Can permute the point ordering
• 4! = 24 different orders (but only 6 distinct values)
This is the fundamental invariant of projective geometry
• likely that all other invariants derived from cross-ratio
Measuring Height
п‚Ґ
Scene Cross Ratio
C
b
п‚ҐпЂ­L
TпЂ­L
п‚ҐпЂ­B
(top of object)
L
(height of camera on the this line)
Y
(bottom of object)
TпЂ­L
t пЂ­ b vZ пЂ­ vL
t пЂ­ vL
ground plane
1
Y пЂЅпЃЎY
Image Cross Ratio
B
vZ
пЂЅ
T
t
vL
TпЂ­B
vZ пЂ­ b
пЂЅпЃЎY
Measuring Height
пЃ›X
Y
Z
1пЃќ
0
Z
1пЃќ
T
t
Y
C
b
пЃ›X
T
reference plane
Algebraic Derivation
•
•
пЃІ b пЂЅ О пЃ›X
0
Z
1пЃќ пЂЅ Xa v X пЂ« Zb v Z пЂ« l
пЃ­ t пЂЅ О пЃ›X
Y
Z
1пЃќ пЂЅ Xa v X пЂ« Yb v Y пЂ« пЃЎ Z v Z пЂ« l
T
T
• Eliminating  and  yields
пЃЎY пЂЅ
пЂ­ bп‚ґt
l b vY п‚ґ t
T
• Can calculate  given a known height in scene
So Far
Can measure
• Positions within a plane
• Height
– More generally—distance between any two parallel planes
These capabilities provide sufficient tools for
single-view modeling
To do:
• Compute camera projection matrix
Vanishing Points and Projection Matrix
О пЂЅ пЃ›ПЂ 1
ПЂ 1 пЂЅ О пЃ›1
0
similarly,
ПЂ2 пЂЅ v Y , ПЂ3 пЂЅ v Z
ПЂ 4 пЂЅ О пЃ›0
0
0
0
п‚® convenient
0пЃќ
ПЂ2
T
ПЂ3
ПЂ4пЃќ
= vx (X vanishing point)
1пЃќ пЂЅ projection
T
of world origin
v X п‚ґ vY
to choose ПЂ 4 пЂЅ
call this l
v X п‚ґ vY
О пЂЅ пЃ›v X
vY
vZ
lпЃќ
Not So Fast! We only know v’s up to a scale factor
О пЂЅ пЃ›a v X
bv Y
пЃЎv Z
lпЃќ
• Can fully specify by providing 3 reference lengths
3D Modeling from a Photograph
3D Modeling from a Photograph
Conics
Conic (= quadratic curve)
• Defined by matrix equation
пЃ›x
y
пѓ©*
пѓЄ
1пЃќ *
пѓЄ
пѓЄпѓ«*
*
*
*
*пѓ№ пѓ© x пѓ№
пѓєпѓЄ пѓє
* y пЂЅ 0
пѓєпѓЄ пѓє
* пѓєпѓ» пѓЄпѓ« 1 пѓєпѓ»
• Can also be defined using the cross-ratio of lines
• “Preserved” under projective transformations
– Homography of a circle is a…
– 3D version: quadric surfaces are preserved
• Other interesting properties (Sec. 23.6 in Mundy/Zisserman)
– Tangency
– Bipolar lines
– Silhouettes
Документ
Категория
Презентации
Просмотров
20
Размер файла
6 552 Кб
Теги
1/--страниц
Пожаловаться на содержимое документа