Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
Where am I?Using Vanishing Points
Where was I (how high)?
Taken from my hotel room (6th floor) Taken from beach
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
Ground plane
Where am I w.r.t. Ground Plane?
3D world
Camera
Xu
Yv
ZK r r r tC
1 2 3 W
11
How to compute?
3D world
r1
r2
r3
What can a Vanishing Point tell us about?Camera
3D world
r1
r2
r3
v
Ground plane
Ground plane
What can a Vanishing Point tell us about?Camera
3D world
r1
r2
r3
v
Z
0
0
1
0
Ground plane
What can a Vanishing Point tell us about?Camera
3D world
r1
r2
r3
v
0 0
0 0
1
1 0
Z
C
1 2 3 W
0
0
1
0
v K r r r t
Ground plane
Single Vanishing PointCamera
3D world
r1
r2
r3
v
0 0
0 0
1
1 0
Z
C
1 2 3 W
0
0
1
0
v K r r r t
-1
3
K v r
3
v Kr
Ground plane
Single Vanishing PointCamera
3D world
r1
r2
r3
v
0 0
0 0
1
1 0
Z
C
1 2 3 W
0
0
1
0
v K r r r t
-1
3
K v r
3
v Kr
K v
rK v
-1
3 -1because r3 is a unit vector.
Z vanishing point tells us about the
surface normal of the ground plane
Ground plane
Single Vanishing PointCamera
3D world
r1
r2
r3
v
0 0
0 0
1
1 0
Z
C
1 2 3 W
0
0
1
0
v K r r r t
-1
3
K v r
3
v Kr
K v
rK v
-1
3 -1because r3 is a unit vector.
Z vanishing point tells us about the
surface normal of the ground plane
Ground plane
Rotation ambiguity
Ground plane
Single Vanishing PointCamera
3D world
r1
r2
r3
v
0 0
0 0
1
1 0
Z
-1
3
K v r
K v
rK v
-1
3 -1
Roll and pitch angle can be computed by the ground plane.
Ground plane
Single Vanishing PointCamera
3D world
r1
r2
r3
v
0 0
0 0
1
1 0
Z
-1
3
K v r
K v
rK v
-1
3 -1
Roll and pitch angle can be computed by the ground plane.
Yaw: rotation about z axis:yaw
cos -sin 0
sin cos 0
0 0 1
R
Ground plane
Single Vanishing PointCamera
3D world
r1
r2
r3
v
0 0
0 0
1
1 0
Z
-1
3
K v r
K v
rK v
-1
3 -1
Roll and pitch angle can be computed by the ground plane.
Yaw: rotation about z axis:yaw
cos -sin 0
sin cos 0
0 0 1
R
Pitch: rotation about y axis:pitch
cos 0 sin
0 1 0
-sin 0 cos
R
Ground plane
Single Vanishing PointCamera
3D world
r1
r2
r3
v
0 0
0 0
1
1 0
Z
-1
3
K v r
K v
rK v
-1
3 -1
Roll and pitch angle can be computed by the ground plane.
Yaw: rotation about z axis:yaw
cos -sin 0
sin cos 0
0 0 1
R
Pitch: rotation about y axis:pitch
cos 0 sin
0 1 0
-sin 0 cos
R
Roll: rotation about x axis:roll
1 0 0
0 cos -sin
0 sin cos
R
Ground plane
Single Vanishing PointCamera
3D world
r1
r2
r3
v
0 0
0 0
1
1 0
Z
-1
3
K v r
K v
rK v
-1
3 -1
Roll and pitch angle can be computed by the ground plane.
Yaw: rotation about z axis:yaw
cos -sin 0
sin cos 0
0 0 1
R
Pitch: rotation about y axis:pitch
cos 0 sin
0 1 0
-sin 0 cos
R
Roll: rotation about x axis:roll
1 0 0
0 cos -sin
0 sin cos
R
T
1 2 3 yaw pitch roll
-sin
cos sin
cos cos
r r r R R R ?
Ground plane
Single Vanishing PointCamera
3D world
r1
r2
r3
v
0 0
0 0
1
1 0
Z
-1
3
K v r
K v
rK v
-1
3 -1
Roll and pitch angle can be computed by the ground plane.
Yaw: rotation about z axis:yaw
cos -sin 0
sin cos 0
0 0 1
R
Pitch: rotation about y axis:pitch
cos 0 sin
0 1 0
-sin 0 cos
R
Roll: rotation about x axis:roll
1 0 0
0 cos -sin
0 sin cos
R
T
1 2 3 yaw pitch roll
-sin
cos sin
cos cos
r r r R R R
Ground plane
Single Vanishing PointCamera
3D world
r1
r2
r3
v
0 0
0 0
1
1 0
Z
-1
3
K v r
K v
rK v
-1
3 -1
Roll and pitch angle can be computed by the ground plane.
-1 31
2 2
32 33
-1 32
33
tan
tan
r
r r
r
r
T
1 2 3 yaw pitch roll
-sin
cos sin
cos cos
r r r R R R
Pitch:
Roll:
Ground plane
Single Vanishing PointCamera
3D world
r1
r2
r3
v
0 0
0 0
1
1 0
Z
-1
3
K v r
K v
rK v
-1
3 -1
Roll and pitch angle can be computed by the ground plane.
-1 31
2 2
32 33
-1 32
33
tan
tan
r
r r
r
r
T
1 2 3 yaw pitch roll
-sin
cos sin
cos cos
r r r R R R
Pitch:
Roll:
Single Vanishing Point (Exercise)
f = 1224;
K = [f 0 size(im,2)/2;
0 f size(im,1)/2;
0 0 1];
m1 = [2563;25;1];
m2 = [2439;545;1];
m3 = [571;25;1];
m4 = [723;498;1];
l1 = GetLineFromTwoPoints(m1,m2);
l2 = GetLineFromTwoPoints(m3,m4);
v1 = GetPointFromTwoLines(l1,l2);
v1 = v1/v1(3);
r3 = inv(K)*v1/norm(inv(K)*v1)
pitch = atan(-r3(1)/norm(r3(2:3)))
roll = atan(r3(2)/r3(3))
ComputeCameraUsingVanishingPoint.m
r3 =
-0.07360.89590.4381
pitch =
0.0736
roll =
1.1160
v
Single Vanishing Point (Exercise)
f = 1224;
K = [f 0 size(im,2)/2;
0 f size(im,1)/2;
0 0 1];
m1 = [2563;25;1];
m2 = [2439;545;1];
m3 = [571;25;1];
m4 = [723;498;1];
l1 = GetLineFromTwoPoints(m1,m2);
l2 = GetLineFromTwoPoints(m3,m4);
v1 = GetPointFromTwoLines(l1,l2);
v1 = v1/v1(3);
r3 = inv(K)*v1/norm(inv(K)*v1)
pitch = atan(-r3(1)/norm(r3(2:3)))
roll = atan(r3(2)/r3(3))
ComputeCameraUsingVanishingPoint.m
r3 =
-0.07360.89590.4381
pitch =
0.0736
roll =
1.1160
Ground plane
Two Vanishing Points
3D world
Camera
r1
r2
r3
Yv
v
X
3D world
Ground plane
Two Vanishing PointsCamera
0
1
0
0
Y
X
1
0
0
0
3D world
r1
r2
r3
Yv
v
X
3D world
Ground plane
Two Vanishing PointsCamera
X
1
0
0
0
v K r r r t X
Kr
C
X 1 2 3 W
1
0
1
0
0
Y
3D world
r1
r2
r3
Yv
v
X
3D world
Ground plane
Two Vanishing PointsCamera
X
1
0
0
0
C
Y 1 2 3 W
2
v K r r r t Y
Kr
v K r r r t X
Kr
C
X 1 2 3 W
1
0
1
0
0
Y
3D world
r1
r2
r3
Yv
v
X
3D world
Ground plane
Two Vanishing PointsCamera
X
1
0
0
0
-1 -1
X Y1 2-1 -1
X Y
,
K v K v
r rK v K v
3 1 2 r r r : Orthogonality constraint
C
Y 1 2 3 W
2
v K r r r t Y
Kr0
1
0
0
Y
3D world
r1
r2
r3
v K r r r t X
Kr
C
X 1 2 3 W
1
Yv
v
X
3D world
Ground plane
Geometric Interpretation
3D world
r1
r2
r3
X
1
0
0
0
-1
X
K v
Ground plane
Geometric Interpretation
X
1
0
0
0
-1
X
K v
0
1
0
0
Y-1
Y
K v
3D world
r1
r2
r3
Ground plane
Geometric Interpretation
X
1
0
0
0
-1
X
K v
3D world
r1
r2
r3
-1
Y
K v
0
1
0
0
Y
Ground plane
Geometric Interpretation
X
1
0
0
0
-1
X
K v
-1 -1
X Y K v K v
3D world
r1
r2
r3
-1
Y
K v
0
1
0
0
Y
Ground plane
Geometric Interpretation (Translation Ambiguity)
Ground plane
Geometric Interpretation (Translation Ambiguity)
Ground plane
Geometric Interpretation (Translation Ambiguity)
Ground plane
Two Vanishing Points
3D world
Camera
r1
r2
r3
f = 4000;K = [f 0 size(im,2)/2;
0 f size(im,1)/2;0 0 1];
l11 = GetLineFromTwoPoints(m11,m12);l12 = GetLineFromTwoPoints(m13,m14);
l21 = GetLineFromTwoPoints(m21,m22);l22 = GetLineFromTwoPoints(m23,m24);
v1 = GetPointFromTwoLines(l11,l12);v2 = GetPointFromTwoLines(l21,l22);
r1 = inv(K)*v1/norm(inv(K)*v1);r2 = inv(K)*v2/norm(inv(K)*v2);
r3 = Vec2Skew(r1)*r2;
R =0.2448 -0.5178 0.0424
-0.1737 -0.1960 -0.69780.9539 0.8327 -0.1379
det(R) = 0.5077
R’*R =0.3299 0.0294 -0.20360.0294 0.5555 -0.2327
-0.2036 -0.2327 1.6224
Not orthogonal matrix!
ComputeCameraUsingTwoVanishingPoints.m
Yv
v
X
3D world
Two Vanishing Pointsf = 1224;K = [f 0 size(im,2)/2;
0 f size(im,1)/2;0 0 1];
l11 = GetLineFromTwoPoints(m11,m12);l12 = GetLineFromTwoPoints(m13,m14);
l21 = GetLineFromTwoPoints(m21,m22);l22 = GetLineFromTwoPoints(m23,m24);
v1 = GetPointFromTwoLines(l11,l12);v2 = GetPointFromTwoLines(l21,l22);
r1 = inv(K)*v1/norm(inv(K)*v1);r2 = inv(K)*v2/norm(inv(K)*v2);
r3 = Vec2Skew(r1)*r2;
ComputeCameraUsingTwoVanishingPoints.m
R =0.5846 -0.8496 0.0508
-0.4149 -0.3216 -0.83670.6972 0.4180 -0.5405
det(R) =0.9948
R’*R =1.0662 -0.0118 0.0250
-0.0118 0.9757 0.02850.0250 0.0285 0.9530
Orthogonal matrix!
Change focal length