The present disclosure relates to a camera calibration apparatus, a camera calibration method, and a non-transitory computer readable medium.
In order to perform a three-dimensional analysis of an image captured by cameras, it is necessary to clarify optical characteristics of the cameras and a positional relationship between the cameras. The optical characteristics are parameters unique to each camera, and indicate, for example, a focal length, lens distortion, optical center coordinates, and so on, and are collectively referred to as internal parameters. The internal parameters are invariant unless a zoom value is changed or a lens of the camera is replaced with a different lens. The parameters representing a position of a camera refer to a rotation matrix and a translation vector and are referred to as “external parameters”. The external parameters are invariant as long as the camera is not moved relative to an origin of a world coordinate system (three-dimensional coordinates). If these internal and external parameters are known, size and length of a subject in an image can be converted into a physical distance (e.g., meters), and a three-dimensional shape of the subject can be restored. Calculating one or both of these internal and external parameters is referred to as “camera calibration”. Also, one of the internal parameters and the external parameters may be simply referred to as “camera parameters” or both of them may be simply referred to as “camera parameters” without distinguishing between the internal parameters and the external parameters.
As a method for calculating the camera parameters, for example, Tsai's method described in Non Patent Literature 1 and Zhang's method described in Non Patent Literature 2 are widely known. These methods use a calibration object (e.g., a calibration board) to calculate the camera parameters by linking world coordinates (three-dimensional coordinates) of a pattern drawn on the calibration object with image coordinates in which the pattern is observed on the image.
However, the method disclosed in Non Patent Literature 1 and 2 requires a large calibration object in order to calibrate a camera installed in a wide space such as outdoors which the camera observes a wide-area environment so that a field of view of the camera can be wide. For this reason, it is impossible to perform calibration in practice, or even if it is possible, it may not be convenient. For example, even if a large calibration object is prepared, it is necessary to make sure that the calibration object is not obstructed by any object during shooting. For example, in the case of a road surveillance camera, it is necessary to restrict the traffic of pedestrians and cars.
An object of the present disclosure is to provide a camera calibration apparatus, a camera calibration method, and a non-transitory computer readable medium that can calculate camera parameters by a more convenient method.
In a first example aspect, a camera calibration apparatus includes:
In a second example aspect, a camera calibration method includes:
In a third example aspect, a non-transitory computer readable medium storing a program for causing a camera calibration apparatus to execute processing of:
According to the present disclosure, it is possible to provide a camera calibration apparatus, a camera calibration method, and a non-transitory computer readable medium that can calculate camera parameters by a more convenient method.
Example embodiments will be described below with reference to the drawings. In the example embodiments, the same or equivalent elements are denoted by the same reference signs, and repeated explanations are omitted.
The acquisition unit 11 acquires a “first coordinate pair”, a “second coordinate pair”, a “third coordinate pair”, and a “fourth coordinate pair” extracted from a “plurality of human images” included in one image in which a world coordinate space is captured by the camera (not shown) or a plurality of images captured in time series in which the world coordinate space is captured by the camera (not shown). The “first coordinate pair” includes “first image system coordinates” of a “first type part” and “second image system coordinates” of a “second type part”. The “second coordinate pair” includes “third image system coordinates” of the “first type part” and “fourth image system coordinates” of the “second type part”. The “first type part” and the “second type part” are parts of a human that are horizontally distributed (arranged) in the world coordinate space. The “third coordinate pair” includes “fifth image system coordinates” of a “third type part” and “sixth image system coordinates” of a “fourth type part”. The “fourth coordinate pair” includes “seventh image system coordinates” of the “third type part” and the “eighth image system coordinates” of the “fourth type part”. The “third type part” and the “fourth type part” are parts of a human that are vertically distributed (arranged) in the world coordinate space. The particle size of the “part” may be freely defined. Each of the “first image system coordinates” to the “eighth image system coordinates” is represented by, for example, three-dimensional coordinates obtained by adding scale uncertainty to two-dimensional coordinates which define an image plane, namely, so-called “homogeneous coordinates”.
Here, for example, the first coordinate pair and the third coordinate pair include image system coordinates extracted from a “first human image” of one human. The second coordinate pair and the fourth coordinate pair are extracted from a “second human image” of another human included in the image including the first human image or from a “third human image” of the one human included in the image different from the image including the first human image.
A combination of the first and second type parts may be a combination of a left shoulder joint and a right shoulder joint, a combination of a left hip joint and a right hip joint, a combination of a left eye and a right eye, a combination of a left ear and a right ear, a combination of a left knee and a right knee, or a combination of a left ankle and a right ankle. A combination of the third and fourth type parts may be a combination of upper and lower end parts of a spine, a combination of parietal and lumbar parts, a combination of a hip and a knee (especially of a stationary human), or a combination of an elbow and a wrist.
The vanishing point calculation unit 12 calculates a “first vanishing point” in a horizontal direction based on the first coordinate pair and the second coordinate pair acquired by the acquisition unit 11, and calculates a “second vanishing point” in a vertical direction based on the third coordinate pair and the fourth coordinate pair acquired by the acquisition unit 11.
The camera parameter calculation unit 13 calculates camera parameters of the camera (not shown) based on the first vanishing point and the second vanishing point calculated by the vanishing point calculation unit 12.
As described above, according to the first example embodiment, in the camera calibration apparatus 10, the vanishing point calculation unit 12 calculates the “first vanishing point” in the horizontal direction based on the first coordinate pair and the second coordinate pair acquired by the acquisition unit 11, and calculates the “second vanishing point” in the vertical direction based on the third coordinate pair and the fourth coordinate pair acquired by the acquisition unit 11. The camera parameter calculation unit 13 calculates the camera parameters of the camera (not shown) based on the first vanishing point and the second vanishing point calculated by the vanishing point calculation unit 12.
According to the configuration of the camera calibration apparatus 10, since the camera parameters are calculated by using the image system coordinates of a predetermined part of a human, the camera parameters can be calculated by a more convenient method without requiring a calibration object.
A second example embodiment relates to a more specific example embodiment.
The acquisition unit 11 according to the second example embodiment acquires a “first coordinate pair”, a “second coordinate pair”, a “third coordinate pair”, and a “fourth coordinate pair” in the same manner as in the first example embodiment.
In a manner similar to the first example embodiment, the vanishing point calculation unit 12 according to the second example embodiment calculates a “first vanishing point” in the horizontal direction based on the first coordinate pair and the second coordinate pair acquired by the acquisition unit 11, and calculates a “second vanishing point” in the vertical direction based on the third coordinate pair and the fourth coordinate pair acquired by the acquisition unit 11.
For example, the vanishing point calculation unit 12 according to the second example embodiment calculates a cross product of a “first image system vector” having the first image system coordinates as an end point and a “second image system vector” having the second image system coordinates as an end point to calculate calculates a “first straight line direction vector” which is a direction vector of a first straight line passing through the first image system coordinates or the second image system coordinates. Further, the vanishing point calculation unit 12 calculates a cross product of a “third image system vector” having the third image system coordinates as an end point and a “fourth image system vector” having the fourth image system coordinates as an end point to calculate calculates a “second straight line direction vector” which is a direction vector of a second straight line passing through the third image system coordinates or the fourth image system coordinates. Furthermore, the vanishing point calculation unit 12 calculates a cross product of a “fifth image system vector” having the fifth image system coordinates as an end point and a “sixth image system vector” having the sixth image system coordinates as an end point to calculate calculates a “third straight line direction vector” which is a direction vector of a third straight line passing through the fifth image system coordinates or the sixth image system coordinates. Moreover, the vanishing point calculation unit 12 calculates a cross product of a “seventh image system vector” having seventh image system coordinates as an end point and an “eighth image system vector” having eighth image system coordinates as an end point to calculate calculates a “fourth straight line direction vector” which is a direction vector of a fourth straight line passing through the seventh image system coordinates or the eighth image system coordinates. Note that the starting point of each of the “first image system vector” to the “eighth image system vector” is an origin point of the image system.
The vanishing point calculation unit 12 calculates a cross product of the first straight line direction vector and the second straight line direction vector to calculate a “first vanishing point vector” moving toward the first vanishing point. The vanishing point calculation unit 12 calculates a cross product of the third straight line direction vector and the fourth straight line direction vector to calculate a “second vanishing point vector” moving toward the second vanishing point.
The camera parameter calculation unit 13 according to the second example embodiment includes an internal parameter calculation unit 13A and an external parameter calculation unit 13B.
The internal parameter calculation unit 13A calculates internal parameters of a camera (corresponding to a camera 20 described later) based on the first vanishing point and the second vanishing point calculated by the vanishing point calculation unit 12.
The external parameter calculation unit 13B calculates external parameters of the camera (corresponding to the camera 20 described later) based on the first vanishing point and the second vanishing point calculated by the vanishing point calculation unit 12 and the internal parameters calculated by the internal parameter calculation unit 13A.
An example of a processing operation performed by the camera calibration apparatus having the above configuration will be described.
The acquisition unit 11 acquires the “first coordinate pair”, the “second coordinate pair”, the “third coordinate pair”, and the “fourth coordinate pair” (Step S101).
Here, the “first coordinate pair”, the “second coordinate pair”, the “third coordinate pair”, and the “fourth coordinate pair” are extracted from one image in which the world coordinate space where two humans H1 and H2 are present is captured by the camera 20 installed as shown in, for example,
In
Returning to the description of
Specifically, the vanishing point calculation unit 12 calculates a cross product of a first image system vector m1 and a second image system vector m2 to calculate a first straight line direction vector l1 which is a direction vector of a first straight line passing through image system coordinates m1 or image system coordinates m2 (see
That is, the vanishing point calculation unit 12 calculates the first straight line direction vector l1, the second straight line direction vector l2, the third straight line direction vector l3, and the fourth straight line direction vector l4 using the following Mathematical Formula (1).
Here, “x” is an operator representing a cross product (vector product) of the three-dimensional vectors.
Then, the vanishing point calculation unit 12 calculates a cross product of the first straight line direction vector l1 and the second straight line direction vector l2 to calculate a first vanishing point vector Vx moving toward a first vanishing point Vx. The vanishing point calculation unit 12 calculates a cross product of the third straight line direction vector l3 and the fourth straight line direction vector l4 to calculate a second vanishing point vector Vy moving toward a second vanishing point V y.
That is, the vanishing point calculation unit 12 calculates the first vanishing point vector Vx and the second vanishing point vector Vy using the following Mathematical Formula (2).
Returning to the description of
Here, the first vanishing point vector (the vanishing point in the horizontal direction) Vx and the second vanishing point vector (the vanishing point in the vertical direction) Vy can also be expressed by the following Mathematical Formula (3). The Mathematical Formula (3) shows that a vector having a scale different from that of the first vanishing point vector (the vanishing point in the horizontal direction) Vx can be obtained by projecting a unit vector of the X-axis of the world coordinate system. Similarly, the Mathematical Formula (3) shows that a vector having a scale different from that of the second vanishing point vector (the vanishing point in the vertical direction) Vy can be obtained by projecting a unit vector of the Y-axis of the world coordinate system.
Here, ∝ is an operator indicating that both sides have scale uncertainty.
K is a 3×3 upper triangular matrix representing an internal parameter, and R is a 3×3 rotation matrix representing an external parameter. Further, t is a three-dimensional translation vector which is an external parameter, and ri represents an i-th column of R.
Since the two columns of the rotation matrix R is orthogonal to each other, an inner product of the transposition of r1 and r2 becomes zero, and thus the following Mathematical Formula (4) is obtained.
[Mathematical Formula 4]
r
1
T
r
2
=v
x
T
K
−T
K
−1
V
y=0 (4)
Here, the superscript T represents a transposition of the vector or matrix.
The Mathematical Formula (4) shows that one constraint equation can be obtained from the vanishing point in the horizontal direction and the vanishing point in the vertical direction. That is, one of the internal parameters can be estimated by using the constraint equation. For example, in a digital camera, since there is no large error even if the skew is assumed to be zero and an optical center is assumed to be an image center, the only unknown number is a focal length f. In this case, since k is a diagonal matrix having [f, f, 1] as components, the focal length can be calculated by solving the Mathematical Formula (4). Note that instead of the focal length, the skew, the optical center, or the lens distortion may be used as an internal parameter to be estimated. For example, if the information about the focal length is embedded in the image, the focal length is known, and an internal parameter other than the focal length may be a parameter to be estimated.
Returning to the description of
Specifically, the following Mathematical Formula (5) is obtained from the above Mathematical Formula (3).
Here, // // represents an L2 norm of the vector.
Next, a method of calculating the translation vector will be described. In this example embodiment, the three-dimensional coordinates of each part in the world coordinate system are unknown. Therefore, a world coordinate system having any part as an origin may be defined. Here, the origin is the three-dimensional coordinates in the world coordinate system of the right shoulder P11 corresponding to the image system coordinates m1. In this case, the projection transformation of the image system coordinate m1 is expressed by the following Mathematical Formula (6).
That is, the Mathematical Formula (6) shows that when the origin in the world coordinate system is projected, the image system coordinate m1 is obtained.
In Mathematical Formula (6), since there is scale uncertainty on both sides, the translation vector can be obtained by the following Mathematical Formula (7).
[Mathematical Formula 7]
t=K
−1
m
1 (7)
That is, the external parameter calculation unit 13B calculates the rotation matrix R by using the Mathematical Formula (5) and calculates the translation vector by using the Mathematical Formula (7).
As described above, according to the second example embodiment, in the camera calibration apparatus 10, the vanishing point calculation unit 12 calculates the “first vanishing point” in the horizontal direction based on the first coordinate pair and the second coordinate pair acquired by the acquisition unit 11, and calculates the “second vanishing point” in the vertical direction based on the third coordinate pair and the fourth coordinate pair acquired by the acquisition unit 11. The camera parameter calculation unit 13 calculates a camera parameter of a camera (not shown) based on the first vanishing point and the second vanishing point calculated by the vanishing point calculation unit 12.
According to the configuration of the camera calibration apparatus 10, as in the first example embodiment, the vanishing point is calculated by using the image system coordinates of a predetermined part of a human, and the camera parameters are calculated based on the vanishing point, so that the camera parameter can be calculated by a a more convenient method without requiring a calibration object. The reasons for this are as follows. More specifically, when a human walks, it can be assumed that, for example, a line segment corresponding to the spine is distributed in the vertical direction and a line segment connecting both shoulders is distributed in the horizontal direction. When a plurality of pedestrians are present, it is expected that all the pedestrians move in the substantially same direction. For example, people move in one direction in places such as corridors and walking paths on roads. Therefore, even when a plurality of different pedestrians can be observed, it is possible to calculate the vanishing point by using part information about the pedestrians. Therefore, the camera parameters can be calculated by a more convenient method without requiring a calibration object.
<1> In the first and second example embodiments, the description has been made on the assumption that the acquisition unit 11 acquires the “first coordinate pair”, the “second coordinate pair”, the “third coordinate pair”, and the “fourth coordinate pair” extracted (detected) outside the camera calibration apparatus 10, but the present disclosure is not limited thereto. For example, as shown in
Alternatively, in the camera calibration apparatus 10, the acquisition unit 11 may include a part information reception unit 11B instead of the part detection unit 11A, or both the part detection unit 11A and the part information reception unit 11B as shown in
<2> In the first and second example embodiments, as a minimum configuration, the vanishing point calculation unit 12 calculates the “first vanishing point” in the horizontal direction and the “second vanishing point” in the vertical direction based on two coordinate pairs related to parts distributed horizontally in the world coordinate space and two coordinate pairs related to parts distributed vertically in the world coordinate space. However, the present disclosure is not limited to this. The vanishing point calculation unit 12 may receive three or more coordinate pairs related to parts distributed in the horizontal direction in the world coordinate space, and calculate the “first vanishing point” in the horizontal direction by the least squares method based on the three or more coordinate pairs. Likewise, the vanishing point calculation unit 12 may receive three or more coordinate pairs related to vertically distributed parts in the world coordinate space and calculate the “second vanishing point” in the vertical direction by the least squares method based on the three or more coordinate pairs. At this time, the vanishing point calculation unit 12 may use a known technique such as a so-called RANSAC (Random Sample Consensus) or a weighted least squares method in order to remove outliers and inputs with large errors to improve the estimation accuracy.
<3>
The camera calibration apparatus 10 according to the first and second example embodiments may have the hardware configuration shown in
Although the present disclosure has been described with reference to the above example embodiments, the present disclosure is not limited thereto. Various modifications can be made to the configuration and details of the disclosure within the scope of the disclosure that can be understood by those skilled in the art.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2019/041681 | 10/24/2019 | WO |
Number | Date | Country | |
---|---|---|---|
20240135584 A1 | Apr 2024 | US |