Download Homogeneous coordinates in the plane Homogeneous coordinates

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Projective variety wikipedia , lookup

Metric tensor wikipedia , lookup

Perspective (graphical) wikipedia , lookup

Analytic geometry wikipedia , lookup

Rational trigonometry wikipedia , lookup

Euclidean geometry wikipedia , lookup

Algebraic variety wikipedia , lookup

Möbius transformation wikipedia , lookup

Cartesian coordinate system wikipedia , lookup

Derivations of the Lorentz transformations wikipedia , lookup

Lie sphere geometry wikipedia , lookup

Projective plane wikipedia , lookup

Conic section wikipedia , lookup

Homography wikipedia , lookup

Duality (projective geometry) wikipedia , lookup

Line (geometry) wikipedia , lookup

Transcript
Homogeneous coordinates in the plane
Homogeneous coordinates in the plane
A line in the plane ax + by + c = 0 is represented as (a, b, c)> .
A point x = (x, y)> is on the line l = (a, b, c)> iff ax + by + c = 0.
A line is a subset of points in the plane.
The line equation may be written as
(x, y, 1)(a, b, c)> = (x, y, 1)l = 0, where the vector (x, y, 1)
corresponds to the 2D Cartesian point (x, y).
All vectors (ka, kb, kc)> = k(a, b, c)> , k 6= 0 represent the same line
as (a, b, c)> .
Two vectors k1 (a, b, c) and k2 (a, b, c), k1 6= 0, k2 6= 0 are said to be
equivalent.
The equivalence class k(a, b, c), k 6= 0 is called homogeneous
vectors.
If (x, y, 1)l = 0 and k 6= 0 then k(x, y, 1)l = 0.
Any vector (kx, ky, k), k 6= 0 is a homogeneous representation of
the 2D point (x, y).
The vector (0, 0, 0) does not represent any line.
An arbitrary homogeneous vector x = (x1 , x2 , x3 )> , x3 6= 0,
represents the point (x1 /x3 , x2 /x3 ) in R2 .
The set of homogeneous vectors R3 − (0, 0, 0)> forms the
projective space P 2 .
A homogeneous vector has 2 degrees of freedom, it is
represented by 3 elements but has arbitrary scale.
>
2D homographies – p. 1
2D homographies – p. 2
Lines and points
Lines and points
A point x is on a line l iff x> l = 0.
A line l intersects a point x iff l> x = 0.
Let L = [l l0 ]. The null-space N of L> is defined as
N (L> ) = {x : L> x = 0}.
An intersection point x between two lines l and l0 satisfies x> l = 0
and x> l0 = 0, i.e. x is orthogonal to l and l0 .
For l, l0 ∈ R3 this is satisfied by e.g. v = l × l0 , where the cross
product × is defined as
Ex. The lines l = (1, 1, −2) and l0 = (1, 0, −1)T have intersection
x = (1, 1, 1)T since xT l = 0 and xT l0 = 0.
Similarly, a line l through two points x and x0 satisfies lT x = 0 and
lT x0 = 0.
Ex. The points x = (1, 1, 1)T and x0 = (2, 0, 1)T are intersected by
the line l = (1, 1, 2)T , x + y − 2 = 0 since lT x = 0 and lT x0 = 0.
where
i
a × b = a1
b1
j
a2
b2
k
a3
b3



a2 b3 − a3 b2


=  a3 b1 − a1 b3  = [a]× b,
a1 b2 − a2 b1
0

[a]× =  a3
−a2
−a3
0
a1

a2

