Projective Line - University of Minnesotahspark/CSci5980/Lec3... · 3D Parallel Line Projection...
Transcript of Projective Line - University of Minnesotahspark/CSci5980/Lec3... · 3D Parallel Line Projection...
Projective Line
Parallel lines in 3D converge to a point in the image.
MLPS-St. Paul International Airport
Indoor point at infinity
3D Parallel Line Projection
Ground plane
Camera plane
3D Parallel Line Projection
Ground plane
Camera plane
3D Parallel Line Projection
Ground plane
Camera plane
3D Parallel Line Projection
Ground plane
Camera plane
3D Parallel Line Projection
Ground plane
Camera plane
3D Parallel Line Projection
Ground plane
Camera plane
3D Parallel Line Projection
Vanishing point
Ground plane
Camera plane
3D Parallel Line Projection
Vanishing point
Ground plane
Camera plane
3D Parallel Line Projection
Vanishing point
Ground plane
1. Parallel lines in 3D meet at the same vanishing point in image.
Camera plane
3D Parallel Line Projection
Vanishing point
Ground plane
1. Parallel lines in 3D meet at the same vanishing point in image. 2. The 3D ray passing camera center and the vanishing point is parallel to the lines.
Camera plane
Vanishing Point
Vanishing point
1. Parallel lines in 3D meet at the same vanishing point in image. 2. The 3D ray passing camera center and the vanishing point is parallel to the lines. 3. Multiple vanishing points exist.
Ground plane
Camera plane
Vanishing point
Vanishing point
Vanishing point
Multiple vanishing point
Vanishing point
Vanishing point
Vanishing line: Horizon
Vanishing line for horizon
Vanishing point
Vanishing point
What can vanishing line tell us about me?
Vanishing line for horizon
Keller Hall
Vanishing point
Vanishing point
What can vanishing line tell us about me? • Horizon
Vanishing line for horizon
Keller Hall
Vanishing point
Vanishing point
What can vanishing line tell us about me? • Horizon • Camera pitch angle (looking down)
Vanishing line for horizon
Keller Hall
Vanishing point
Vanishing point
What can vanishing line tell us about me? • Horizon • Camera pitch angle (looking down) • Camera roll angle (tilted toward right)
Vanishing line for horizon
Celestial Navigation Far far away: point at infinity
Horizon
Earth
At least two stars are needed.
Two points at infinity (vanishing points) tells us about where I am.
Parallel 3D planes share the vanishing line.
Different plane produces different vanishing line.
Different plane produces different vanishing line.
Different plane produces different vanishing line.
How to compute a vanishing point?
Point-Line in Image
A 2D line passing through 2D point (u,v ):
au bv c 0 au bv c 0
( , )u v
Line parameter: (a,b,c )
Point-Line in Image
A 2D line passing through 2D point (u,v ):
au bv c 0 au bv c 0
( , )u v
Line parameter: (a,b,c )
u
a b c v l xT 0
1
au bv c 0
Point-Line in Image
A 2D line passing through 2D point (u,v ):
au bv c 0 au bv c 0
( , )u v
Line parameter: (a,b,c )
u
a b c v l xT 0
1
where
u
vx
1
a
b
c
land
au bv c 0
Line parameter 2D point
=
a
b
c
l2D line:
1
u
vx
Point-Point in Image A 2D line passing through two 2D points:
1 1 0 au bv c
1 1( , )u v
1xx2
2 2( , )u v
2 2 0 au bv c
Point-Point in Image
1 1 0 au bv c
1 1( , )u v
1xx2
2 2( , )u v
2 2 0 au bv c
x lT1 0 x lT
2 0
1
1 1
1
x
u
v2
2 2
1
x
u
v
a
b
c
lwhere
A 2D line passing through two 2D points:
Point-Point in Image
1 1 0 au bv c
1 1( , )u v
1xx2
2 2( , )u v
2 2 0 au bv c
x lT1 0 x lT
2 0
1
1 1
1
x
u
v2
2 2
1
x
u
v
a
b
c
lwhere
A 2D line passing through two 2D points:
xl 0
x
T1
T2
2x3
0 0 A
Point-Point in Image
1 1 0 au bv c
1 1( , )u v
1xx2
2 2( , )u v
2 2 0 au bv c
x lT1 0 x lT
2 0
1
1 1
1
x
u
v2
2 2
1
x
u
v
a
b
c
lwhere
A 2D line passing through two 2D points:
xl 0
x
T1
T2
0 0 A
null A l x x1 2=or
2x3
Point-Point in Image
(1804,934) (1052,1323)
x1 = [1804;934;1]; x2 = [1052;1323;1];
l
1 1( , )u v
1xx2
2 2( , )u v
Point-Point in Image
(1804,934) (1052,1323)
x1 = [1804;934;1]; x2 = [1052;1323;1]; l = Vec2Skew(x1)*x2;
Cross product
l
1 1( , )u v
1xx2
2 2( , )u v
GetLineFromTwoPoints.m
Point-Point in Image
(1804,934) (1052,1323)
x1 = [1804;934;1]; x2 = [1052;1323;1]; l = Vec2Skew(x1)*x2; l = -389 -752 1404124
Cross product
l
1 1( , )u v
1xx2
2 2( , )u v
GetLineFromTwoPoints.m
Point-Point in Image
(1804,934) (1052,1323)
x1 = [1804;934;1]; x2 = [1052;1323;1]; l = Vec2Skew(x1)*x2; l = -389 -752 1404124
Cross product
a b a b
a b a b
a b a b
a a b
a -a b
-a a b
a b
a b
2 3 3 2
3 1 1 3
1 2 2 1
3 2 1
3 1 2
2 1 3
-
= -
-
0 -
0
0
Cross product with skew-symmetric matrix representation:
function skew = Vec2Skew(v) skew = [0 -v(3) v(2); v(3) 0 -v(1); -v(2) v(1) 0];
l
1 1( , )u v
1xx2
2 2( , )u v
Vec2Skew.m
GetLineFromTwoPoints.m
Two 2D lines in an image intersect at a 2D point:
Line-Line in Image
1
1 1
1
l
a
b
c
( , )u vx
2
2 2
2
l
a
b
c
1 1 1 0 a u b v c2 2 2 0 a u b v c
(1804,934)
Two 2D lines in an image intersect at a 2D point:
Line-Line in Image
l xT1 0 l xT
2 0
1
1 1
1
l
a
b
c
( , )u vx
2
2 2
2
l
a
b
c
1 1 1 0 a u b v c2 2 2 0 a u b v c
1
x
u
v1
1 1
1
l
a
b
c
where
2
2 2
2
l
a
b
c(1804,934)
Two 2D lines in an image intersect at a 2D point:
Line-Line in Image
l xT1 0 l xT
2 0
lx 0
l
T1
T2
1 2= x l l
1
1 1
1
l
a
b
c
( , )u vx
2
2 2
2
l
a
b
c
1 1 1 0 a u b v c2 2 2 0 a u b v c
1
x
u
v1
1 1
1
l
a
b
c
where
2
2 2
2
l
a
b
c
2x3
0 0 A
null A
or
(1804,934)
Line-Line in Image
1
1 1
1
l
a
b
c
( , )u vx
2
2 2
2
l
a
b
c
l1 = [-398;-752;1404124]; l2 = [310;-924;303790]; x = Vec2Skew(l1)*l2; x = x/x(3) x = 1779.0 925.6 1
similar to (1804,934)
(1804,934)
GetPointFromTwoLines.m
2D Point and Line Duality
l x x1 2
The intersection between two lines:
x l l1 2
Given any formula, we can switch the meaning of point and line to get another formula.
The 2D line joining two points:
2D Point and Line Duality
l x x1 2
The intersection between two lines:
x l l1 2
Given any formula, we can switch the meaning of point and line to get another formula.
1x
2x
The 2D line joining two points:
T: Transformation -T2 1 2 1 x Tx l T l
2D Point and Line Duality
l x x1 2
The intersection between two lines:
x l l1 2
Given any formula, we can switch the meaning of point and line to get another formula.
1x
2x
The 2D line joining two points:
T
T T -1 -T T1 1 1 1 1 1 2 2 l x l T Tx T l Tx l x
T: Transformation -T2 1 2 1 x Tx l T l
0
2D Point and Line Duality
l x x1 2
The intersection between two lines:
x l l1 2
Given any formula, we can switch the meaning of point and line to get another formula.
1x
2x
The 2D line joining two points:
T
T T -1 -T T1 1 1 1 1 1 2 2 l x l T Tx T l Tx l x
T: Transformation -T2 1 2 1 x Tx l T l
0
2D Point and Line Duality
l x x1 2
The intersection between two lines:
x l l1 2
Given any formula, we can switch the meaning of point and line to get another formula.
1x
2x
The 2D line joining two points:
T
T T -1 -T T1 1 1 1 1 1 2 2 l x l T Tx T l Tx l x
T: Transformation -T2 1 2 1 x Tx l T l
2D Point and Line Duality
l x x1 2
The intersection between two lines:
x l l1 2
Given any formula, we can switch the meaning of point and line to get another formula.
2 1
cos sin 0
-sin cos 0
0 0 1
x x
1x
2x
The 2D line joining two points:
T
T T -1 -T T1 1 1 1 1 1 2 2 l x l T Tx T l Tx l x
T: Transformation
T
2 1 1
cos sin 0 cos sin 0
-sin cos 0 -sin cos 0
0 0 1 0 0 1
l l l
-T2 1 2 1 x Tx l T l
?
2D Point and Line Duality
l x x1 2
The intersection between two lines:
x l l1 2
Given any formula, we can switch the meaning of point and line to get another formula.
2 1
cos sin 0
-sin cos 0
0 0 1
x x
1x
2x
The 2D line joining two points:
T
T T -1 -T T1 1 1 1 1 1 2 2 l x l T Tx T l Tx l x
T: Transformation
T
2 1 1
cos sin 0 cos sin 0
-sin cos 0 -sin cos 0
0 0 1 0 0 1
l l l
-T2 1 2 1 x Tx l T l
Geometric Interpretation (Point)
CO u
u
Geometric Interpretation (Point)
CO u
u
-1K u
Geometric Interpretation (Point)
CO
u
-1 u K uu
Normalized coordinate:
-1u K u
Geometric Interpretation (Point)
CO
1u
-11 1 u K u
1u
2u
-12 2 u K u
2u
-12 2u K u
Normalized coordinate:
-11 1u K u
Geometric Interpretation (Line)
CO
l
l
Normalized coordinate:
-T
-1 T l K l K l due to duality
1l = u 2u
where ?
1u
2u
-12 2 u K u
-11 1 u K u
1u
2u
-11 1u K u -1
2 2u K u
Geometric Interpretation (Line)
CO
l
l
Normalized coordinate:
due to duality
1l = u 2u1u
2u
-12 2 u K u
-11 1 u K u
1u
2u
-11 1u K u -1
2 2u K u
-T
-1 T l K l K l due to duality where
CO
l
l
Geometric Interpretation (Line) 3D plane π Normalized coordinate:
due to duality where
A 2D line in an image defines to a 3D plane passing the camera center:
l π
1u-1
1 1 u K u
2u
-12 2 u K u
1u
2u
-11 1u K u -1
2 2u K u
1l = u 2u
-T
-1 T l K l K l
CO
l
l
Geometric Interpretation (Line) 3D plane π Normalized coordinate:
due to duality where
A 2D line in an image defines to a 3D plane passing the camera center:
l π
Plane normal: 1 1 x 2 2 x l
l
?
1u-1
1 1 u K u
2u
-12 2 u K u
1u
2u
-11 1u K u -1
2 2u K u
1l = u 2u
-T
-1 T l K l K l
CO
l
l
Geometric Interpretation (Line) 3D plane π Normalized coordinate:
due to duality where
A 2D line in an image defines to a 3D plane passing the camera center:
l π
Plane normal: 1 1 u 2 2 u l
l
1u-1
1 1 u K u
2u
-12 2 u K u
1u
2u
-11 1u K u -1
2 2u K u
1l = u 2u
-T
-1 T l K l K l
CO
l
l
Geometric Interpretation (Line) 3D plane π Normalized coordinate:
due to duality where
A 2D line in an image defines to a 3D plane passing the camera center:
l π
Plane normal: 1 1 u 2 2 u l
l
1u-1
1 1 u K u
2u
-12 2 u K u
1u
2u
-11 1u K u -1
2 2u K u
1l = u 2u
-T
-1 T l K l K l
0
l
0
lπ
CO
l
Geometric Interpretation (Line-Line) 1π
CO
Geometric Interpretation (Line-Line)
l1l2
1π
2π
CO
Geometric Interpretation (Line-Line)
l1l2
1π
2π
x
u
2D lines in an image intersect a 2D point corresponding to a 3D ray:
u1= l 2l
CO
Geometric Interpretation (Line-Line)
l1l2
1π
2π
u
2D lines in an image intersect a 2D point corresponding to a 3D ray:
1= l 2l1l
2lu
: the 3D ray is perpendicular to two plane normals.
uu
Vanishing Point
11l
1l 2
Ground plane
1u
2u3u
4u
Parallel lines:
11 4 3 l u u 12 1 2 l u u
Vanishing Point
11l
Ground plane
4u
Parallel lines:
11 4 3 l u u 12 1 2 l u u
21 4 1 l u u 22 3 4 l u u
2l 1
l221l 2
1u
2u3u
Vanishing Point
11l
x1
Ground plane
4u
Parallel lines:
11 4 3 l u u 12 1 2 l u u
21 4 1 l u u 22 3 4 l u u
2l 1
l221l 2
1u
2u3u
x l l1 11 12
Vanishing points:
x l l2 21 22
x2
Vanishing Point
11l
1v
Ground plane
4u
Parallel lines:
11 4 3 l u u 12 1 2 l u u
21 4 1 l u u 22 3 4 l u u
2l 1
l221l 2
1u
2u3u
1 11 12 v l l
Vanishing points:
2 21 22 v l l
2v Vanishing line:
1 2 l v vl
Vanishing Point
11l
Ground plane
2l 1
l221l 2
l
l11 = GetLineFromTwoPoints(m11,m12); l12 = GetLineFromTwoPoints(m13,m14); l21 = GetLineFromTwoPoints(m21,m22); l22 = GetLineFromTwoPoints(m23,m24); v1 = GetPointFromTwoLines(l11,l12); v2 = GetPointFromTwoLines(l21,l22); vanishing_line = GetLineFromTwoPoints(x1, x2);
m11
m12
m13
m14
ComputeVanishingLine.m
2v
1v
Geometric Interpretation of Vanishing Line
Ground plane
Camera plane
Geometric Interpretation of Vanishing Line
Ground plane
Camera plane
Geometric Interpretation of Vanishing Line
Ground plane
Camera plane
Geometric Interpretation of Vanishing Line
Ground plane
Camera plane
Side view
Ground plane
Plane of vanishing line
Plane of vanishing line
Geometric Interpretation of Vanishing Line
Side view
Ground plane
Plane of vanishing line
Height
Where was I (how high)?
Where was I (how high)?
Taken from my hotel room (6th floor) Taken from beach
Where was I (how high)?
Taken from my hotel room (6th floor) Taken from beach
First person video Cylindrical projection
Height of the camera wearer