Recovery of metric and affine properties, 3D projective geometry

advertisement
Recovering metric and affine
properties from images
• Affine preserves:
• Parallelism
• Parallel length ratios
• Similarity preserves:
• Angles
• Length ratios
Will show:
• Projective distortion can be removed once image of line at
infinity is specified
•Affine distortion removed once image of circular points is specified
•Then the remaining distortion is only similarity
The line at infinity
For an affine transformation line at infinity maps onto line at infinity
 0
A
0  
T
l  H A l  
 0   l 
 A t 1 1 
 
T
The line at infinity l is a fixed line under a projective
transformation H if and only if H is an affinity
A point on line at infinity is mapped to ANOTHER point on the line at infinity, not
necessarily the same point
Note: not fixed pointwise
Affine properties from images
projection
rectification
Euclidean plane
Two step process:
1.Find l the image of line
at infinity in plane 2
2. Transform l to its
canonical position
(0,0,1) T by plugging into
HPA and applying it to
the entire image to get a
“rectified” image
3. Make affine measurements
on the rectified image
1 0 0 
H PA   0 1 0  H A
l1 l2 l3 
l  l1 l2
l3  , l3  0
T
Affine rectification
l∞
v1
l1
l3
l2
v2
v 2  l3  l 4
l4
v1  l1  l2
l  v1  v2
c
a
b
The circular points
Two points on l_inf: Every circle intersects l_inf at circular points
“circular points”
Circle:
x12 + x22 + dx1 x3 + ex2 x3 + fx32 = 0
Line at infinity
x3  0
l∞
x12 + x22 = 0
I  1, i,0 
T
J  1,-i,0 
T
The circular points
Circular points are fixed under any similarity transformation
1
 
Ii
 0
 
 s cos 
I  H S I   s sin 
 0
1
 
J  i
0
 
s sin 
s cos 
0
Canonical coordinates
of circular points
t x  1 
1
 
 

i
t y  i   se  i   I
 0
1  0 
 
The circular points I, J are fixed points under the projective
transformation H iff H is a similarity
Identifying circular points allows recovery of similarity properties i.e. angles
ratios of lengths
Conic dual to the circular points
C*  IJ T  JI T
C  HSC H
*

*

1 0 0


*
C   0 1 0 
0 0 0
T
S
The dual conic C*is fixed conic under the
projective transformation H iff H is a similarity
Note:C*
has 4DOF (3x3 homogeneous; symmetric, determinant is zero)

l∞ is the nullvector
Angles
l  l1 , l2 , l3 
m  m1 , m2 , m3 
T
Euclidean Geometry: cos  
l
2
1
Projective: cos  
T
l1m1  l2 m2

 l22 m12  m22
l
 projective transformation
not invariant under
lT C* m
T

C* l m T C* m

The above equation is invariant under projective transformation  can be applied
after projective transformation of the plane.
lT C* m  0 (orthogonal)
*
C
Once
 is identified in the projective plane, then Euclidean angles
may be measured by equation (1)
d (b, c) sin 

d (a, c) sin 
Length ratios
Metric properties from images
C* '  H P H A H S C* H P H A H S 
T
 H P H A H S C* H TS H P H A 
T
T
*




 H P H A C H P H A
KK T
 T
v K
K T v

vT v 
•Upshot: projective (v) and affine (K) components directly determined from the image
of C*∞
•Once C*∞ is identified on the projective plane then projective distortion may be
rectified up to a similarity
*
•Can show that the rectifying transformation is obtained by applying SVD to C  '
1 0 0
C* '  U 0 1 0 U T
0 0 0
HU
•Apply U to the pixels in the projective plane to rectify the image up to a Similarity
Recovering up to a similarity from Projective
SVD Decompose C* '
Perspective
transformation
to get U
Rectifying
Transformation: U
C*∞
C* '
Euclidean
Projectively
Distorted
Image
Similarity transformation
Rectified image
Recovering up to a similarity from
Affine
affine
transformation
C*∞
Euclidean
Rectifying
Transformation: U
C* '
Affinely
Distorted
Image
Similarity transformation
Rectified image
Metric from affine
l1
l2
KK
l3 
 0
T
 m1 
0  
 m2   0
0  
 m3 
l1m1, l1m2  l2 m1, l2 m2 k
2
11
Affine
 k , k11k12 , k
2
12
rectified

2 T
22
0
Metric from projective
l1
l2
KK
l3  T
v K
T
 m1 
K v  
m  0
T  2 
v v  
 m3 
T
l1m1,0.5l1m2  l2 m1 , l2 m2 ,0.5l1m3  l3m1 ,0.5l2 m3  l3m2 , l3m3 c  0
Projective 3D geometry
Singular Value Decomposition
A mn  U mm Σ mn VnTn
 1 0  0 
0   0 
2



  
Σ

0
0


n






0
0

0


mn
1   2     n  0
UT U  I
VT V  I
A  U1  1 V1T  U 2  2 V2T    U n  n VnT
UΣ
Σ VT X
Singular Value Decomposition
• Homogeneous least-squares
min AX subject to X  1
• Span and null-space
S L  U1 U 2 ; N L  U3 U 4 
S R  V1V2 ; N R  V3V4 
A  UΣ V
T
solution X  Vn
 1 0
0 
2
Σ
0 0

0 0
0 0
0 0
0 0

0 0
• Closest rank r approximation
~
~ T
A  UΣ
UΣ V
~
  diag  1 ,  2 ,,  r , 0r 1,,
,, 0n
• Pseudo inverse
A   VΣ  U T   diag  11 ,  21 ,,  r1 , 0 ,, 0 
Projective 3D Geometry
• Points, lines, planes and quadrics
• Transformations
• П∞, ω∞ and Ω
∞
3D points
3D point
 X , Y , Z T in R3
T
X   X1 , X 2 , X 3 , X 4 
in P3
T
 X1 X 2 X 3 
T
X  
,
,
,1   X , Y , Z , 1
 X4 X4 X4 
projective transformation
X'  H X (4x4-1=15 dof)
X 4  0
Planes
3D plane
Transformation
X'  H X
π'  H -T π
π1 X  π 2Y  π3 Z  π 4  0
π1 X 1  π 2 X 2  π3 X 3  π 4 X 4  0
πTX  0
Euclidean representation
~
n . X d  0
n  π1 , π 2 , π3 
π4  d
T
~
T
X  X ,Y , Z 
X4 1
d/ n
Dual: points ↔ planes, lines ↔ lines
Planes from points
Solve π from X1T π  0, X T2 π  0 and X 3T π  0
X1T 
 T
X 2  π  0
X 3T 
 
(solve
π as right nullspace of
 X1T 
 T
X 2 
 X 3T 
 
Or implicitly from coplanarity condition
 X 1  X 1 1  X 2 1
 X X  X 
2
1
2
det X X1X 2 X32  0 2
 X 3  X 1 3  X 2 3

 X 4  X 1 4  X 2 4
 X 3 1 
 X 3 2 
0
 X 3 3 
 X 3 4 
X 1D234  X 2 D134  X 3 D124  X 4 D123  0
T
π  D234 ,D134 , D124 ,D123 
)
Points from planes
Solve X from π1T X  0, π T2 X  0 and π 3T X  0
 π1T 
 T
π 2  X  0
 π 3T 
 
(solve
 π1T 
X as right nullspace of  π T2 
 π 3T 
 
Representing a plane by its span
X Mx
M  X1X 2 X3 
πT M  0
T
•M is 4x3 matrix. Columns of M are null space of π
•X is a point on plane
•x ( a point on projective plane P2 ) parameterizes
points on the plane π
•M is not unique
)
Lines
•Line is either joint of two points or intersection of two planes
Representing a line by its span: two
vectors A, B for two space points
(4dof)
T
A 
W  T
2x4  B 
Dual representation: P and Q are planes; line
is span of row space of W*
•Span of WT is the pencil
of points λA μB
on the line
•Span of the 2D right
null space of W is the
pencil of the planes
with the line as axis
•Span of W*T is the pencil of
Planes λP μQ with the
line as axis
P 
W   T
2x4
Q 
T
W*WT = WW* = 02×2
T
*
Example: X-axis:
0 0 0 1 
W

