Environmental Engineering Reference
In-Depth Information
at this point and ignore the Z-coordinate. The focal point of the camera is offset by -s
1x
and
-s
1y
at horizontal and vertical directions respectively from the lower left corner of the screen.
Then the position of the corner is
s
1
=[s
1x
, s
1y
]
T
. The lower right corner is
s
2
=[s
2x
, s
2y
]
T
=[L
H
+s
1x
, s
1y
]
T
where L
H
is the width of the screen. Likewise, the upper right corner is
s
3
=[s
3x
, s
3y
]
T
=[L
H
+s
1x
, L
V
+s
1y
]
T
where L
V
is the height of the screen.
2.2 Pointer location using stereovision
Assuming the optical axis of the left camera is rotated from X-axis by angle θ
1
, we can obtain
the rotation matrix of the camera from screen-based coordinate system to camera-based
coordinate system as
cos
sin
1
1
A
.
(1)
1
sin
cos
1
1
Likewise, assuming the focal point of the right camera is located at
d
2
=[d
2x
, d
2y
]
T
with angle
θ
2
, the transformation (rotation and translation) matrix is
cos
sin
d
2
2
2
x
A
sin
cos
d
.
(2)
2
2
2
2
x
0
0
1
Please note that we implied the use of homogeneous coordinates in Eq. 2. We will change
back and forth between [x, y]
T
and [x, y, 1]
T
in calculations and in expressions whenever
necessary. Therefore any point P=[P
x
, P
y
]
T
in the screen can be transformed to
P
cos
P
sin
P
x
1
y
1
1
x
y
P
A P
(3)
1
1
P
P
sin
P
cos
1
x
1
y
1
at camera 1 and
P
P
cos
P
sin
x
2
y
2
2
x
P
A P
(4)
1
2
P
P
sin
P
cos
2
y
x
2
y
2
at camera 2. We assume a pinpoint camera model with the focal length as λ
1
.
For camera 1, the projection of the point P on the image plane can be easily measured from
the image as N
1
=n
1
*c
px1
where n
1
is the pixel position at the image plane and c
px1
is the size
of each pixel for camera 1. Hence, we can easily obtain the following relationship using
similar triangles:
P
sin
P
cos
x
1
y
1
1
(5)
P
cos
P
sin
N
x
1
y
1
1
Likewise, we can find similar result for camera 2 as: