Calculation device, camera device, vehicle, and calibration method
A calculation device comprises a controller configured to extract, from a captured image of a subject, a plurality of lines corresponding to straight lines parallel to each other in the subject, and to calculate first calibration data so that mapping lines obtained when the extracted plurality of lines are mapped to a three-dimensional coordinate space are parallel to each other.
1. A calculation device comprising:
a controller configured to extract, from a captured image of a subject, a plurality of lines corresponding to straight lines parallel to each other located on a plane in the subject, to map the extracted plurality of lines to a three-dimensional coordinate space, and to calculate first calibration data so that mapping lines obtained are parallel to each other,
wherein the controller is configured to calibrate an angle θ C between an optical axis of a camera that captures the image and the plane, based on the first calibration data, and
wherein the mapping of the plurality of lines to the three-dimensional coordinate space is conducted according to the following conversion expressions, when coordinate on the captured image expressed as a pixel value is (u, v), and coordinate on XZ-plane in the three-dimensional coordinate space corresponding to the plane is (X, Z),
Z
=
H
C
·
f
-
(
v
-
v
0
)
p
·
tan
θ
C
f
·
tan
θ
C
-
(
v
-
v
0
)
p
X
=
Z
·
(
u
-
u
0
)
·
p
f
where (u 0 , v 0 ) is a point on the optical axis of the camera in the captured image, H C is height of the camera from the plane, f is focal length of lens of the camera, and p is pixel pitch of the camera.
2. The calculation device according to claim 1 ,
wherein the controller is configured to:
calculate the first calibration data for each of a plurality of captured images of the same subject, the plurality of images having parallax therebetween; and
calculate second calibration data by comparing corresponding mapping lines in the plurality of images.
3. The calculation device according to claim 2 ,
wherein the controller is configured to perform calibration for a parallax deviation between a plurality of cameras that captures the plurality of images, based on the second calibration data.
4. A camera device comprising:
a calculation device including a controller configured to extract, from a captured image of a subject, a plurality of lines corresponding to straight lines parallel to each other located on a plane in the subject, to map the extracted plurality of lines to a three-dimensional coordinate space, and to calculate first calibration data so that mapping lines obtained are parallel to each other; and
one or more cameras configured to capture the image of the subject,
wherein the controller is configured to calibrate an angle θ C between an optical axis of at least one camera of the one or more cameras that captures the image and the plane, based on the first calibration data, and
wherein the mapping of the plurality of lines to the three-dimensional coordinate space is conducted according to the following conversion expressions, when coordinate on the captured image expressed as a pixel value is (u, v), and coordinate on XZ-plane in the three-dimensional coordinate space corresponding to the plane is (X, Z),
Z
=
H
C
·
f
-
(
v
-
v
0
)
p
·
tan
θ
C
f
·
tan
θ
C
-
(
v
-
v
0
)
p
X
=
Z
·
(
u
-
u
0
)
·
p
f
where (u 0 , v 0 ) is a point on the optical axis of the at least one camera in the captured image, H C is height of the at least one camera from the plane, f is focal length of lens of the at least one camera, and p is pixel pitch of the at least one camera.
5. A vehicle comprising:
a calculation device including a controller configured to extract, from a captured image of a subject, a plurality of lines corresponding to straight lines parallel to each other located on a plane in the subject, to map the extracted plurality of lines to a three-dimensional coordinate space, and to calculate first calibration data so that mapping lines obtained are parallel to each other; and
one or more cameras configured to capture the image of the subject,
wherein the controller is configured to calibrate an angle θ C between an optical axis of at least one camera of the one or more cameras that captures the image and the plane, based on the first calibration data, and
wherein the mapping of the plurality of lines to the three-dimensional coordinate space is conducted according to the following conversion expressions, when coordinate on the captured image expressed as a pixel value is (u, v), and coordinate on XZ-plane in the three-dimensional coordinate space corresponding to the plane is (X, Z),
Z
=
H
C
·
f
-
(
v
-
v
0
)
p
·
tan
θ
C
f
·
tan
θ
C
-
(
v
-
v
0
)
p
X
=
Z
·
(
u
-
u
0
)
·
p
f
where (u 0 , v 0 ) is a point on the optical axis of the at least one camera in the captured image, H C is height of the at least one camera from the plane, f is focal length of lens of the at least one camera, and p is pixel pitch of the at least one camera.
6. The vehicle according to claim 5 ,
wherein the one or more cameras face outside the vehicle.
7. The vehicle according to claim 5 ,
wherein the controller is configured to perform calibration based on the first calibration data, using a mounting angle of depression of each of the cameras as a reference value.
8. The vehicle according to claim 5 ,
wherein the controller is configured to extract the plurality of straight lines from a ground portion in the image.
9. A calibration method comprising:
extracting, from a captured image of a subject, a plurality of lines corresponding to straight lines parallel to each other located on a plane in the subject;
mapping the extracted plurality of lines to a three-dimensional coordinate space; and
calculating first calibration data so that mapping lines obtained are parallel to each other,
wherein an angle θ C between an optical axis of a camera that captures the image and the plane is calibrated, based on the first calibration data, and
wherein the mapping of the plurality of lines to the three-dimensional coordinate space is conducted according to the following conversion expressions, when coordinate on the captured image expressed as a pixel value is (u, v), and coordinate on XZ-plane in the three-dimensional coordinate space corresponding to the plane is (X, Z),
Z
=
H
C
·
f
-
(
v
-
v
0
)
p
·
tan
θ
C
f
·
tan
θ
C
-
(
v
-
v
0
)
p
X
=
Z
·
(
u
-
u
0
)
·
p
f
where (u 0 , v 0 ) is a point on the optical axis of the camera in the captured image, H C is height of the camera from the plane, f is focal length of lens of the camera, and p is pixel pitch of the camera.
10. The calibration method according to claim 9 , comprising:
calculating the first calibration data for each of a plurality of images having parallax therebetween; and
calculating second calibration data by comparing corresponding mapping lines in the plurality of images.