1
0
0
0


join of (0,0,0) and (1,0,0) points
0 0 1 0
W 

0
1
0
0


*
Intersection of y=0 and z=0
planes
Points, lines and planes
Plane π defined by the join of the point X and line W is
obtained from the null space of M:
W
M   T
X 
W
Mπ  0
X
• Point X defined by the intersection of line W with
plane
is the null space of M
π
W* 
M T
π 
W*
MX  0
π
Quadrics and dual quadrics
Quadratic surface in P3 defined by:
(Q : 4x4 symmetric matrix)
X T QX  0
1.
2.
3.
4.
5.


Q



9 d.o.f.
in general 9 points define quadric
det Q=0 ↔ degenerate quadric
(plane ∩ quadric)=conic
C  M T QM
transformation Q' H -T QH-1
  
  
  

  
π : X  Mx
•Dual Quadric: defines equation on planes: tangent planes π to
the point quadric Q satisfy:
π T Q* π  0
1.
2.
Q  Q (non-degenerate)
relation to quadric
*
* T
transformation Q'  HQ H
*
-1
Quadric classification
Rank
Sign.
Diagonal
Equation
4
4
(1,1,1,1)
X2+ Y2+ Z2+1=0
2
(1,1,1,-1)
X2+ Y2+ Z2=1
Sphere
0
(1,1,-1,-1)
X2+ Y2= Z2+1
Hyperboloid (1S)
3
(1,1,1,0)
X2+ Y2+ Z2=0
Single point
1
(1,1,-1,0)
X 2 + Y 2 = Z2
Cone
2
(1,1,0,0)
X2 + Y2 = 0
Single line
0
(1,-1,0,0)
X 2 = Y2
Two planes
1
(1,0,0,0)
X2=0
Single plane
3
2
1
Realization
No real points
Quadric classification
Projectively equivalent to sphere:
sphere
ellipsoid
hyperboloid of paraboloid
two sheets
Ruled quadrics:
hyperboloids
of one sheet
Degenerate ruled quadrics:
cone
two planes
Hierarchy of transformations
group
transform
t
v 
distortion
invariants properties
Projective
15dof
A
vT

Affine
12dof
 A t
0 T 1


Similarity
7dof
s R t 
 0T 1


The absolute conic Ω∞
Euclidean
6dof
 R t
0 T 1


Volume
Intersection and tangency
Parallellism of planes,
Volume ratios, centroids,
The plane at infinity π∞
The plane at infinity
0
 
T
A
0  0 
T

π  H A π  
   π 
 A t 1 0 
1
 
The plane at infinity π is a fixed plane under a
projective transformation H iff H is an affinity
1.
2.
3.
4.
canonical position π   0,0,0,1
T
contains directions
D   X1 , X 2 , X 3 ,0
two planes are parallel  line of intersection in π∞
line // line (or plane)  point of intersection in π∞
T
The absolute conic
The absolute conic Ω∞ is a (point) conic on π.
In a metric frame:
2
2
2
X1  X 2  X 3 
0
X4

The absolute conic Ω∞ is a fixed conic under the projective
transformation H iff H is a similarity
1.
2.
3.
Ω∞ is only fixed as a set, not pointwise
Circle intersect Ω∞ in two points
All Spheres intersect π∞ in Ω∞
The absolute conic

d d 
Euclidean:
cos  
d d d d 
d  d 
cos  
Projective:
d  d d  d 
T
1
2
T
1 1
T
1
T
1
d1T  d 2  0
d1 and d2 are lines
 1
T
2
2

2
T
2

2
(orthogonality=conjugacy)
The absolute dual quadric
Absolute dual Quadric = All planes tangent to Ω∞
I
Q  T
0
*

0
0
The absolute conic Q*∞ is a fixed conic under the
projective transformation H iff H is a similarity
1.
2.
3.
8 dof
plane at infinity π∞ is the nullvector of
Angles:
π T Q* π
cos  

1
Q*
2
π Q π π Q π 
T
1
*

1
T
2
*

2
Download