Professional Documents
Culture Documents
Homogeneous Coordinates
Basilio Bona
DAUIN-Politecnico di Torino
July 2009
Rigid motions
July 2009
1 / 32
Introduction
Homogeneous coordinates are an augmented representation of points and
lines in Rn spaces, embedding them in Rn+1 , hence using n + 1 parameters.
This representation is useful in dealing with perspective and projective
transformation (computer graphics, etc.) and for rigid displacement
representation.
We start introducing the concept on 2D spaces.
Given a point p in R2 , represented as P = (p1 , p2 ), i.e., the vector
T
p = p1 p2 its homogeneous representation (using homogeneous
coordinates) is
T
= p1 p2 p3 ;
p
T
with 0 0 0 not allowed
p2 = p2 /
p3
Rigid motions
July 2009
2 / 32
Rigid motions
July 2009
3 / 32
Figure: Points at .
Rigid motions
July 2009
4 / 32
T
= p1 p2 p3 p4
p
Hence
p1 = p1 /
p4 ;
p2 = p2 /
p4 ;
p3 = p3 /
p4
Rigid motions
July 2009
5 / 32
v
vp = p
1
v
v
v
= b a = ab
1
1
0
Not all textbooks adhere to this convention, since in this case the sum of
two geometric vectors produces
vp
vq
vp + vq
vp + vq =
+
=
1
1
2
This sum, once transformed back in 3D space, becomes not the usual
parallelogram sum of segments, but the midpoint of the parallelogram (see
also Affine Spaces).
Basilio Bona (DAUIN-Politecnico di Torino)
Rigid motions
July 2009
6 / 32
Rigid motions
July 2009
7 / 32
Affine spaces
Briefly, affine spaces are spaces where the origin is not considered to be a
special point, and homogeneous coordinates are used to characterize the
affine elements (points and planes).
Rigid motions
July 2009
8 / 32
"
0T
#
v
= Rv + t
1 1
t
Rigid motions
July 2009
9 / 32
"
#"
Rab tab Rbc
0T
0T
tbc
1
"
Rab Rbc
0T
= 2
p
p 3
0
Rigid motions
July 2009
10 / 32
i = y
p
pi =
=
y /f
f y
f
where f is the focal distance
Rigid motions
July 2009
11 / 32
Rigid motions
July 2009
12 / 32
y
Y
=
f
Z
Y = y ,
Z = f
and every 3D point with homogeneous coordinates x
projected onto the same point pi of the image plane .
Rigid motions
T
is
July 2009
13 / 32
Rigid motions
July 2009
14 / 32
Rigid motions
July 2009
15 / 32
Hyperplanes
A hyperplane in Rn is defined by the equation between a set of points pi
and a set of (real) coefficients i
1 p1 + 2 p2 + + n pn + n+1 = 0
Using the homogeneous coordinates we obtain an homogeneous linear
equation in P n
T p
=0
where
1
.
= .. ;
n
n+1
p1
..
.
=
p
p
n
1
The two homogeneous vectors can exchange their roles; we say that they
are dual.
Basilio Bona (DAUIN-Politecnico di Torino)
Rigid motions
July 2009
16 / 32
= p (p)p(t)
dt
Another dual vector is the divergence
is a dual vector wrt p.
p1
T .
..
p=
p1
pn
pn
f = f =
p1
f
p1
T
..
.
pn
f
pn
Rigid motions
July 2009
17 / 32
Rigid motions
July 2009
18 / 32
hence
yielding
T
T
T
b b = a Tab
a Tab p
a = T T T
b
ab
T
Matrix T
ab is called the dual of Tab
Comparing this last equation with the first one, we conclude that points
and lines can be transformed, but using different (dual) collineation
T
matrices Tab and T
ab .
Basilio Bona (DAUIN-Politecnico di Torino)
Rigid motions
July 2009
19 / 32
the slope 1 /2
the x-intercept 3 /1
the y -intercept 3 /2
Rigid motions
July 2009
20 / 32
Duality
A line passing for two points p1 and p2 is defined as
= p1 p2 = S(p1 )p2
A point p belonging to two lines (intercept) 1 and 2 is defined as
p = 1 2 = S(1 )2
Points at infinity or ideal points have the following representation
T
p = p1 p2 0
Rigid motions
July 2009
21 / 32
Three points p1 , p2 , p3 lie on the same line (they are collinear) iff
det p1 p2 p3 = 0
Since the duality principle holds, three lines 1 , 2 , 3 meet at the same
point (they are concurrent) iff
det 1 2 3 = 0
Rigid motions
July 2009
22 / 32
Parallelism
Two lines
m1
m = m2 ;
m3
n1
n = n2
n3
m1
n1
m1 n1
=0
=
or det
m2 n2
m2
n2
p
The direction k 1 points toward the point at infinity.
p2
Basilio Bona (DAUIN-Politecnico di Torino)
Rigid motions
July 2009
23 / 32
Summary
T
p = p1 p2 p3
line
pT = 0
incidence
line
= p1 p2
point
p = 1 2
collinearity
det p1 p2 p3 = 0
collinearity
det 1 2 3 = 0
point
incidence
point
p1 p2 0
T
line
Rigid motions
T
= 1 2 3
T p = 0
0 0 3
T
July 2009
24 / 32
Transformations in P 2
The generic projective transformation (also called homographies) in P 2 is
represented by a non singular 3 3 matrix (acting on homogeneous
vectors), whose elements are
Transformations in P 2
(most general) projective affine similarity Euclidean (rigid)
Basilio Bona (DAUIN-Politecnico di Torino)
Rigid motions
July 2009
25 / 32
The affine transformation must preserve the ideal line and the ideal points
(as well as parallelism); hence, for any arbitrary scaling factor
p1
p1
p2 = T p2
0
0
that implies
Rigid motions
dof=6
July 2009
26 / 32
Rigid motions
July 2009
27 / 32
Rigid motions
July 2009
28 / 32
Historical notes
Homogeneous coordinates were introduced in 1827 by M
obius in the
context of barycentric coordinates. Given a triangle, the barycentric
coordinates of a point P are the weights required at the triangle vertices
such that P become the center of gravity of the triangle.
T
The point is computed as p = wa x wb y wc z , with
wa + wb + wc = 1
Rigid motions
July 2009
29 / 32
T
C2 ,
T
z 6= 0 0
x
x1 + jx2
= z1 + jz2 =
y
y1 + jy2
Rigid motions
July 2009
30 / 32
a xy + b
u
ax + by
az + b
=
= x
=
v
cx + dy
cy +d
cz + d
Mobius transformation
w=
az + b
;
cz + d
a, b, c, d, w , z C
Rigid motions
July 2009
31 / 32
az + b
b z + a
Rigid motions
July 2009
32 / 32