−a1  .
0
Similarly, a line through the points x and x0 may be calculated as
l = x × x0 .
2D homographies – p. 3
2D homographies – p. 4
The intersection of parallel lines
The line at infinity
Two parallel lines l = (a, b, c) and l0 = (a, b, c0 ) intersect each other
at the point x = l × l0 = (c0 − c)(b, −a, 0)> .
The point (b, −a, 0)> does not have a finite representation since
(b/0, −a/0)> is not defined. This corresponds to the interpretation
that parallel lines have no intersection in the Euclidean plane.
However, if we study
Homogeneous vectors x = (x1 , x2 , x3 )> with x3 6= 0 correspond to
finite points in the real space R2 or “the set of intersections
between non-parallel lines”.
If we extend R2 with points having x3 = 0 (but (x1 , x2 )> 6= (0, 0)> )
we get the projective space P 2 . Points with x3 = 0 are called ideal
point or points “at infinity”.
All ideal points (x1 , x2 , 0)> are on the line at infinity l∞ = (0, 0, 1)> ,
since (x1 , x2 , 0)(0, 0, 1)> = 0.
lim (b, −a, k)>
k→0
with Cartesian representation
In the projective plane P 2 two distinct lines have exactly one
intersection point, independently of if they are parallel or not.
lim (b/k, −a/k)> ,
The geometry of P n is called projective geometry.
k→0
we may interpret the vector (b, −a, 0)> as being infinitely far away
in the direction of (b, −a)> .
2D homographies – p. 6
2D homographies – p. 5
Interpretation of the projective plane
A useful interpretation of P 2 is
as a set of rays in R3 .
A homogeneous vector
k(x1 , x2 , x3 )> , k 6= 0
corresponds to a ray though
the origin.
The inhomogeneous
representation is given from
its intersection with the plane
x3 = 1.
Duality
Since x> l = l> x, the meaning of lines and points are
interchangeable. Thus, for any relation in P 2 there is a dual
relation where the meaning of lines and points are interchanged.
x2
The equation x> l = 0 may be interpreted as that the point x is on
the line l, but also that the point l is on the line x.
ideal
point
The equations x> l = x> l0 = 0 may be interpreted as that the point
x is on the lines l and l0 , but also that the line x intersects the
points l and l0 .
l
O
x
π
x3
Rays for ideal points lie within
the plane x3 = 0 and have no x
(Euclidean) intersection with 1
the plane x3 = 1.
2D homographies – p. 7
2D homographies – p. 8
The conic equation
Conics
A conic (section) is a second order curve in the plane. In
Euclidean space there are three types of conics: ellipses,
parabolas, and hyperbolas. Degenerate conics consist of a point
or one or two lines.
The equation for a conic in Euclidean coordinates is
ax2 + bxy + cy 2 + dx + ey + f = 0.
In homogeneous coordinate x = x1 /x3 , y = x2 /x3 it becomes
ax21 + bx1 x2 + cx22 + dx1 x3 + ex2 x3 + f x23 = 0
or in matrix form
x> Cx = 0,
where


a
b/2 d/2


