uba/fcen marzo+27+– abril122013 clase2:+ miercoles+abril3...
TRANSCRIPT
Introducción a la Fotografia 3D UBA/FCEN Marzo 27 – Abril 12 2013
Clase 2 : Miercoles Abril 3
Gabriel Taubin Brown University
Las matemá)cas de la triangulacion 3D
• TriangulaJon por interseccion de linea y plano • TriangulaJon por interseccion de linea y linea • Puntos, vectores, lineas, rayos, and planos • Que es una camara? • Que es una image? • …
3D triangula)on: ray-‐plane Intersec)on
ray
plane
intersecJon point
projector /
coordinate systems world
coordinate system
Que es una Camara?
What is a Camera ?
What is a Camera ?
Modelo Geometrico General de una Camara
• Funcion que a cada punto de la imagen le hace corresponder un rayo • El dominio esta contenido en un rectangulo y la funcion es conJnua • En muchos casos el análisis es mas simple en el espacio de los rayos
W
H u
q(u)
v(u)
optics (black box)
pixel
ray
0 <= u1 <=W 0 <= u2 <= H
Representation of Lines and Rays
line
q
vvqp λ+=reference
point
vector
scale parameter
point
q
v
ray=“1/2 line” vqp λ+=
parameter is positive
Representation of Planes
2211 vvqp λλ ++=
1v
2vqp
P
parametric
n
qp
0)( =− qpntP
implicit
2 scale parameters
reference point
2 vectors
point
reference point
normal vector
1 implicit equation
3D Triangula)on by Line-‐Plane intersec)on
object being scanned
pq n
projected light plane
p
illuminated point on object
camera ray
v
intersection of light plane with object
world coordinate
system
image plane
center of projection
ray direction vector
If camera and projector are calibrated
object being scanned
pq n
projected light plane
p
illuminated point on object
camera ray
vintersection of light plane with object
common world
coordinate system
center of projection
ray direction vector from detected pixel
Lq
3D Triangula)on by Line-‐Line Intersec)on
object being scanned
camera ray 2v
projected light ray
p
lines may not intersect !
Implicit equa)on of the plane
pq n
}0)(:{ =−= pt qpnpP
v
world coordinate
system Plane normal vector
(unit length)
A fixed point on the plane
p
Parametric equa)on of the ray
pq n
L = {p = qL +λv :λ > 0}
camera ray
Lq
v
world coordinate
system
ray direction vector
(unit length)
p
v
Triangula)on by Line-‐Plane Intersec)on
world coordinate
system }{ vqpL L λ+==
camera ray
Lqv
1. Compose implicit and parametric equations
2. Eliminate parameter λ 3. Replace computed λ in
parametric equation
p
pq n
}0)(:{ =−= pt qpnpP
projected light plane
Triangula)on by Line-‐Line Intersec)on
object being scanned
}{ 2222 vqpL λ+==camera ray
2q
2v
projected light ray
1q1v
}{ 1111 vqpL λ+==
p
lines may not intersect !
Triangula)on by Line-‐Line Intersec)on
L2 = {p2 = q2 +λ2v2}
2q2v1q
1v
L1 = {p1 = q1 +λ1v1}
p1 = q1 +λ1v1
p2 = q2 +λ2v2
p1 − p2
v1t (p1 − p2 ) = 0v2t (p2 − p1) = 0
E(λ1,λ2 ) = dist(p2 − p1)2
Minimize
Necessary conditions
p = (p1 + p2 ) / 2
p
Approximate Line-Line Intersection
1q1v
2q
2v
1111 vqp λ+=
2222 vqp λ+=
),( 2112 λλp
Midpoint of segment joining arbitrary points in the two lines
1q1v
2q
2v
),( 2112 λλp
Least-‐‑squares approach
Find parameters which minimize
Approximate Line-Line Intersection
1111 vqp λ+=
2222 vqp λ+=
Perspective Projection (Pinhole Model)
center of projection
image point
image plane
3D point
light direction for a projector
light direction for a camera
Calibration: mapping from image points to rays
The Ideal Pinhole Camera
camera coordinate system = world coordinate system
1v3v2v
⎟⎟⎟⎟
⎠
⎞
⎜⎜⎜⎜
⎝
⎛
=
1
2
1
uu
u0=q
⎟⎟⎟⎟
⎠
⎞
⎜⎜⎜⎜
⎝
⎛
=3
2
1
ppp
p
1=f
The General Pinhole Model
world coordinate system camera coordinate system
WΧ
CΧ
1 2
31
2 3 up
TRXWC +=Χ
Ideal assumptions • Image lengths = world lengths • Focal length = 1 • Image origin = optical center • Image plane spanned by two basis vectors
The General Pinhole Model
world coordinate system camera coordinate system
WΧ
CΧ
1 2
31
2 3 up
TRXWC +=Χ
Plane Defined by Image Line and Projection Center
center of projection q
n
image plane
}0)(:{ =−= qpnpP t
}0:{ == uluL tImplicit equation of line in image coordinates
Structured Ligh)ng
Desktop 3D Photography
Es)ma)ng the equa)on of a plane
r3
r1
r2
T
Plane coordinate system
Camera coordinate system
pj vj
λ jv j = Rpj +T
What is the minimum number of points necessary to solve the problem?
j =1,...,N
vector point
We want to estimate the rotation R and the translation T
Given
How to solve this problem?
R = r1r2r3[ ]
Es)ma)ng the equa)on of a plane
r3
r1
r2
T
pj vjCamera
coordinate system
λ jv j = R pj +T
Plane coordinate system
Implicit equation of plane in the camera coordinate system
{q : r3t (q−T ) = 0}
Parametric equation of plane in the camera coordinate system
{q = T + x r1 + y r2 + 0 r3} p = x, y, 0[ ]t
Es)ma)ng the equa)on of two planes