C =  b/2
c
e/2  .
d/2 e/2 f
A conic has 5 degrees of freedom since it defined by 6 parameters
but has arbitrary scale.
2D homographies – p. 9
2D homographies – p. 10
Five points define a conic
Five points define a conic
Given the points x1 = (0, 0, 1), x2
x5 = (0, 1, 0) we get
2
1 −1
1 −1 1
6 0
0
0
0 0
6
6
X=6 1
1
1
1 1
6
4 4
8 16
2 4
0
0
1
0 0
Every point on a conic gives one equation for the coefficients since any point
(xi , yi , zi ) intersected by the conic has to satisfy
ax2i
+ bxi yi +
cyi2
+ dxi zi + eyi zi +
f zi2
= 0.
This may be written as
h
x2i
xi yi
yi2
xi zi
yi zi
zi2
i
c = 0,
6
6
6
6
6
4
x1 y1
x2 y2
x3 y3
x4 y4
x5 y5
y12
y22
y32
y42
y52
x1 z1
x2 z2
x3 z3
x4 z4
x5 z5
y1 z1
y2 z2
y3 z3
y4 z4
y5 z5
z12
z22
z32
z42
z52
3
7
7
7
7
7
5
6
5
4
3
2
With 5 points we get
x21
x22
x23
x24
x25
1
1
1
1
0
with null-vector
where c = (a, b, c, d, e, f )> is the conic C as a 6-vector.
2
= (−1, 1, 1), x3 = (1, 1, 1), x4 = (2, 4, 1),
6
6
6
6
c=6
6
6
6
4
3
7
7
7
7 c = Xc = 0,
7
5
1
0
0
0
−1
0
3
7
2
7
7
1
7
7 and conic C = 6
0
4
7
7
0
7
5
2
0
0
− 21
0
− 12
0
3
7
5
1
0
−1
−2
−5
−4
−3
−2
−1
0
1
2
3
4
5
or x2 − y = 0.
where c is obtained as a null-vector to the 5 × 6 matrix X.
2D homographies – p. 11
2D homographies – p. 12
Conic tangents
Dual conics
The equation x> Cx = 0 defines a subset of points in P 2 . The conic
C is called a point conic.
The tangent l to a conic C in a point x on C is given by
l = Cx.
There is a corresponding second order expression for lines. A line
conic (dual conic) is denoted C∗ , where C∗ is the adjoint matrix to C
and the equation
l> C∗ l = 0
Example: The conic (x/3)2 + (y/2)2 = 1 or
2
1
9
0
6
C=4 0
0
1
4
0
3
0
7
0 5
−1
intersects the points x1 = (3, 0, 1)> and
x2 = (0, 2, 1)> . The tangents are
4
define the subset of all lines in P 2 that are tangent to the point
conic C.
3
2
1
0
l1 = Cx1 = (1/3, 0, −1)> or x = 3,
and
−1
−2
−3
−2
−1
0
1
2
3
4
l2 = Cx2 = (0, 1/2, −1)> or y = 2.
x> Cx = 0
l> C∗ l = 0
2D homographies – p. 13
2D homographies – p. 14
Projective transformations
Dual conics
If C is symmetric with full rank then C−1 = C∗ up to scale. This means that all
points x on C have unique tangents l = Cx and all tangents l have unique
tangency points x = C−1 l.
Definition: A projectivity (or projective transformation or homography ) is an invertible
mapping h from P 2 onto itself such that three points x1 , x2 , and x3 are collinear iff
h(x1 ), h(x2 ), and h(x3 ) also are collinear.
In this case the the point conic x> Cx = 0 corresponds to the line conic C−1
since
0 = x> Cx = (C−1 l)> C(C−1 l) = l> C−1 l = 0.
Thus: Lines are mapped onto lines.
Should the matrix C be rank deficient the conic is degenerate.
x
Degenerate point conics include two lines (rank 2) and one line (rank 1).
x
Ex. the point conic C = lm> + ml> consists of the lines l and m. The
null-vector x = l × m on both lines l and m does not have a unique tangent.
Degenerate line conics include two points (rank 2) and one point (rank 2).
Ex. The line conic C∗ = xy> + yx> has rank 2 and consists of all lines
intersecting x and/or y. All lines have unique tangency points except
l = x × y.
/
O
y/
π/
x/
π
y
x
All projective transformations of homogeneous points x may be written as
x0 = h(x) = Hx, where H is a non-singular 3 × 3-matrix.
The matrix H has 8 degrees of freedom (9 elements, arbitrary scale).
2D homographies – p. 15
2D homographies – p. 16
Rectification of plane perspective
If the coordinates for 4 points xi and their mappings x0i in the image are
known, we may calculate the homography H.
Rectification of plane perspective
Given H we may apply H−1 to remove the effect of the perspective
transformation.
Each point pair x = (x, y) and x0 = (x0 , y 0 ) has to satisfy
x0 =
x01
h11 x + h12 y + h13
=
0
x3
h31 x + h32 y + h33
y0 =
h21 x + h22 y + h23
x02
=
x03
h31 x + h32 y + h33
or
x0 (h31 x + h32 y + h33 ) = h11 x + h12 y + h13
y 0 (h31 x + h32 y + h33 ) = h21 x + h22 y + h23 .
The latter equations are linear in hij .
Given 4 points we get 8 equations, enough to uniquely determine H
assuming the points are in “standard position”, i.e. no 3 points are collinear.
2D homographies – p. 17
2D homographies – p. 18
normhomo.m and lines2pt.m
drawhomoline.m
function X=homonorm(X)
%HOMONORM Normalize homogenous points.
%
%X=homonorm(X);
% v1.0
function h=drawhomoline(L,varargin)
%DRAWHOMOLINE Draw homogenous line.
%
%h=drawhomoline(L[,line attributes])
%L - matrix with homogenous lines in
%
each column.
%h - graphic handles.
2002-03-19. Niclas Borlin, [email protected].
[m,n]=size(X);
% v1.0
%
X=X./X(m*ones(1,n),:);
% Get axes scaling.
ax=axis;
xlim=ax(1:2);
ylim=ax(3:4);
function x=lines2pt(l1,l2)
%LINES2PT Find homogenous intersection of two homogenous lines.
%
%x=lines2pt(l1,l2)
%l1,l2 - lines in homogenous coordinates.
%x
- intersection in homogenous coordinates.
% v1.0
2002-03-24. Niclas Borlin,
[email protected].
% Construct lines for each side of
% the axis.
axL=[1,1,0,0;
0,0,1,1;
-xlim,-ylim];
2002-03-19. Niclas Borlin, [email protected].
% Preallocate handle vector for lines.
h=zeros(size(L,2),1);
for i=1:size(L,2)
l=L(:,i);
% Determine if line is more vertical or
% horizontal.
if (abs(l(1))<abs(l(2)))
% More horizontal. Calculate intersection to
% left/right sides.
x1=normhomo(lines2pt(l,axL(:,1)));
x2=normhomo(lines2pt(l,axL(:,2)));
else
% More vertical. Calculate intersection to
% upper/lower sides.
x1=normhomo(lines2pt(l,axL(:,3)));
x2=normhomo(lines2pt(l,axL(:,4)));
end
h(i)=line([x1(1),x2(1)],[x1(2),x2(2)],varargin{:});
end
x=null([l1,l2]’);
2D homographies – p. 19
2D homographies – p. 20
Transformation of points, lines, and conics
Consider a point homography x0 = Hx. If x1 and x2 are on the line l
then the points x01 and x02 will also be on a line l0 = H−> l since
Transformations of points, lines, and conics
15
5
4
10
l0> x0i
−>
= (H
l)> x0i
> −1
=l H
>
Hxi = l xi = 0.
3
2
Under the same point mapping x0 = Hx a conic C is mapped to
C0 = H−> CH−1 since
x> Cx = x0>
5
1
0
0
>
H−1 CH−1 x0 = x0> |H−>{z
CH−1} x0 .
−1
−2
C0
−5
−3
A line conic C∗ is mapped to C∗0 = HC∗ H> since
−4
−5
−5
∗ > 0
l> C∗ l = (H> l0 )> C∗ (H> l0 ) = l0> HC
| {zH } l .
−4
−3
−2
−1
0
x , l, C
C∗0
1
2
3
4
5
−10
−15
0
−10
−5
0
−>
x = Hx, l = H
0
0
5
−>
l, C = H
CH−1
2D homographies – p. 21
Line conics and angles
Line conics and angles
The expression l> C∗∞ m = 0 is invariant under a homography
∗ >
x0 = Hx since l0 = H−> l and C∗0
∞ = HC∞ H means that
Line conics are needed to describe angles between lines in projective
geometry.
In Euclidean geometry, angles between lines are calculated from the inner
product between their normals, e.g. if l = (l1 , l2 , l3 )> and
m = (m1 , m2 , m3 )> with normals (l1 , l2 )> and (m1 , m2 )> , then the angle θ
between the lines is calculated from
cos θ = p
2D homographies – p. 22
l1 m1 + l2 m2
.
+ l22 )(m21 + m22 )
(l12
0
−> >
l0> C∗0
l) HC∗∞ H> H−> m = l> H−1 HC∗∞ H> H−> m = l> C∗∞ m.
∞ m = (H
∗
Thus, if we know the projection C∗0
∞ of C∞ in an image, we can
determine if two lines l0 and m0 in the image are orthogonal by
0
calculating l0> C∗0
∞m .
The corresponding well-defined expression in projective geometry is
l> C∗∞ m
cos θ = p
, where C∗∞
(l> C∗∞ l)(m> C∗∞ m)
2
1
6
=4 0
0
0
1
0
3
0
7
0 5.
0
Especially we have that l and m are orthogonal if l> C∗∞ m = 0.
2D homographies – p. 23
2D homographies – p. 24
A transformation hierarchy for P 2
Homographies may be divided into different subgroups with
different level of generality.
The four subgroups we will talk about are the following, in order of
increasing level of generality
Isometry.
Similarity.
Affinity.
Projectivity.
Class I: Isometry
An isometry is a transformation of the plane R2 that preserves the Euclidean
distance.
32
3
2 0 3 2
x
x
cos θ − sin θ tx
76
7
6 0 7 6
cos θ
ty 5 4 y 5 ,
4 y 5 = 4 sin θ
1
0
0
1
1
where = ±1. If = +1, the transformation is called orientation preserving
and is a Euclidean transformation composed by a rotation and a translation.
If = −1, the transformation contains a mirroring.
An isometry may be written as
0
x = HE x =
"
R
0>
t
1
#
x,
where R is an orthogonal 2 × 2 matrix and t is a 2-vector.
An isometry has 3 degrees of freedom; rotation (1) and translation (2).
Invariants: lengths, angles, areas, etc.
2D homographies – p. 25
2D homographies – p. 26
Class II: Similarity
Class III: Affinity
A similarity is an isometry plus isotropic scaling.
For orientation-preserving isometries, the similarity has the matrix
form


 

x
s cos θ −s sin θ tx
x0


 0  
 y  =  s sin θ s cos θ ty   y  ,
1
0
0
1
1
or
x0 = HS x =
"
sR
0>
t
1
#
An affine transformation (affinity) is a non-singular transformation
followed by a translation and is represented by
 
a11
x0
 0  
=
 y   a21
0
1

or
x0 = HA x =
x,
a12
a22
0
"
A
0>


x
tx


ty   y  ,
1
1
t
1
#
x,
where the scalar s represents the scaling.
where A is a non-singular 2 × 2 matrix.
A similarity has 4 degrees of freedom; rotation (1), translation (2)
and scaling (1).
An affinity has 6 degrees of freedom; the elements of A and t.
Invariants: parallelity, length ration for parallel lines, area ratios.
Invariants: angles, parallelity, length ratios, area ratios, “shape”.
A similarity is also called a metric transformation.
2D homographies – p. 27
2D homographies – p. 28
Interpretation of an affine transformation
If we factor the transformation
matrix A into
A = R(θ)R(−φ)DR(φ),
where R(θ) and R(φ) are rotation
matrices and D is a diagonal matrix
D=
"
λ1
0
0
λ2
#
Thus the two extra degrees of
freedom may be interpreted as
the scaling λ1 /λ2 and the
“anisotropy angle” φ.
This kind of factorization is
always possible from the singular
value decomposition (SVD)
A = UDV> = (UV> )(VDV> )
,
= R(θ)(R(−φ)DR(φ)).
Class IV: Projectivity
A projective transformation
(projectivity) is a general
linear mapping of
homogeneous coordinates
and is written
"
#
A t
0
x,
x = HP x =
v> v
The most important different
between a projectivity and an
affinity is the vector v and its
effect on the mapping of ideal
points.
Study the mapping of an
ideal point (x1 , x2 , 0)> :
"
where v = (v1 , v2 )> and v is a
scalar.
then the transformation A may be
interpreted as a sequence of rotations and (anisotropic) scaling.
A projectivity has 8 degrees
of freedom; 9 elements in HP
and arbitrary scale.
θ
φ
deformation
2D homographies – p. 29
The effect of different transformations
Similarity
t
v
"
# 
 
x1
x1

  A

x2
 x2  = 
.
0
v1 x1 + v2 x2

For an affinity, v = 0 and
all ideal points are mapped to
ideal points. For a projectivity
with v 6= 0, some ideal points
are mapped to finite points.
Invariants: Cross ratios of line
lengths.
rotation
A
v>
#
Affinity
2D homographies – p. 30
Decomposition of a projective transformation
A projective transformation may be decomposed into a sequence of
transformations on different levels in the hierarchy:
Projectivity
H = HS HA HP =
"
sR
0>
t
1
#"
K
0>
0
1
#"
I
v>
0
v
#
=
"
A
v>
vt
v
#
,
where A = sRK + tv> is a non-singular matrix and K is an upper triangular
matrix with |K| = 1.
The decomposition is valid if v 6= 0 and unique if s is chosen to be positive.
−1 −1
−1
−1
Since H−1 = H−1
and H−1
are projective, affine, and similar,
P HA HS
P , HA , HP
respectively, it is possible to decompose the transformation in the opposite
direction, i.e. there exists also a factorization such that
H = HP HA HS =
"
I
v>
0
v
#"
K
0>
0
1
#"
sR
0>
t
1
#
with different values for K, R, t and v.
2D homographies – p. 31
2D homographies – p. 32
Reconstruction of affine properties
An affine transformation maps the line at infinity onto itself since
l0∞ = H−>
A l∞ =
"
−>
A
−t> A−>
0
1
#
  
0
0
   
 0  =  0  = l∞ .
1
1

If we know the projection l0∞ of l∞ in a projective mapping of a
plane we may perform affine measurements. E.g. parallel lines in
the plane should intersect on l0∞ .
HP/
HP
l = HP( l )
π1
π2
Affine rectification
We may also transform the
image such that l0∞ is
transformed back to l∞ .
If l0∞ is the line l = (l1 , l2 , l3 )>
we may (assuming l3 6= 0)
construct the following
transformation


1 0 0


H = HA  0 1 0  ,
l1 l2 l3
If we apply H on the image,
the line at infinity will be
mapped to its canonical
positions since
H−> (l1 , l2 , l3 )> = (0, 0, 1)> = l∞ .
where HA is an arbitrary affine
transformation.
π3
HA
2D homographies – p. 33
The circular points and their dual
The equation for a circle has a = c and b = 0
3
3
2
1
1
7
7
6
6
I = 4 i 5 , J = 4 −i 5 .
0
0
2
ax21 + ax22 + dx1 x3 + ex2 x3 + f x23 = 0
and intersects l∞ where x3 = 0 or
Under an orientation-preserving similarity
=
=
The circular points
The circular points are intersection points between a circle and the
line at infinity.
There are two points on l∞ that are mapped onto each other under a
similarity. They are called circular or absolute points and are denoted
I0
2D homographies – p. 34
2
32
3
s cos θ −s sin θ tx
1
6
76
7
HS I = 4 s sin θ
s cos θ ty 5 4 i 5
0
0
1
0
3
3
3
2
2
2
(cos θ − i sin θ) · 1
1
s cos θ − si sin θ
7
7
7
6
6
−iθ 6
4 i 5 = I.
4 s sin θ + si cos θ 5 = s 4 (cos θ − i sin θ) · i 5 = se
0
0
0
2D homographies – p. 35
a(x21 + x22 ) = 0,
with solution I = (1, i, 0)> and J = (1, −i, 0)> .
Since I are J are on all circles, we only need 3 more points to
uniquely determine the equation of the circle, something already
known in Euclidean geometry.
2D homographies – p. 36
Calculation of the circle equation

Which circle intersects the points
x1 = (0, 0, 1)> , x2 = (1, 0, 1)>
and x3 = (1, 1, 1)?
If we add the circular points, the
5-point algorithm gives us the
matrix
2
6
6
6
X=6
6
4
0
1
0
1
1
0
0
0
i
−i
0
0
1
−1
−1
0
1
0
0
0
0
0
1
0
0
1
1
1
0
0
3
7
7
7
7
7
5

C=
1
0
− 12
corresponding to

0 − 21

1 − 12 
− 12
0
The dual conic to the circular points
The line conic C∗∞ = IJ> + JI> is dual to the circular points.
In Euclidean coordinates it is given by
C∗∞
2
2
3
2
3
1
1
1
6
6
7
6
7
[1
−
i
0]
+
[1
i
0]
=
2
i
−i
4
4
5
4 0
5
0
0
0
=
x2 + y 2 − x − y = 0
with null-space
3
"
0
I
7
0 5=
0>
0
0
0
#
.
The conic C∗∞ is invariant under a similarity transformation x0 = HS x since
or
0
1
0
x−
1
2
2
2
1
1
+ y−
− = 0.
2
2
C∗0
∞
=
HS C∗∞ H>
S
=
=
"
t
1
1.5
sR
0>
"
sR
0>
#"
t
1
sR>
0>
#"
0
0
#
I
0>
2
=s
0
0
"
#"
sR>
t>
RR>
0>
0
0
0
1
#
#
= C∗∞ .
1
c = [1, 0, 1, −1, −1, 0]>
The conic C∗∞ has 4 degrees of freedom (symmetric 3 × 3 matrix with
arbitrary scale and |C∗∞ | = 0).
0.5
and conic
0
−0.5
2D homographies – p. 38
2D homographies – p. 37
−1
−0.5
0
0.5
1
1.5
2
The information content of C∗∞
The effect of a homography on C∗∞
Study the line conic C∗∞ under a projective transformation:
C∗0
∞
>
= (HP HA HS ) C∗∞ (HP HA HS ) = (HP HA ) HS C∗∞ H>
S
"
#
KK>
KK> v
=
.
v> KK> v> KK> v
>
H>
A HP
Assume we have two lines l = (1, 0, −1.3)> , m = (0, 1, −4.3)> and the
transformation
The (projection of the) conic C∗∞ contains all information needed to
perform a metric rectification, i.e. to determine the affine and
projective properties of the transformation.
s
=
0.75, R =
v
=
"
H
=
0.1
0
#
"
cos 15◦
sin 15◦
− sin 15◦
cos 15◦
#
, K=
"
1.25
0
0.1
0.8
#
,
, v = 0.5, or
2
1.434
HP HA HS = 4 0.241
0.143
−0.264
0.899
−0.026
3
2.248
2.481 5 .
1
Then
0
−>
l =H
and
3
3
2
−0.257
−0.079
7
7
6
6
0
−>
l = 4 −0.046 5 , m = H
m = 4 −0.126 5 ,
1
1
C∗0
∞
2D homographies – p. 39
2
=
HC∗∞ H>
2
100
= 4 5.087
10
5.087
40.700
0.509
3
10
0.509 5
1
2D homographies – p. 40
Determination of orthogonality with C∗∞
If we know the image (projection) of C∗∞
C∗0
∞
Metric rectification with C∗0
∞
Given C∗0
∞ we can calculate the affine and projective properties K
and v:
"
#
"
# "
#
100
5.0874
9.9682
0.7975
1.25
0.1
KK> =
⇒K=
=
5.0874 40.6995
0
6.3796
0
0.8


100
5.087
10


=  5.087 40.700 0.509 
10
0.509
1
and
we are able to determine if the lines




−0.257
−0.079




l0 =  −0.046  , m0 =  −0.126 
1
1
>
KK v =
"
10
0.5087
#
⇒v=
"
100
5.0874
5.0874 40.6995
#−1 "
10
0.5087
#
=
"
0.1
0
#
.
in the image are orthogonal in the world plane.


l0> C∗0
∞m =
−0.257
−0.046
1
> 
100
5.0874
10
 
5.0874
40.6995
0.5087
10
0.5087
1


−0.079
−0.126
1

 = 0,
2D homographies – p. 42
2D homographies – p. 41
Metric rectification with C∗∞
Metric rectification by orthogonal lines
Given K and v we may eliminate the affine and projective
component of the transformation by applying HM = (HP HA )−1 on the
points and H−>
on the lines.
M
If an images has been affinely rectified we
need 2 equations to determine the 2 degrees
of freedom in K. We may get these equation
from pairs of imaged orthogonal lines.
0
0
0.18
Assume l and m in the affinely rectified
image correspond to two orthogonal lines l
and m in the world plane.
12
0.16
Since v = 0 we have
10
0.14
14
2
3
"
l10
KK>
6 0 7
4 l2 5
0>
l30
0.12
8
0.1
6
0.08
4
which is a linear equation in
S = KK
>
=
"
s11
s12
s12
s22
#
,
ˆ0 0 0 0
˜
l1 m1 , l1 m2 + l20 m01 , l20 m02 s = 0,
where s = (s11 , s12 , s22 )> .
0
0
#
2
3
m01
6
0 7
4 m2 5 = 0
m03
Given the image of two pairs of orthogonal
lines we may determine s and therefore K
and HA up to an unknown scale.
The application of H−1
on the image will do a
A
metric rectification.
0.06
2
0.04
−6
−4
−2
0
2
4
x
0
6
8
10
12
−0.02
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
HM x0
2D homographies – p. 43
2D homographies – p. 44